web页面集成

This commit is contained in:
648540858
2020-10-10 17:33:02 +08:00
parent 57fd18cd7c
commit d881c98224
32 changed files with 240 additions and 223 deletions

View File

@@ -176,4 +176,10 @@ public interface IVideoManagerStorager {
* 更新缓存
*/
public void updateCatch();
/**
* 清空通道
* @param deviceId
*/
void cleanChannelsForDevice(String deviceId);
}

View File

@@ -171,4 +171,9 @@ public class VideoManagerJdbcStoragerImpl implements IVideoManagerStorager {
public void updateCatch() {
}
@Override
public void cleanChannelsForDevice(String deviceId) {
}
}

View File

@@ -399,13 +399,13 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
for (int i = 0; i < deviceChannelList.size(); i++) {
String key = (String)deviceChannelList.get(i);
String[] s = key.split("_");
String channelId = s[3];
String channelId = s[3].split(":")[0];
HashSet<String> subChannel = channelMap.get(channelId);
if (subChannel == null) {
subChannel = new HashSet<>();
}
if (s.length > 4) {
subChannel.add(s[4]);
if ("null".equals(s[6])) {
subChannel.add(s[6]);
}
channelMap.put(channelId, subChannel);
System.out.println();
@@ -414,4 +414,15 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
deviceMap.put(device.getDeviceId(),channelMap);
}
}
@Override
public void cleanChannelsForDevice(String deviceId) {
List<DeviceChannel> result = new ArrayList<>();
List<Object> deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + "*");
if (deviceChannelList != null && deviceChannelList.size() > 0 ) {
for (int i = 0; i < deviceChannelList.size(); i++) {
redis.del((String)deviceChannelList.get(i));
}
}
}
}