feiyu02
2022-11-15 909fd8929d7906f1dca68acc05e36e29b0b9192c
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
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.domain.ds1.entity.Domainitem
import cn.flightfeather.supervision.lightshare.service.DomainitemService
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
 
@Api(tags = ["DomainitemController"], description = "值域信息API接口")
@RestController
@RequestMapping("/domainitem")
class DomainitemController (val domainitemService: DomainitemService) {
 
    @GetMapping
    fun getAll() = domainitemService.findAll()
 
    @PutMapping
    fun add(@RequestBody domainitem: Domainitem) = domainitemService.save(domainitem)
 
    @PostMapping
    fun update(@RequestBody domainitem: Domainitem) = domainitemService.update(domainitem)
 
    @GetMapping("/{id}")
    fun getById(@PathVariable id:String) = domainitemService.findOne(id)
 
    @DeleteMapping("/{id}")
    fun delete (@PathVariable id: String) = domainitemService.delete(id)
 
    @GetMapping("/location")
    fun getLocation(
        @RequestParam("sceneType") sceneType:Int
    ) = domainitemService.getLocation(sceneType)
}