rain
2024-08-05 94174d2cc22afed6f41c270d970903484bfc5708
src/main/java/com/dji/sample/manage/controller/LiveStreamController.java
@@ -15,6 +15,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import static com.dji.sample.component.AuthInterceptor.TOKEN_CLAIM;
@@ -53,17 +54,17 @@
     * @return  live capability
     */
    @GetMapping("/capacity/{workspace_id}")
    public ResponseResult<List<CapacityDeviceDTO>> getLiveCapacity(@PathVariable("workspace_id") String workspaceId) {
    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(workspaceId);
        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
     */
@@ -72,8 +73,14 @@
        return liveStreamService.liveStart(liveParam);
    }
    @PostMapping("/streams/address")
    public ResponseResult liveAddress(@RequestParam String deviceSn,@RequestParam String deviceName) throws IOException {
        return liveStreamService.liveAddress(deviceSn,deviceName);
    }
    /**
     * Stop live streaming according to the parameters passed in from the web side.
     * 根据从web端传入的参数停止直播。
     * @param liveParam Live streaming parameters.
     * @return
     */
@@ -83,8 +90,8 @@
    }
    /**
     * Set the quality of the live streaming according to the parameters passed in from the web side.
     * @param liveParam Live streaming parameters.
     * 根据从web端传入的参数设置直播的质量。
     * @param liveParam 直播参数
     * @return
     */
    @PostMapping("/streams/update")