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