liusuyi
2024-10-22 7f9d813634b584abc6e076bf777f6064eaede3d2
ard-work/src/main/java/com/ard/tianyu/controller/UavController.java
@@ -1,13 +1,16 @@
package com.ard.tianyu.controller;
import com.ard.common.core.domain.AjaxResult;
import com.ard.tianyu.model.dto.BoxHistoryDTO;
import com.ard.tianyu.model.dto.BoxPhotosDTO;
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.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;
@@ -36,7 +39,27 @@
    @GetMapping("/getBoxList")
    public AjaxResult getBoxList() {
        List<BoxReceiver> BoxList = tyService.getBoxList();
        //{"state":0,"content":{"companyId":4127,"accessToken":"sOONT0MMVdoKcMBibb40xxgrUrq0Hw9RFiajic3KOzoNtk"}}
        return AjaxResult.success(BoxList);
    }
    @ApiOperation("获取直播地址")
    @GetMapping("/getBoxList/{boxSn}")
    public AjaxResult getBoxLiveUrl(@PathVariable("boxSn") String boxSn) {
        PullStreamUrlReceiver 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);
    }
}