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
package com.flightfeather.uav.lightshare.web
 
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) }
}