From a927f1a55fc96bbe3e2c63f3d5fd250fc4961055 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 28 六月 2022 14:35:47 +0800
Subject: [PATCH] 1. 添加pdf相关库
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt | 72 +++++++++++++++++++++++++----------
1 files changed, 51 insertions(+), 21 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
index 0fc9347..cb04c6e 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
@@ -4,6 +4,8 @@
import cn.flightfeather.supervision.lightshare.service.EvaluationService
import cn.flightfeather.supervision.lightshare.vo.AssessmentSearchCondition
import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import javax.servlet.http.HttpServletResponse
@@ -11,52 +13,63 @@
@RestController
@RequestMapping("/evaluation")
class EvaluationController(val evaluationService: EvaluationService) {
+ @ApiOperation(value = "鑾峰彇鎵�鏈夎瘎浼版�诲垎")
@GetMapping
fun getAll() = evaluationService.findAll()
+ @ApiOperation(value = "涓婁紶涓�鏉¤瘎浼版�诲垎璁板綍")
@PutMapping
- fun add(@RequestBody evaluation: Evaluation) = evaluationService.save(evaluation)
+ fun add(
+ @ApiParam(value = "璇勪及鏁版嵁") @RequestBody evaluation: Evaluation
+ ) = evaluationService.save(evaluation)
+ @ApiOperation(value = "鏇存柊涓�鏉¤瘎浼版�诲垎璁板綍")
@PostMapping
- fun update(@RequestBody evaluation: Evaluation) = evaluationService.update(evaluation)
+ fun update(@ApiParam(value = "璇勪及鏁版嵁") @RequestBody evaluation: Evaluation) = evaluationService.update(evaluation)
+ @ApiOperation(value = "鏌ユ壘涓�鏉¤瘎浼版�诲垎璁板綍")
@GetMapping("/{id}")
- fun getById(@PathVariable id: String) = evaluationService.findOne(id)
+ fun getById(@ApiParam(value = "璇勪及淇℃伅涓婚敭id") @PathVariable id: String) = evaluationService.findOne(id)
+ @ApiOperation(value = "鍒犻櫎涓�鏉¤瘎浼版�诲垎璁板綍")
@DeleteMapping("/{id}")
- fun delete(@PathVariable id: String) = evaluationService.delete(id)
+ fun delete(@ApiParam(value = "璇勪及淇℃伅涓婚敭id") @PathVariable id: String) = evaluationService.delete(id)
+ @ApiOperation(value = "鏍规嵁鏉′欢鏌ヨ璇勪及鎬诲垎")
@GetMapping("/totalPoint/{userId}")
fun getT(
- @PathVariable("userId") userId: String,
- @RequestParam("evaluatorType") evaluatorType: Int,
- @RequestParam("startTime") startTime: String,
- @RequestParam("endTime") endTime: String,
- @RequestParam("sceneTypeId", required = false) sceneTypeId: Int?,
- @RequestParam("erGuid", required = false) erGuid: String?,
- @RequestParam("eId", required = false) eId: String?
+ @ApiParam(value = "鐢ㄦ埛id") @PathVariable("userId") userId: String,
+ @ApiParam(value = "璇勪及绫诲瀷") @RequestParam("evaluatorType") evaluatorType: Int,
+ @ApiParam(value = "寮�濮嬫椂闂�") @RequestParam("startTime") startTime: String,
+ @ApiParam(value = "缁撴潫鏃堕棿") @RequestParam("endTime") endTime: String,
+ @ApiParam(value = "鍦烘櫙绫诲瀷id") @RequestParam("sceneTypeId", required = false) sceneTypeId: Int?,
+ @ApiParam(value = "瀛愪换鍔d") @RequestParam("erGuid", required = false) erGuid: String?,
+ @ApiParam(value = "璇勪及淇℃伅涓婚敭id") @RequestParam("eId", required = false) eId: String?
) = evaluationService.getTotalPoints(userId, evaluatorType, startTime, endTime, sceneTypeId, erGuid, eId)
+ @ApiOperation(value = "鑾峰彇鐢ㄦ埛璇勪及鎬诲垎")
@GetMapping("/historyPoint/{userId}")
fun getHistoryPoint(
- @PathVariable("userId") userId: String,
- @RequestParam(value = "page") page: Int,
- @RequestParam(value = "per_page") perPage: Int,
- response: HttpServletResponse
+ @ApiParam(value = "鐢ㄦ埛id") @PathVariable("userId") userId: String,
+ @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int,
+ @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int,
+ response: HttpServletResponse
) = evaluationService.getHistoryPoint(userId, page, perPage, response)
+ @ApiOperation(value = "鑾峰彇淇$敤璇勪及缁撴灉")
@GetMapping("/creditInfo")
fun getCreditInfo(
- @RequestParam("userId") userId: String
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String
) = evaluationService.getCreditInfo(userId)
+ @ApiOperation(value = "鑾峰彇鏌愪釜鐢ㄦ埛鐨勪俊鐢ㄨ瘎浼扮粨鏋�")
@PostMapping("/search/{userId}")
fun getAssessments(
- @PathVariable("userId") userId: String,
- @RequestBody condition: AssessmentSearchCondition,
- @RequestParam(value = "page") page: Int,
- @RequestParam(value = "per_page") perPage: Int,
- response: HttpServletResponse
+ @ApiParam(value = "鐢ㄦ埛id") @PathVariable("userId") userId: String,
+ @ApiParam(value = "鏌ヨ鏉′欢") @RequestBody condition: AssessmentSearchCondition,
+ @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int,
+ @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int,
+ response: HttpServletResponse
) = evaluationService.getAssessments(userId, condition, page, perPage, response)
fun autoScore(
@@ -65,4 +78,21 @@
@RequestParam("sceneType") sceneType: Int,
response: HttpServletResponse
) = evaluationService.autoScore(year, month, sceneType, response)
+
+
+ @ApiOperation(value = "涓婁紶鑷瘎寰楀垎")
+ @PostMapping("/upload")
+ fun uploadScore(
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period") period: String,
+ @ApiParam(value = "璇勫垎瑙勫垯id") @RequestParam(value = "ruleId", required = false) ruleId: String?,
+ @ApiParam(value = "鍏蜂綋鎵e垎鏉$洰") @RequestBody itemList: List<Pair<String, String>>,
+ ) = evaluationService.uploadScore(userId, period, ruleId, itemList)
+
+ @ApiOperation(value = "鑾峰彇娴嬭瘎璇︽儏")
+ @GetMapping("/detail")
+ fun getDetail(
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period") period: String,
+ ) = evaluationService.getDetail(userId, period)
}
\ No newline at end of file
--
Gitblit v1.9.3