feiyu02
2025-09-19 7cbe1610b87da19ed8a146a09b1117f92d9d3d98
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.Province
import cn.flightfeather.supervision.lightshare.service.ProvinceService
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
 
@Api(tags = ["ProvinceController"], description = "省份API接口")
@RestController
@RequestMapping("/province")
class ProvinceController(val provinceService: ProvinceService){
    @GetMapping
    fun getAll() = provinceService.findAll()
 
    @PutMapping
    fun add(@RequestBody province: Province) = provinceService.save(province)
 
    @PostMapping
    fun update(@RequestBody province: Province) = provinceService.update(province)
 
    @GetMapping("/{id}")
    fun getById(@PathVariable id:String) = provinceService.findOne(id)
 
    @DeleteMapping("/{id}")
    fun delete (@PathVariable id: String) = provinceService.delete(id)
}