From bf4990ffb53e2a0e7b2ec0c7a8a054bdf8a57db5 Mon Sep 17 00:00:00 2001
From: shenyijian <1178253012@qq.com>
Date: Thu, 16 Nov 2023 10:02:13 +0800
Subject: [PATCH] 无人机 -设备分页新增保护区ID查询条件

---
 src/main/java/com/dji/sample/manage/controller/LiveStreamController.java |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/dji/sample/manage/controller/LiveStreamController.java b/src/main/java/com/dji/sample/manage/controller/LiveStreamController.java
index 6154e94..7c1d18b 100644
--- a/src/main/java/com/dji/sample/manage/controller/LiveStreamController.java
+++ b/src/main/java/com/dji/sample/manage/controller/LiveStreamController.java
@@ -48,21 +48,23 @@
 
     /**
      * Get live capability data of all drones in the current user's workspace from the database.
-     * @param request
+     * 从数据库中获取当前工作区中所有无人机的实时性能数据。
+     * @param workspaceId
      * @return  live capability
      */
-    @GetMapping("/capacity")
-    public ResponseResult<List<CapacityDeviceDTO>> getLiveCapacity(HttpServletRequest request) {
-        // Get information about the current user.
-        CustomClaim customClaim = (CustomClaim)request.getAttribute(TOKEN_CLAIM);
+    @GetMapping("/capacity/{workspace_id}")
+    public ResponseResult<List<CapacityDeviceDTO>> getLiveCapacity(@PathVariable("workspace_id") String workspaceId,String sn) {
+        // Get information about the current user. 获取当前登录用户的信息
+//        CustomClaim customClaim = (CustomClaim)request.getAttribute(TOKEN_CLAIM);
 
-        List<CapacityDeviceDTO> liveCapacity = liveStreamService.getLiveCapacity(customClaim.getWorkspaceId());
+        List<CapacityDeviceDTO> liveCapacity = liveStreamService.getLiveCapacity(workspaceId,sn);
 
         return ResponseResult.success(liveCapacity);
     }
 
     /**
      * Live streaming according to the parameters passed in from the web side.
+     * 根据从web端传入的参数进行直播。
      * @param liveParam Live streaming parameters.
      * @return
      */
@@ -73,6 +75,7 @@
 
     /**
      * Stop live streaming according to the parameters passed in from the web side.
+     * 根据从web端传入的参数停止直播。
      * @param liveParam Live streaming parameters.
      * @return
      */
@@ -91,4 +94,9 @@
         return liveStreamService.liveSetQuality(liveParam);
     }
 
-}
\ No newline at end of file
+    @PostMapping("/streams/switch")
+    public ResponseResult liveLensChange(@RequestBody LiveTypeDTO liveParam) {
+        return liveStreamService.liveLensChange(liveParam);
+    }
+
+}

--
Gitblit v1.9.3