feiyu02
2025-07-23 517296b16b1faf07bc389809387b1937f9415746
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
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.domain.ds1.entity.District
import cn.flightfeather.supervision.lightshare.service.DistrictService
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
 
@Api(tags = ["DistrictController"], description = "区县信息API接口")
@RestController
@RequestMapping("/district")
class DistrictController(val districtService: DistrictService){
    @GetMapping
    fun getAll() = districtService.findAll()
 
    @PutMapping
    fun add(@RequestBody district: District) = districtService.save(district)
 
    @PostMapping
    fun update(@RequestBody district: District) = districtService.update(district)
 
    @GetMapping("/{id}")
    fun getById(@PathVariable id:String) = districtService.findByID(id)
 
    @DeleteMapping("/{id}")
    fun delete (@PathVariable id: String) = districtService.delete(id)
}