| | |
| | | import com.ard.common.utils.SecurityUtils; |
| | | import com.ard.sample.common.model.ResponseResult; |
| | | import com.ard.sample.component.mqtt.model.ChannelName; |
| | | import com.ard.sample.component.websocket.handler.LiveStreamHandler; |
| | | import com.ard.sample.manage.model.dto.CapacityDeviceDTO; |
| | | import com.ard.sample.manage.model.dto.LiveTypeDTO; |
| | | import com.ard.sample.manage.model.param.RemoteDebugParam; |
| | | import com.ard.sample.manage.model.receiver.LiveCapacityReceiver; |
| | | import com.ard.sample.manage.service.IDeviceService; |
| | | import com.ard.sample.manage.service.ILiveStreamService; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | |
| | | private ILiveStreamService liveStreamService; |
| | | |
| | | @Autowired |
| | | private LiveStreamHandler _liveStreamHandler; |
| | | |
| | | @Autowired |
| | | private ObjectMapper mapper; |
| | | |
| | | /** |
| | |
| | | * @return live capability |
| | | */ |
| | | @ApiOperation(value = "获取直播能力数据", notes = "获取当前用户工作空间下所有无人机的直播能力数据") |
| | | @PreAuthorize("@ss.hasPermi('dock:live:capacity')") |
| | | // @PreAuthorize("@ss.hasPermi('dock:live:capacity')") |
| | | @GetMapping("/capacity") |
| | | public ResponseResult<List<CapacityDeviceDTO>> getLiveCapacity(HttpServletRequest request) { |
| | | // Get information about the current user. |
| | | List<CapacityDeviceDTO> liveCapacity = liveStreamService.getLiveCapacity(); |
| | | |
| | | return ResponseResult.success(liveCapacity); |
| | | } |
| | | |
| | | @ApiOperation("获取video_id") |
| | | @PostMapping("/videoid/{sn}") |
| | | public ResponseResult<LiveTypeDTO> getVideoId(@PathVariable String sn) { |
| | | LiveTypeDTO liveTypeDTO = new LiveTypeDTO(); |
| | | try{ |
| | | liveTypeDTO = _liveStreamHandler.getLiveParam(sn); |
| | | |
| | | } |
| | | catch (Exception e){ |
| | | // videoId = e.getMessage(); |
| | | e.printStackTrace(); |
| | | } |
| | | return ResponseResult.success(liveTypeDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "开始直播", notes = "根据前端传入的参数开始直播") |
| | | @PreAuthorize("@ss.hasPermi('dock:live:start')") |
| | | // @PreAuthorize("@ss.hasPermi('dock:live:start')") |
| | | @PostMapping("/streams/start") |
| | | public ResponseResult liveStart(@RequestBody LiveTypeDTO liveParam) { |
| | | return liveStreamService.liveStart(liveParam); |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "停止直播", notes = "根据前端传入的参数停止直播") |
| | | @PreAuthorize("@ss.hasPermi('dock:live:stop')") |
| | | // @PreAuthorize("@ss.hasPermi('dock:live:stop')") |
| | | @PostMapping("/streams/stop") |
| | | public ResponseResult liveStop(@RequestBody LiveTypeDTO liveParam) { |
| | | return liveStreamService.liveStop(liveParam.getVideoId()); |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "设置直播质量", notes = "根据前端传入的参数设置直播质量") |
| | | @PreAuthorize("@ss.hasPermi('dock:live:quality')") |
| | | // @PreAuthorize("@ss.hasPermi('dock:live:quality')") |
| | | @PostMapping("/quality/switch") |
| | | public ResponseResult liveSetQuality(@RequestBody LiveTypeDTO liveParam) { |
| | | return liveStreamService.liveSetQuality(liveParam); |
| | | } |
| | | |
| | | @ApiOperation(value = "切换镜头", notes = "根据前端传入的参数切换镜头") |
| | | @PreAuthorize("@ss.hasPermi('dock:live:lens')") |
| | | // @PreAuthorize("@ss.hasPermi('dock:live:lens')") |
| | | @PostMapping("/lens/switch") |
| | | public ResponseResult liveLensChange(@RequestBody LiveTypeDTO liveParam) { |
| | | return liveStreamService.liveLensChange(liveParam); |
| | | } |
| | | |
| | | @ApiOperation(value = "机场直播相机切换", notes = "根据前端传入的参数切换相机") |
| | | @PreAuthorize("@ss.hasPermi('dock:live:camera')") |
| | | // @PreAuthorize("@ss.hasPermi('dock:live:camera')") |
| | | @PostMapping("/camera/switch") |
| | | public ResponseResult liveCameraChange(@RequestBody LiveTypeDTO liveParam) { |
| | | return liveStreamService.liveCameraChange(liveParam); |