From 16b1bf681950b0fc2d1dbbf3d07d4c8183507193 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Sat, 26 Oct 2024 23:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87Catalog=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=A4=84=E7=90=86=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/gb28181/session/CatalogDataManager.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataManager.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataManager.java index ac5119e3..d0a7dc12 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataManager.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataManager.java @@ -257,4 +257,20 @@ public class CatalogDataManager implements CommandLineRunner { catalogData.setErrorMsg(errorMsg); catalogData.setTime(Instant.now()); } + + public int size(String deviceId) { + CatalogData catalogData = dataMap.get(deviceId); + if (catalogData == null) { + return 0; + } + return catalogData.getRedisKeysForChannel().size(); + } + + public int sumNum(String deviceId) { + CatalogData catalogData = dataMap.get(deviceId); + if (catalogData == null) { + return 0; + } + return catalogData.getTotal(); + } }