feiyu02
2022-07-04 c93ad66797e4830ccf4de81c1e8787ab90b22791
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
33
34
35
36
37
38
39
40
41
42
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.domain.entity.Evaluationsubrule
import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import springfox.documentation.annotations.ApiIgnore
 
@Api(tags = ["评分子规则API接口"])
@RestController
@RequestMapping("/evaluationsubrule")
class EvaluationsubruleController (val evaluationsubruleService: EvaluationsubruleService) {
    @ApiOperation(value = "获取所有评分规则子项表")
    @GetMapping
    fun getAll() = evaluationsubruleService.findAll()
 
    @ApiOperation(value = "上传评分规则子项表")
    @PutMapping
    fun add(@ApiParam(value = "评分规则子项表") @RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.save(evaluationsubrule)
 
    @ApiOperation(value = "更新评分规则子项表")
    @PostMapping
    fun update(@ApiParam(value = "评分规则子项表") @RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.update(evaluationsubrule)
 
    @ApiOperation(value = "查找评分规则子项表")
    @GetMapping("/{ruleId}")
    fun getById(@ApiParam(value = "评分规则子项表id") @PathVariable ruleId:String) = evaluationsubruleService.findByRuleId(ruleId)
 
    @ApiIgnore
    @ApiOperation(value = "删除评分规则子项表")
    @DeleteMapping("/{id}")
    fun delete (@PathVariable id: String) = evaluationsubruleService.delete(id)
 
    @ApiOperation(value = "查找评分规则子项表以及对应的具体得分")
    @GetMapping("/score")
    fun getScore(
        @ApiParam(value = "用户id") @RequestParam("userId") userId:String,
        @ApiParam(value = "评估周期", example = "yyyy/M-M") @RequestParam("time") time:String,
    ) = evaluationsubruleService.getScore(userId, time)
}