From d4f6ec39b7e0421757a6b9d1a68b1c4610ea2e8c Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 14 三月 2024 14:54:20 +0800
Subject: [PATCH] 优化CivilCode缓存

---
 src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
index 9fbec1f..55fa5e9 100755
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
@@ -1,5 +1,6 @@
 package com.genersoft.iot.vmp.service.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.genersoft.iot.vmp.common.InviteInfo;
 import com.genersoft.iot.vmp.common.InviteSessionType;
 import com.genersoft.iot.vmp.gb28181.bean.Device;
@@ -17,6 +18,7 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -27,6 +29,7 @@
  * @author lin
  */
 @Service
+@DS("master")
 public class DeviceChannelServiceImpl implements IDeviceChannelService {
 
     private final static Logger logger = LoggerFactory.getLogger(DeviceChannelServiceImpl.class);
@@ -265,5 +268,16 @@
         }
     }
 
-
+    @Override
+    public void updateChannelStreamIdentification(DeviceChannel channel) {
+        assert !ObjectUtils.isEmpty(channel.getDeviceId());
+        assert !ObjectUtils.isEmpty(channel.getStreamIdentification());
+        if (ObjectUtils.isEmpty(channel.getStreamIdentification())) {
+            logger.info("[閲嶇疆閫氶亾鐮佹祦绫诲瀷] 璁惧: {}, 鐮佹祦锛� {}", channel.getDeviceId(), channel.getStreamIdentification());
+        }else {
+            logger.info("[鏇存柊閫氶亾鐮佹祦绫诲瀷] 璁惧: {}, 閫氶亾锛歿}锛� 鐮佹祦锛� {}", channel.getDeviceId(), channel.getChannelId(),
+                    channel.getStreamIdentification());
+        }
+        channelMapper.updateChannelStreamIdentification(channel);
+    }
 }

--
Gitblit v1.8.0