| | |
| | | import com.ard.tianyu.model.dto.BoxHistoryDTO; |
| | | import com.ard.tianyu.model.dto.BoxPhotosDTO; |
| | | import com.ard.tianyu.model.dto.BoxSettingsDTO; |
| | | import com.ard.tianyu.model.dto.camera.CapturePicDTO; |
| | | import com.ard.tianyu.model.dto.camera.RecordDTO; |
| | | import com.ard.tianyu.model.dto.control.AbsAngleControlDTO; |
| | | import com.ard.tianyu.model.dto.control.AngleControlDTO; |
| | | import com.ard.tianyu.model.dto.control.SpeedControlDTO; |
| | | import com.ard.tianyu.model.dto.signal.SignalInfo; |
| | | import com.ard.tianyu.model.dto.state.UavState; |
| | | import com.ard.tianyu.model.dto.telemetry.TelemetryData; |
| | | import com.ard.tianyu.model.receiver.BoxHistoryReceiver; |
| | | import com.ard.tianyu.model.receiver.BoxPhotosReceiver; |
| | | import com.ard.tianyu.model.receiver.BoxReceiver; |
| | | import com.ard.tianyu.model.receiver.PullStreamUrlReceiver; |
| | | import com.ard.tianyu.model.receiver.BoxInfoReceiver; |
| | | import com.ard.tianyu.model.receiver.BoxStreamUrlReceiver; |
| | | import com.ard.tianyu.service.ITyService; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @ApiOperation("获取天宇盒子列表") |
| | | @GetMapping("/getBoxList") |
| | | public AjaxResult getBoxList() { |
| | | List<BoxReceiver> BoxList = tyService.getBoxList(); |
| | | List<BoxInfoReceiver> BoxList = tyService.getBoxList(); |
| | | return AjaxResult.success(BoxList); |
| | | } |
| | | |
| | | @ApiOperation("获取直播地址") |
| | | @GetMapping("/getBoxList/{boxSn}") |
| | | public AjaxResult getBoxLiveUrl(@PathVariable("boxSn") String boxSn) { |
| | | PullStreamUrlReceiver boxLiveUrl = tyService.getBoxLiveUrl(boxSn); |
| | | BoxStreamUrlReceiver boxLiveUrl = tyService.getBoxLiveUrl(boxSn); |
| | | return AjaxResult.success(boxLiveUrl); |
| | | } |
| | | |
| | |
| | | List<BoxPhotosReceiver> boxPhotos = tyService.getBoxPhotos(boxPhotosDTO); |
| | | return AjaxResult.success(boxPhotos); |
| | | } |
| | | |
| | | @ApiOperation("修改云盒设置") |
| | | @PostMapping("/updateBoxSettings") |
| | | public AjaxResult updateBoxSettings(@RequestBody BoxSettingsDTO boxSettingsDTO) { |
| | |
| | | return AjaxResult.success(state); |
| | | } |
| | | |
| | | @ApiOperation("云台转动(基于角度)") |
| | | @GetMapping("/controlAngle") |
| | | public AjaxResult controlAngle(String boxSn) { |
| | | tyService.controlAngle(boxSn); |
| | | @ApiOperation(value = "云台转动(基于角度)", notes = "actionCode值:0-回中,1-上,2-右上,3-右,4-右下,5-下,6-左下,7-左,8-左上,254-停止") |
| | | @ApiOperationSupport(order = 1) |
| | | @PostMapping("/angleControl") |
| | | public AjaxResult angleControl(@RequestBody AngleControlDTO angleControlDto) { |
| | | tyService.angleControl(angleControlDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "云台绝对值控制(基于角度)", notes = "俯仰pitch范围:[-120°至+30°] 平移yaw范围:[-180°至+180°] 横滚roll范围:[-90°至+60°]") |
| | | @ApiOperationSupport(order = 2) |
| | | @PostMapping("/absAngleControl") |
| | | public AjaxResult absAngleControl(@RequestBody @Validated AbsAngleControlDTO angleControlDto) { |
| | | tyService.absAngleControl(angleControlDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "云台转动(基于速度)", notes = "俯仰转动速度:上正下负 平移转动速度:右正左负 横滚转动速度:顺时针正,逆时针负") |
| | | @ApiOperationSupport(order = 3) |
| | | @PostMapping("/speedControl") |
| | | public AjaxResult speedControl(@RequestBody @Validated SpeedControlDTO speedControlDto) { |
| | | tyService.speedControl(speedControlDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation("拍照") |
| | | @ApiOperationSupport(order = 4) |
| | | @PostMapping("/capturePicDto") |
| | | public AjaxResult capturePic(@RequestBody CapturePicDTO capturePicDto) { |
| | | tyService.capturePic(capturePicDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation("录像") |
| | | @ApiOperationSupport(order = 5) |
| | | @PostMapping("/record") |
| | | public AjaxResult record(@RequestBody RecordDTO recordDto) { |
| | | tyService.record(recordDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation("获取无人机状态") |
| | | @GetMapping("/getUavState") |
| | | public AjaxResult getUavState(String boxSn) { |
| | | UavState uavState = tyService.getUavState(boxSn); |
| | | return AjaxResult.success(uavState); |
| | | } |
| | | |
| | | @ApiOperation("获取无人机遥测数据") |
| | | @GetMapping("/getUavTelemetryData") |
| | | public AjaxResult getUavTelemetryData(String boxSn) { |
| | | TelemetryData telemetryData = tyService.getUavTelemetryData(boxSn); |
| | | return AjaxResult.success(telemetryData); |
| | | } |
| | | |
| | | @ApiOperation("获取无人机信道质量数据") |
| | | @GetMapping("/getSignalInfo") |
| | | public AjaxResult getSignalInfo(String boxSn) { |
| | | SignalInfo signalInfo = tyService.getSignalInfo(boxSn); |
| | | return AjaxResult.success(signalInfo); |
| | | } |
| | | } |