feiyu02
2025-07-31 6688232eaa889eeb6c58d0d804b587699db55ec2
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
35
36
37
38
39
40
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.domain.ds1.entity.Problemtype
import cn.flightfeather.supervision.lightshare.service.ProblemtypeService
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
 
@Api(tags = ["ProblemtypeController"], description = "监管问题类别API接口")
@RestController
@RequestMapping("/problemtype")
class ProblemtypeController (val problemtypeService: ProblemtypeService) {
    @GetMapping
    fun getAll() = problemtypeService.findAll()
 
    @PutMapping
    fun add(@RequestBody problemtype:Problemtype) = problemtypeService.save(problemtype)
 
    @PostMapping
    fun update(@RequestBody problemtype:Problemtype) = problemtypeService.update(problemtype)
 
    @GetMapping("/{id}")
    fun getById(@PathVariable id:String) = problemtypeService.findOne(id)
 
    @DeleteMapping("/{id}")
    fun delete (@PathVariable id: String) = problemtypeService.delete(id)
 
    @GetMapping("/byScene")
    fun getBySceneType(
            @RequestParam("sceneTypeId") sceneTypeId: Int,
            @RequestParam("districtCode") districtCode: String
    ) = problemtypeService.getBySceneType(sceneTypeId, districtCode)
 
    @GetMapping("/search")
    fun search(
        @RequestParam("taskTypeId") taskTypeId: Byte,
        @RequestParam("cityCode") cityCode: String,
        @RequestParam("districtCode") districtCode: String,
        @RequestParam("sceneTypeId") sceneTypeId: Byte
    ) = problemtypeService.search(taskTypeId, cityCode, districtCode, sceneTypeId)
}