feiyu02
2025-05-08 9a9a27f185bc0cf9dc0001cfc6839e6d13dbccd9
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
package com.flightfeather.uav.lightshare.web
 
import com.flightfeather.uav.domain.entity.GridCell
import com.flightfeather.uav.lightshare.bean.AreaVo
import com.flightfeather.uav.lightshare.service.SceneService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.*
 
@Api(tags = ["SceneController"], description = "场景API接口")
@RestController
@RequestMapping("/scene")
class SceneController(val sceneService: SceneService) {
    @PostMapping("/find")
    fun searchScene(
        @RequestBody areaVo: AreaVo,
        @RequestParam("page", required = false) page: Int?,
        @RequestParam("per_page", required = false) perPage: Int?
    ) = resPack { sceneService.searchScene(areaVo, page, perPage) }
 
    @ApiOperation(value = "根据圆心和半径找到范围内的场景")
    @PostMapping("/find/radius")
    fun searchByCoordinate(
        @RequestParam("lng") lng: Double,
        @RequestParam("lat") lat: Double,
        @RequestParam("radius") radius: Double,
    ) = resPack { sceneService.searchByCoordinate(lng, lat, radius) }
 
    @ApiOperation(value = "根据卫星网格找到范围内的场景")
    @PostMapping("/find/grid")
    fun searchByGrid(
        @RequestBody gridCell: GridCell,
    ) = resPack { sceneService.searchByGrid(gridCell) }
}