From 9867f6d5c5bccfe52b878c344c536905dd6b309e Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 09 六月 2022 08:48:06 +0800
Subject: [PATCH] 1. 接口文档自动输出

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationruleController.kt |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationruleController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationruleController.kt
index 65d5dbf..9cbde86 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationruleController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationruleController.kt
@@ -3,33 +3,42 @@
 import cn.flightfeather.supervision.domain.entity.Evaluationrule
 import cn.flightfeather.supervision.lightshare.service.EvaluationruleService
 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 = ["璇勫垎鎬昏鍒橝PI鎺ュ彛"])
 @RestController
 @RequestMapping("/evaluationrule")
 class EvaluationruleController (val evaluationruleService: EvaluationruleService){
 
+    @ApiOperation(value = "鑾峰彇璇勫垎瑙勫垯琛�")
     @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)
+        @ApiParam(value = "瑙勫垯涓婚敭id") @RequestParam(value = "erGuid", required = false) erGuid: String?,
+        @ApiParam(value = "鍦烘櫙绫诲瀷id") @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)
 
+    @ApiOperation(value = "鑾峰彇鎵�鏈夎瘎鍒嗚鍒欒〃")
     @GetMapping
     fun getAll() = evaluationruleService.findAll()
 
+    @ApiOperation(value = "涓婁紶璇勫垎瑙勫垯琛�")
     @PutMapping
-    fun add(@RequestBody evaluationrule: Evaluationrule) = evaluationruleService.save(evaluationrule)
+    fun add(@ApiParam(value = "璇勫垎瑙勫垯") @RequestBody evaluationrule: Evaluationrule) = evaluationruleService.save(evaluationrule)
 
+    @ApiOperation(value = "鏇存柊璇勫垎瑙勫垯琛�")
     @PostMapping
-    fun update(@RequestBody evaluationrule: Evaluationrule) = evaluationruleService.update(evaluationrule)
+    fun update(@ApiParam(value = "璇勫垎瑙勫垯") @RequestBody evaluationrule: Evaluationrule) = evaluationruleService.update(evaluationrule)
 
+    @ApiOperation(value = "鏌ユ壘璇勫垎瑙勫垯琛�")
     @GetMapping("/{id}")
-    fun getById(@PathVariable id:String) = evaluationruleService.findOne(id)
+    fun getById(@ApiParam(value = "璇勫垎瑙勫垯琛╥d") @PathVariable id:String) = evaluationruleService.findOne(id)
 
+    @ApiIgnore
+    @ApiOperation(value = "鍒犻櫎璇勫垎瑙勫垯琛�")
     @DeleteMapping("/{id}")
     fun delete (@PathVariable id: String) = evaluationruleService.delete(id)
 }
\ No newline at end of file

--
Gitblit v1.9.3