From 2217289657c3a402e132490497b10f3876bc1aa1 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 06 十一月 2023 10:17:36 +0800
Subject: [PATCH] 获取三一地址
---
ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java b/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
index b7242fd..694b3a5 100644
--- a/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
@@ -35,7 +35,7 @@
@Slf4j(topic = "vtdu")
@Order(2)
public class MediaServiceImpl implements IMediaService, ApplicationRunner {
- private static List<String> mediaNameList = new ArrayList<>();
+ public static List<String> mediaNameList = new ArrayList<>();
@Resource
MediaClient mediaClient;
@@ -90,6 +90,7 @@
if (!checkNameExist(name)) {
mediaClient.addPath(name, conf);
+ mediaNameList.add(name);
}
map.put("rtspUrl", rtspUrl);
@@ -184,6 +185,7 @@
try {
if (checkNameExist(name)) {
mediaClient.removePath(name);
+ mediaNameList.remove(name);
}
} catch (ForestRuntimeException ex) {
log.error("绉婚櫎娴佸獟浣撳紓甯革細" + ex.getMessage());
@@ -473,20 +475,19 @@
*/
@Override
public List<String> getNameList() {
- List<String> nameList = new ArrayList<>();
try {
String paths = mediaClient.paths();
JsonsRoot jsonsRoot = JSONObject.parseObject(paths, JsonsRoot.class);
List<Items> items = jsonsRoot.getItems();
for (Items item : items) {
- nameList.add(item.getName());
+ mediaNameList.add(item.getName());
}
} catch (ForestNetworkException ex) {
log.error("鑾峰彇娴佸獟浣搉ame鍒楄〃寮傚父锛�" + ex.getMessage());
} catch (ForestRuntimeException ex) {
log.error("鑾峰彇娴佸獟浣搉ame鍒楄〃寮傚父锛�" + ex.getMessage());
}
- return nameList;
+ return mediaNameList;
}
/**
--
Gitblit v1.9.3