From ac1a4a027a7bd88efb32e9da666bdba4b5fa166f Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 14 一月 2022 17:04:26 +0800
Subject: [PATCH] 支持国标级联的目录订阅功能

---
 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
index 450c54a..d5caab2 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
@@ -4,6 +4,7 @@
 import com.genersoft.iot.vmp.service.IStreamPushService;
 import com.genersoft.iot.vmp.service.IMediaService;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
+import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -43,13 +44,22 @@
     @ApiImplicitParams({
             @ApiImplicitParam(name = "app", value = "搴旂敤鍚�", dataTypeClass = String.class),
             @ApiImplicitParam(name = "stream", value = "娴乮d", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "mediaServerId", value = "濯掍綋鏈嶅姟鍣╥d", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "mediaServerId", value = "濯掍綋鏈嶅姟鍣╥d", dataTypeClass = String.class, required = false),
     })
     @GetMapping(value = "/stream_info_by_app_and_stream")
     @ResponseBody
-    public StreamInfo getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam String mediaServerId){
-
-        return mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream,mediaServerId);
+    public WVPResult<StreamInfo> getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam(required = false) String mediaServerId){
+        StreamInfo streamInfoByAppAndStreamWithCheck = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId);
+        WVPResult<StreamInfo> result = new WVPResult<>();
+        if (streamInfoByAppAndStreamWithCheck != null){
+            result.setCode(0);
+            result.setMsg("scccess");
+            result.setData(streamInfoByAppAndStreamWithCheck);
+        }else {
+            result.setCode(-1);
+            result.setMsg("fail");
+        }
+        return result;
     }
 
 

--
Gitblit v1.8.0