From 2e98b20bea4463e4465e3c19059d0744a09aec06 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Tue, 27 Jun 2023 14:34:41 +0800
Subject: [PATCH] gb28181版本升级-补充
---
src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java b/src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java
new file mode 100644
index 0000000..93e2b87
--- /dev/null
+++ b/src/main/java/com/genersoft/iot/vmp/conf/WVPTimerTask.java
@@ -0,0 +1,33 @@
+package com.genersoft.iot.vmp.conf;
+
+import com.alibaba.fastjson.JSONObject;
+import com.genersoft.iot.vmp.service.IMediaServerService;
+import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WVPTimerTask {
+
+ @Autowired
+ private IRedisCatchStorage redisCatchStorage;
+
+ @Autowired
+ private IMediaServerService mediaServerService;
+
+ @Value("${server.port}")
+ private int serverPort;
+
+ @Autowired
+ private SipConfig sipConfig;
+
+ @Scheduled(fixedRate = 2 * 1000) //每3秒执行一次
+ public void execute(){
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("ip", sipConfig.getIp());
+ jsonObject.put("port", serverPort);
+ redisCatchStorage.updateWVPInfo(jsonObject, 3);
+ }
+}
--
Gitblit v1.9.3