feiyu02
2024-12-16 b3e273990fda27b68dfcf2c7f9d78311a5279885
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
package com.flightfeather.uav.lightshare.web
 
import com.fasterxml.jackson.annotation.JsonFormat
import com.flightfeather.uav.lightshare.bean.AreaVo
import com.flightfeather.uav.lightshare.service.SatelliteTelemetryService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import java.time.LocalDateTime
 
/**
 * 卫星遥测
 * @date 2024/12/5
 * @author feiyu02
 */
@Api(tags = ["卫星遥测API接口"])
@RestController
@RequestMapping("air/satellite")
class SatelliteTelemetryController(private val satelliteTelemetryService: SatelliteTelemetryService) {
 
    @ApiOperation(value = "获取网格组信息")
    @PostMapping("/grid/group")
    fun fetchGridGroup(
        @RequestBody areaVo: AreaVo,
        @RequestParam("page", required = false) page: Int?,
        @RequestParam("per_page", required = false) perPage: Int?
    ) = resPack { satelliteTelemetryService.fetchGridGroup(areaVo, page, perPage) }
 
    @ApiOperation(value = "获取网格组内具体网格信息")
    @GetMapping("/grid/cell")
    fun fetchGridCell(
        @ApiParam("网格组id") @RequestParam groupId: Int,
    ) = resPack { satelliteTelemetryService.fetchGridCell(groupId) }
 
    @ApiOperation(value = "获取网格组下的卫星遥测数据")
    @GetMapping("/grid/data")
    fun fetchGridData(
        @ApiParam("网格组id") @RequestParam groupId: Int,
        @ApiParam("遥测数据时间")
        @RequestParam(required = false) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") dataTime: LocalDateTime?,
        @ApiParam("遥测数据类型", allowableValues = "0:原始卫星遥测数据;1:融合数据") @RequestParam(required = false) type: Int?,
    ) = resPack { satelliteTelemetryService.fetchGridData(groupId, dataTime, type) }
 
    @ApiOperation(value = "获取网格组下的卫星遥测具体数据")
    @GetMapping("/grid/data/detail")
    fun fetchGridDataDetail(
        @ApiParam("遥测数据id") @RequestParam dataId: Int,
        @ApiParam("网格组id") @RequestParam(required = false) groupId: Int?,
        @ApiParam("网格单元格id") @RequestParam(required = false) cellId: Int?,
    ) = resPack { satelliteTelemetryService.fetchGridDataDetail(dataId, groupId, cellId) }
}