| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.config.IgnoreResponseAdvice |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Scense |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Task |
| | | import cn.flightfeather.supervision.lightshare.service.ScenseService |
| | |
| | | import io.swagger.annotations.ApiImplicitParam |
| | | import io.swagger.annotations.ApiOperation |
| | | import org.springframework.web.bind.annotation.* |
| | | import org.springframework.web.multipart.MultipartFile |
| | | |
| | | @Api(tags = ["ScenseController"], description = "监管场景API接口") |
| | | @RestController |
| | | @RequestMapping("/scense") |
| | | class ScenseController(val scenseService: ScenseService) { |
| | | @IgnoreResponseAdvice |
| | | @GetMapping |
| | | fun getAll() = scenseService.findAll() |
| | | |
| | | @IgnoreResponseAdvice |
| | | @PutMapping |
| | | fun add(@RequestBody scense: Scense) = scenseService.save(scense) |
| | | |
| | | @IgnoreResponseAdvice |
| | | @PostMapping |
| | | fun update(@RequestBody scense: Scense) = scenseService.update(scense) |
| | | |
| | | @IgnoreResponseAdvice |
| | | @PostMapping("/update/list") |
| | | fun updateList(@RequestBody sceneList: MutableList<Scense>) = scenseService.updateList(sceneList) |
| | | |
| | | @IgnoreResponseAdvice |
| | | @PostMapping("/search") |
| | | fun find(@RequestBody scense: Scense) = scenseService.search(scense) |
| | | |
| | | @IgnoreResponseAdvice |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id: String) = scenseService.findOne(id) |
| | | |
| | | @IgnoreResponseAdvice |
| | | @DeleteMapping("/{id}") |
| | | fun delete(@PathVariable id: String) = scenseService.delete(id) |
| | | |
| | | @IgnoreResponseAdvice |
| | | @GetMapping("/alltype") |
| | | fun getSceneType() = scenseService.getSceneType() |
| | | |
| | |
| | | * @param mode 0:只会获取总任务对应的监管版本中存在的场景;1:除了监管版本中存在的场景,还会获取剩余的可用场景 |
| | | * @return 场景列表 |
| | | */ |
| | | @IgnoreResponseAdvice |
| | | @PostMapping("/getByTask") |
| | | fun getByTaskId(@RequestBody task: Task, @RequestParam(value = "mode") mode: Int) = scenseService.getByTaskId(task, mode) |
| | | |
| | |
| | | @RequestParam("lat") lat: Double, |
| | | @RequestParam("radius") radius: Double, |
| | | ) = resPack { scenseService.searchByCoordinate(lng, lat, radius) } |
| | | |
| | | @ApiOperation(value = "通过文件导入场景信息") |
| | | @PostMapping("/import") |
| | | fun importSceneInfo( |
| | | @RequestPart("file") files: Array<MultipartFile>, |
| | | ) = resPack { scenseService.importSceneInfo(files) } |
| | | |
| | | @ApiOperation(value = "创建场景信息") |
| | | @PutMapping("/create") |
| | | fun createScene( |
| | | @RequestBody scense: Scense |
| | | ) = resPack { scenseService.createScene(scense) } |
| | | } |