From 065142057ba3983af899991085e37ac1ec502320 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期二, 19 九月 2023 14:06:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/java/com/ruoyi/media/controller/MediaController.java | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/media/controller/MediaController.java b/ard-work/src/main/java/com/ruoyi/media/controller/MediaController.java
index 411a27f..48490b4 100644
--- a/ard-work/src/main/java/com/ruoyi/media/controller/MediaController.java
+++ b/ard-work/src/main/java/com/ruoyi/media/controller/MediaController.java
@@ -18,10 +18,11 @@
import javax.annotation.Resource;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
/**
- * @Description:
+ * @Description: 娴佸獟浣撲笟鍔�
* @ClassName: controller
* @Author: 鍒樿嫃涔�
* @Date: 2023骞�07鏈�13鏃�9:26
@@ -51,14 +52,18 @@
if (StringUtils.isEmpty(streamInfo.getRtspSource())) {
return AjaxResult.error("rtsp鍦板潃涓嶈兘涓虹┖");
}
- String rtsp = mediaService.addPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode(), streamInfo.getIsCode());
+ Map<String, String> map = mediaService.addPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode(), streamInfo.getIsCode());
+ map.get("rtspUrl");
Vtdu vtdu = new Vtdu();
vtdu.setName(streamInfo.getName());
- vtdu.setRtspUrl(streamInfo.getRtspSource());
+ vtdu.setSourceUrl(streamInfo.getRtspSource());
vtdu.setIsCode(streamInfo.getIsCode());
vtdu.setCodeType(streamInfo.getMode());
+ vtdu.setRtspUrl(map.get("rtspUrl"));
+ vtdu.setRtmpUrl(map.get("rtmpUrl"));
+ vtdu.setWebrtcUrl(map.get("webrtcUrl"));
vtduService.insertVtdu(vtdu);
- return AjaxResult.success(rtsp);
+ return AjaxResult.success(map);
}
@@ -70,16 +75,17 @@
@PreAuthorize("@ss.hasPermi('media:stream:edit')")
@PutMapping
public AjaxResult edit(@RequestBody StreamInfo streamInfo) {
- mediaService.removePath(new String[]{streamInfo.getName()});
- vtduService.deleteVtduByName(streamInfo.getName());
- String rtsp = mediaService.addPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode(), streamInfo.getIsCode());
+ Map<String, String> map = mediaService.editPath(streamInfo.getName(), streamInfo.getRtspSource(), streamInfo.getMode(), streamInfo.getIsCode());
Vtdu vtdu = new Vtdu();
vtdu.setName(streamInfo.getName());
- vtdu.setRtspUrl(streamInfo.getRtspSource());
+ vtdu.setSourceUrl(streamInfo.getRtspSource());
vtdu.setIsCode(streamInfo.getIsCode());
vtdu.setCodeType(streamInfo.getMode());
- vtduService.insertVtdu(vtdu);
- return AjaxResult.success(rtsp);
+ vtdu.setRtspUrl(map.get("rtspUrl"));
+ vtdu.setRtmpUrl(map.get("rtmpUrl"));
+ vtdu.setWebrtcUrl(map.get("webrtcUrl"));
+ vtduService.updateVtdu(vtdu);
+ return AjaxResult.success(map);
}
/**
--
Gitblit v1.9.3