| | |
| | | package com.ard.tianyu.controller; |
| | | |
| | | import com.ard.common.core.domain.AjaxResult; |
| | | import com.ard.tianyu.model.receiver.BoxReceiver; |
| | | 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.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.BoxInfoReceiver; |
| | | import com.ard.tianyu.model.receiver.BoxStreamUrlReceiver; |
| | | import com.ard.tianyu.service.ITyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | @ApiOperation("获取天宇盒子列表") |
| | | @GetMapping("/getBoxList") |
| | | public AjaxResult getBoxList() { |
| | | List<BoxReceiver> BoxList = tyService.getBoxList(); |
| | | //{"state":0,"content":{"companyId":4127,"accessToken":"sOONT0MMVdoKcMBibb40xxgrUrq0Hw9RFiajic3KOzoNtk"}} |
| | | List<BoxInfoReceiver> BoxList = tyService.getBoxList(); |
| | | return AjaxResult.success(BoxList); |
| | | } |
| | | |
| | | @ApiOperation("获取直播地址") |
| | | @GetMapping("/getBoxList/{boxSn}") |
| | | public AjaxResult getBoxLiveUrl(@PathVariable("boxSn") String boxSn) { |
| | | BoxStreamUrlReceiver boxLiveUrl = tyService.getBoxLiveUrl(boxSn); |
| | | return AjaxResult.success(boxLiveUrl); |
| | | } |
| | | |
| | | @ApiOperation("获取飞行历史") |
| | | @PostMapping("/getBoxHistory") |
| | | public AjaxResult getBoxHistory(@RequestBody BoxHistoryDTO boxHistoryDTO) { |
| | | List<BoxHistoryReceiver> boxHistory = tyService.getBoxHistory(boxHistoryDTO); |
| | | return AjaxResult.success(boxHistory); |
| | | } |
| | | |
| | | @ApiOperation("获取任务照片") |
| | | @PostMapping("/getBoxPhotos") |
| | | public AjaxResult getBoxPhotos(@RequestBody BoxPhotosDTO boxPhotosDTO) { |
| | | List<BoxPhotosReceiver> boxPhotos = tyService.getBoxPhotos(boxPhotosDTO); |
| | | return AjaxResult.success(boxPhotos); |
| | | } |
| | | |
| | | @ApiOperation("修改云盒设置") |
| | | @PostMapping("/updateBoxSettings") |
| | | public AjaxResult updateBoxSettings(@RequestBody BoxSettingsDTO boxSettingsDTO) { |
| | | Boolean state = tyService.updateBoxSettings(boxSettingsDTO); |
| | | return AjaxResult.success(state); |
| | | } |
| | | |
| | | @ApiOperation("云台转动(基于角度)") |
| | | @GetMapping("/controlAngle") |
| | | public AjaxResult controlAngle(String boxSn,Integer actionId,Integer rotationAngle) { |
| | | tyService.controlAngle(boxSn,actionId,rotationAngle); |
| | | 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); |
| | | } |
| | | } |