package cn.flightfeather.supervision.lightshare.web
|
|
import cn.flightfeather.supervision.domain.entity.Evaluationrule
|
import cn.flightfeather.supervision.lightshare.service.EvaluationruleService
|
import io.swagger.annotations.Api
|
import io.swagger.annotations.ApiParam
|
import org.springframework.web.bind.annotation.*
|
|
@Api(tags = ["评分总规则API接口"])
|
@RestController
|
@RequestMapping("/evaluationrule")
|
class EvaluationruleController (val evaluationruleService: EvaluationruleService){
|
|
@GetMapping("/rule")
|
fun getRules(
|
@RequestParam(value = "erGuid", required = false) erGuid: String?,
|
@RequestParam(value = "sceneTypeId", required = true) sceneTypeId: Int,
|
@ApiParam(value = "评分表类型", allowableValues = "null/0: 手动评分;1:自动评分") @RequestParam(value = "erType", required = false) erType: Int?)
|
= evaluationruleService.getRule(erGuid, sceneTypeId, erType)
|
|
@GetMapping
|
fun getAll() = evaluationruleService.findAll()
|
|
@PutMapping
|
fun add(@RequestBody evaluationrule: Evaluationrule) = evaluationruleService.save(evaluationrule)
|
|
@PostMapping
|
fun update(@RequestBody evaluationrule: Evaluationrule) = evaluationruleService.update(evaluationrule)
|
|
@GetMapping("/{id}")
|
fun getById(@PathVariable id:String) = evaluationruleService.findOne(id)
|
|
@DeleteMapping("/{id}")
|
fun delete (@PathVariable id: String) = evaluationruleService.delete(id)
|
}
|