From 341ea7110a954bf72493990e02eef5048504c3d4 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 05 十一月 2021 10:04:45 +0800
Subject: [PATCH] 添加注释
---
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java | 50 +++++++++++++++++++++++++++++---------------------
1 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
index 0318772..e5b1269 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
@@ -1,8 +1,8 @@
package com.genersoft.iot.vmp.storager.impl;
+import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.common.VideoManagerConstants;
-import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
@@ -10,6 +10,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import java.text.SimpleDateFormat;
import java.util.*;
@SuppressWarnings("rawtypes")
@@ -22,6 +23,7 @@
@Autowired
private DeviceChannelMapper deviceChannelMapper;
+ private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
* 寮�濮嬫挱鏀炬椂灏嗘祦瀛樺叆redis
@@ -82,26 +84,6 @@
channelId));
if (playLeys == null || playLeys.size() == 0) return null;
return (StreamInfo)redis.get(playLeys.get(0).toString());
- }
-
- /**
- * 鏇存柊娴佸獟浣撲俊鎭�
- * @param ZLMServerConfig
- * @return
- */
- @Override
- public boolean updateMediaInfo(ZLMServerConfig ZLMServerConfig) {
- ZLMServerConfig.setUpdateTime(System.currentTimeMillis());
- return redis.set(VideoManagerConstants.MEDIA_SERVER_PREFIX, ZLMServerConfig);
- }
-
- /**
- * 鑾峰彇娴佸獟浣撲俊鎭�
- * @return
- */
- @Override
- public ZLMServerConfig getMediaInfo() {
- return (ZLMServerConfig)redis.get(VideoManagerConstants.MEDIA_SERVER_PREFIX);
}
@Override
@@ -291,4 +273,30 @@
}
}
}
+
+ @Override
+ public void outlineForAll() {
+ List<Object> onlineDevices = redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX + "*" );
+ for (int i = 0; i < onlineDevices.size(); i++) {
+ String key = (String) onlineDevices.get(i);
+ redis.del(key);
+ }
+ }
+
+ @Override
+ public List<String> getOnlineForAll() {
+ List<String> result = new ArrayList<>();
+ List<Object> onlineDevices = redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX + "*" );
+ for (int i = 0; i < onlineDevices.size(); i++) {
+ String key = (String) onlineDevices.get(i);
+ result.add((String) redis.get(key));
+ }
+ return result;
+ }
+
+ @Override
+ public void updateWVPInfo(JSONObject jsonObject) {
+
+ }
+
}
--
Gitblit v1.8.0