From 422ce8aebb1899fa4d3cc50194f35c78817058fb Mon Sep 17 00:00:00 2001
From: panlinlin <648540858@qq.com>
Date: 星期五, 08 一月 2021 11:04:29 +0800
Subject: [PATCH] 完成向上级联->选择通道-001
---
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java | 47 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 41 insertions(+), 6 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 8eaaf68..89eaa13 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
@@ -4,9 +4,11 @@
import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.conf.MediaServerConfig;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
+import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
+import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
+import com.genersoft.iot.vmp.gb28181.bean.PlatformRegister;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
-import com.genersoft.iot.vmp.storager.dao.DeviceMapper;
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -21,9 +23,6 @@
@Autowired
private RedisUtil redis;
-
- @Autowired
- private DeviceMapper deviceMapper;
@Autowired
private DeviceChannelMapper deviceChannelMapper;
@@ -51,7 +50,6 @@
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId());
if (deviceChannel != null) {
deviceChannel.setStreamId(null);
- deviceChannel.setPlay(false);
deviceChannel.setDeviceId(streamInfo.getDeviceID());
deviceChannelMapper.update(deviceChannel);
}
@@ -144,7 +142,6 @@
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId());
if (deviceChannel != null) {
deviceChannel.setStreamId(null);
- deviceChannel.setPlay(false);
deviceChannel.setDeviceId(streamInfo.getDeviceID());
deviceChannelMapper.update(deviceChannel);
}
@@ -169,4 +166,42 @@
if (playLeys == null || playLeys.size() == 0) return null;
return (StreamInfo)redis.get(playLeys.get(0).toString());
}
+
+ @Override
+ public void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch) {
+ String key = VideoManagerConstants.PLATFORM_CATCH_PREFIX + parentPlatformCatch.getId();
+ redis.set(key, parentPlatformCatch);
+ }
+
+ @Override
+ public void updatePlatformKeepalive(ParentPlatform parentPlatform) {
+ String key = VideoManagerConstants.PLATFORM_KEEPLIVEKEY_PREFIX + parentPlatform.getDeviceGBId();
+ redis.set(key, "", Integer.parseInt(parentPlatform.getKeepTimeout()));
+ }
+
+ @Override
+ public void updatePlatformRegister(ParentPlatform parentPlatform) {
+ String key = VideoManagerConstants.PLATFORM_REGISTER_PREFIX + parentPlatform.getDeviceGBId();
+ redis.set(key, "", Integer.parseInt(parentPlatform.getExpires()));
+ }
+
+ @Override
+ public ParentPlatformCatch queryPlatformCatchInfo(String platformGbId) {
+ return (ParentPlatformCatch)redis.get(VideoManagerConstants.PLATFORM_CATCH_PREFIX + platformGbId);
+ }
+
+ @Override
+ public void delPlatformCatchInfo(String platformGbId) {
+ redis.del(VideoManagerConstants.PLATFORM_CATCH_PREFIX + platformGbId);
+ }
+
+ @Override
+ public void delPlatformKeepalive(String platformGbId) {
+ redis.del(VideoManagerConstants.PLATFORM_KEEPLIVEKEY_PREFIX + platformGbId);
+ }
+
+ @Override
+ public void delPlatformRegister(String platformGbId) {
+ redis.del(VideoManagerConstants.PLATFORM_REGISTER_PREFIX + platformGbId);
+ }
}
--
Gitblit v1.8.0