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