| | |
| | | package com.ard.web.controller.work; |
| | | |
| | | import com.ard.common.core.controller.BaseController; |
| | | import com.ard.common.core.domain.AjaxResult; |
| | | import com.ard.common.core.page.TableDataInfo; |
| | | import com.ard.work.domain.dto.BoxHistoryDTO; |
| | | import com.ard.work.domain.dto.BoxPhotosDTO; |
| | | import com.ard.work.domain.dto.BoxSettingsDTO; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | import static com.ard.common.utils.PageUtils.startPage; |
| | | |
| | | /** |
| | | * UavBaseController |
| | | * |
| | |
| | | @ApiSort(value = 2) |
| | | @RequestMapping("/uav/base") |
| | | @RestController |
| | | public class UavBaseController { |
| | | public class UavBaseController extends BaseController { |
| | | |
| | | @Resource |
| | | private ITyService tyService; |
| | | |
| | | @ApiOperation("获取六合token信息") |
| | | @ApiOperation("获取边缘服务器token信息") |
| | | @ApiOperationSupport(order = 1) |
| | | @GetMapping("/getToken/{serverId}") |
| | | public AjaxResult getToken(@PathVariable("serverId") String serverId) { |
| | | return AjaxResult.success(tyService.getAccessToken(serverId)); |
| | | } |
| | | |
| | | @ApiOperation("获取六合盒子列表") |
| | | @ApiOperation("获取盒子列表") |
| | | @ApiOperationSupport(order = 2) |
| | | @GetMapping("/getBoxList") |
| | | public AjaxResult getBoxList() { |
| | | List<BoxInfoReceiver> BoxList = tyService.getBoxList(); |
| | | return AjaxResult.success(BoxList); |
| | | public AjaxResult getBoxList(@RequestParam(required = false) String serverId) { |
| | | if (serverId == null) { |
| | | return AjaxResult.success(tyService.getBoxList()); |
| | | } else { |
| | | return AjaxResult.success(tyService.getBoxList(serverId)); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取飞行历史") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperationSupport(order = 4) |
| | | @PostMapping("/getBoxHistory") |
| | | public AjaxResult getBoxHistory(@RequestBody BoxHistoryDTO boxHistoryDTO) { |
| | | List<BoxHistoryReceiver> boxHistory = tyService.getBoxHistory(boxHistoryDTO); |
| | |
| | | } |
| | | |
| | | @ApiOperation("获取任务照片") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperationSupport(order = 5) |
| | | @PostMapping("/getBoxPhotos") |
| | | public AjaxResult getBoxPhotos(@RequestBody BoxPhotosDTO boxPhotosDTO) { |
| | | List<BoxPhotosReceiver> boxPhotos = tyService.getBoxPhotos(boxPhotosDTO); |
| | |
| | | } |
| | | |
| | | @ApiOperation("获取直播地址") |
| | | @ApiOperationSupport(order = 5) |
| | | @GetMapping("/getBoxList/{boxSn}") |
| | | @ApiOperationSupport(order = 6) |
| | | @GetMapping("/getBoxLiveUrl/{boxSn}") |
| | | public AjaxResult getBoxLiveUrl(@PathVariable("boxSn") String boxSn) { |
| | | BoxStreamUrlReceiver boxLiveUrl = tyService.getBoxLiveUrl(boxSn); |
| | | return AjaxResult.success(boxLiveUrl); |
| | | } |
| | | |
| | | @ApiOperation("修改云盒设置") |
| | | @ApiOperationSupport(order = 7) |
| | | @PostMapping("/updateBoxSettings") |
| | | public AjaxResult updateBoxSettings(@RequestBody BoxSettingsDTO boxSettingsDTO) { |
| | | Boolean state = tyService.updateBoxSettings(boxSettingsDTO); |
| | | return AjaxResult.success(state); |
| | | } |
| | | |
| | | @ApiOperation("根据[服务器id]获取边缘服务器盒子列表") |
| | | @ApiOperationSupport(order = 8) |
| | | @GetMapping("/getBoxSnToList/{id}") |
| | | public TableDataInfo getBoxSnToList(@PathVariable("id") String id) { |
| | | startPage(); |
| | | List<BoxInfoReceiver> boxList = tyService.getBoxSnToList(id); |
| | | return getDataTable(boxList); |
| | | } |
| | | |
| | | } |