| | |
| | | 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(@RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.save(evaluationsubrule) |
| | | fun add(@ApiParam(value = "评分规则子项表") @RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.save(evaluationsubrule) |
| | | |
| | | @ApiOperation(value = "更新评分规则子项表") |
| | | @PostMapping |
| | | fun update(@RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.update(evaluationsubrule) |
| | | fun update(@ApiParam(value = "评分规则子项表") @RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.update(evaluationsubrule) |
| | | |
| | | @ApiOperation(value = "查找评分规则子项表") |
| | | @GetMapping("/{ruleId}") |
| | | fun getById(@PathVariable ruleId:String) = evaluationsubruleService.findByRuleId(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, |
| | | @ApiParam(value = "前端平台") @RequestParam("platform", required = false) platform:String?, |
| | | ) = evaluationsubruleService.getScore(userId, time, platform) |
| | | } |