package cn.flightfeather.supervision.lightshare.web
|
|
import cn.flightfeather.supervision.domain.ds1.entity.City
|
import cn.flightfeather.supervision.lightshare.service.CityService
|
import io.swagger.annotations.Api
|
import org.springframework.web.bind.annotation.*
|
|
@Api(tags = ["CityController"], description = "城市信息API接口")
|
@RestController
|
@RequestMapping("/city")
|
class CityController(val cityService: CityService){
|
@GetMapping
|
fun getAll() = cityService.findAll()
|
|
@PutMapping
|
fun add(@RequestBody city: City) = cityService.save(city)
|
|
@PostMapping
|
fun update(@RequestBody city: City) = cityService.update(city)
|
|
@GetMapping("/{id}")
|
fun getById(@PathVariable id:String) = cityService.findByID(id)
|
|
@DeleteMapping("/{id}")
|
fun delete (@PathVariable id: String) = cityService.delete(id)
|
|
}
|