From 3e2159e45e12b2b8af058b68eafeaf082cf3fe85 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 15 九月 2022 09:30:31 +0800
Subject: [PATCH] 2022.9.15 1. 根据微信小程序前端需求,添加各对应后台逻辑

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConsultationController.kt |   98 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConsultationController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConsultationController.kt
index d38442d..70e309e 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConsultationController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ConsultationController.kt
@@ -3,6 +3,8 @@
 import cn.flightfeather.supervision.domain.entity.OnLineQuestion
 import cn.flightfeather.supervision.lightshare.service.OnLineQuestionService
 import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import io.swagger.annotations.ApiParam
 import org.springframework.web.bind.annotation.*
 
 @Api(tags = ["鍦ㄧ嚎鍜ㄨAPI鎺ュ彛"])
@@ -10,9 +12,101 @@
 @RequestMapping("/consultation")
 class ConsultationController(val onLineQuestionService: OnLineQuestionService) {
 
+    @ApiOperation(value = "鎻愬嚭鍜ㄨ闂")
     @PostMapping("/add/{userId}")
     fun add(
-            @PathVariable userId: String,
-            @RequestBody questions: List<OnLineQuestion>
+        @ApiParam(value = "鐢ㄦ埛id") @PathVariable userId: String,
+        @ApiParam(value = "鍜ㄨ闂") @RequestBody questions: List<OnLineQuestion>
     ) = onLineQuestionService.addQuestions(userId, questions)
+
+    @ApiOperation(value = "鏍规嵁鍏抽敭瀛楁悳绱㈡硶寰嬫硶瑙�")
+    @GetMapping("/search/law")
+    fun searchLaw(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+        @ApiParam(value = "鍏抽敭瀛�") @RequestParam keyword: String,
+        @ApiParam(value = "鎼滅储缁撴灉鐨勭被鍨�", required = false) @RequestParam type: Byte?,
+        @ApiParam(value = "椤电爜") @RequestParam page: Int,
+        @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam perPage: Int,
+    ) = onLineQuestionService.searchLaw(userId, keyword, type, page, perPage)
+
+    @ApiOperation(value = "鑾峰彇鐑棬娉曞緥娉曡")
+    @GetMapping("/topic/law")
+    fun getTopicLaw(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+    ) = onLineQuestionService.getTopicLaw(userId)
+
+    @ApiOperation(value = "鑾峰彇鐑棬娉曞緥娉曡鏉$洰")
+    @GetMapping("/topic/item")
+    fun getTopicMgtItems(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+    ) = onLineQuestionService.getTopicMgtItems(userId)
+
+    @ApiOperation(value = "鑾峰彇鐑棬闂瓟")
+    @GetMapping("/topic/qa")
+    fun getTopicQA(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+    ) = onLineQuestionService.getTopicQA(userId)
+
+    @ApiOperation(value = "鑾峰彇鐑棬妗堜緥")
+    @GetMapping("/topic/case")
+    fun getTopicCase(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+    ) = onLineQuestionService.getTopicCase(userId)
+
+    @ApiOperation(value = "鑾峰彇娉曞緥娉曡鏂囦欢")
+    @GetMapping("/law/file")
+    fun getMgtFile(
+            @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+            @ApiParam(value = "鏂囦欢id") @RequestParam fileId: String,
+    ) = onLineQuestionService.getMgtFile(userId, fileId)
+
+    @ApiOperation(value = "鑾峰彇娉曞緥娉曡鏉$洰")
+    @GetMapping("/law/item")
+    fun getMgtItem(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+        @ApiParam(value = "鏉$洰id") @RequestParam itemId: String,
+    ) = onLineQuestionService.getMgtItem(userId, itemId)
+
+    @ApiOperation(value = "鑾峰彇闂")
+    @GetMapping("/law/question")
+    fun getQuestion(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+        @ApiParam(value = "闂id") @RequestParam qId: String,
+    ) = onLineQuestionService.getQuestion(userId, qId)
+
+    @ApiOperation(value = "鑾峰彇绛旀")
+    @GetMapping("/law/answer")
+    fun getAnswers(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+        @ApiParam(value = "闂id") @RequestParam qId: String,
+    ) = onLineQuestionService.getAnswers(userId, qId)
+
+    @ApiOperation(value = "鑾峰彇妗堜緥")
+    @GetMapping("/law/case")
+    fun getCase(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+        @ApiParam(value = "妗堜緥id") @RequestParam caseId: String,
+    ) = onLineQuestionService.getCase(userId, caseId)
+
+    @ApiOperation(value = "鑾峰彇闂")
+    @GetMapping("/question/type")
+    fun getQuestionsByType(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+        @ApiParam(value = "瑕佺礌澶х被", required = false) @RequestParam kind: Byte?,
+        @ApiParam(value = "瑕佺礌灏忕被", required = false) @RequestParam subKind: Byte?,
+        @ApiParam(value = "椤电爜") @RequestParam page: Int,
+        @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam perPage: Int,
+    ) = onLineQuestionService.getQuestionsByType(userId, kind, subKind, page, perPage)
+
+    @ApiOperation(value = "鑾峰彇鐜繚瑕佺礌澶х被")
+    @GetMapping("/elementtype")
+    fun getEnElementTypes(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+    ) = onLineQuestionService.getEnElementTypes(userId)
+
+    @ApiOperation(value = "鑾峰彇鐜繚瑕佺礌灏忕被")
+    @GetMapping("/elementsubtype")
+    fun getEnElementSubTypes(
+        @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String,
+    ) = onLineQuestionService.getEnElementSubTypes(userId)
 }
\ No newline at end of file

--
Gitblit v1.9.3