zhaowenyu
2026-02-04 9c3c085032bddf6bb5e8b730067292e7f1520328
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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.*;
import com.ard.work.domain.dto.telemetry.TelemetryData;
import com.ard.work.domain.entity.*;
import com.ard.work.domain.receiver.*;
import com.ard.work.service.IArdFlightTaskPartService;
import com.ard.work.service.IArdFlightTaskService;
import com.ard.work.service.IArdMediaService;
import com.ard.work.service.ITyService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
 
/**
 * UavBaseController
 *
 * @author liusuyi
 * @date 2024年10月21日13:52
 **/
@Api(tags = "无人机基础接口")
@ApiSort(value = 2)
@RequestMapping("/uav/base")
@RestController
public class UavBaseController extends BaseController {
 
    @Resource
    private ITyService tyService;
    @Resource
    private IArdFlightTaskService ardFlightTaskService;
    @Resource
    private IArdFlightTaskPartService ardFlightTaskPartService;
    @Resource
    private IArdMediaService ardMediaService;
 
    @ApiOperation("获取边缘服务器token信息")
    @ApiOperationSupport(order = 1)
    @GetMapping("/getToken/{serverId}")
    public AjaxResult getToken(@PathVariable("serverId") String serverId) {
        return AjaxResult.success(tyService.getAccessToken(serverId));
    }
 
    @ApiOperation("获取盒子列表")
    @ApiOperationSupport(order = 2)
    @GetMapping("/getBoxList")
    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 = 4)
    @PostMapping("/getBoxHistory")
    public AjaxResult getBoxHistory(@RequestBody BoxHistoryDTO boxHistoryDTO) {
        List<BoxHistoryReceiver> boxHistory = tyService.getBoxHistory(boxHistoryDTO);
        return AjaxResult.success(boxHistory);
    }
 
    @ApiOperation("获取任务照片")
    @ApiOperationSupport(order = 5)
    @PostMapping("/getBoxPhotos")
    public AjaxResult getBoxPhotos(@RequestBody BoxPhotosDTO boxPhotosDTO) {
        List<BoxPhotosReceiver> boxPhotos = tyService.getBoxPhotos(boxPhotosDTO);
        return AjaxResult.success(boxPhotos);
    }
 
    @ApiOperation("获取任务视频")
    @ApiOperationSupport(order = 5)
    @PostMapping("/getBoxVideos")
    public AjaxResult getBoxVideos(@RequestBody BoxVideosDTO boxVideosDTO) {
        List<BoxVideosReceiver> boxVideos = tyService.getBoxVideos(boxVideosDTO);
        return AjaxResult.success(boxVideos);
    }
 
    @ApiOperation("获取直播地址")
    @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);
    }
 
}