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) }
|
}
|