From 23bd719cebe5feeff4e48fde925b0b39755eea93 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 15 十一月 2022 10:59:50 +0800 Subject: [PATCH] 2022.11.15 --- src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt | 37 +++++++++++++++++++++++++------------ 1 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt index 4968b37..eaf477a 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LawController.kt @@ -3,6 +3,8 @@ import cn.flightfeather.supervision.lightshare.service.LawService import cn.flightfeather.supervision.lightshare.vo.LawsRegulationsCondition 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,30 +13,41 @@ @RequestMapping("/laws") class LawController(val lawService: LawService) { + @ApiOperation(value = "鑾峰彇鎵�鏈夋硶寰嬫硶瑙�") @GetMapping fun getLaws( - @RequestParam(value = "page") page: Int, - @RequestParam(value = "per_page") perPage: Int, - response: HttpServletResponse + @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int, + @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int, + response: HttpServletResponse ) = lawService.getLaws(page, perPage, response) + @ApiOperation(value = "鏍规嵁id鏌ユ壘娉曞緥娉曡") @GetMapping("/text") fun getLawText( - @RequestParam(value = "id") lawId: String + @ApiParam(value = "娉曞緥娉曡璁板綍id") @RequestParam(value = "id") lawId: String ) = lawService.getLawText(lawId) + @ApiOperation(value = "鏌ユ壘娉曞緥娉曡") @PostMapping("/condition/{userId}") fun getLawsRegulations( - @PathVariable userId: String, - @RequestBody condition: LawsRegulationsCondition, - @RequestParam(value = "page") page: Int, - @RequestParam(value = "per_page") perPage: Int, - response: HttpServletResponse - ) = lawService.getLawsRegulations(condition, page, perPage, response) + @ApiParam(value = "鐢ㄦ埛鐨刬d") @PathVariable userId: String, + @ApiParam(value = "鏌ユ壘鏉′欢") @RequestBody condition: LawsRegulationsCondition, + @ApiParam(value = "椤电爜") @RequestParam(value = "page") page: Int, + @ApiParam(value = "鍗曢〉鏁版嵁閲�") @RequestParam(value = "per_page") perPage: Int, + response: HttpServletResponse + ) = lawService.getLawsRegulations(userId, condition, page, perPage, response) + @ApiOperation(value = "鏍规嵁琛屼笟绫诲瀷鏌ユ壘鐩稿叧娉曞緥娉曡") @PostMapping("/eachType/{userId}") fun getLawsRegulationsWithEachType( - @PathVariable userId: String, - @RequestBody condition: LawsRegulationsCondition + @ApiParam(value = "鐢ㄦ埛id") @PathVariable userId: String, + @ApiParam(value = "鏌ユ壘鏉′欢") @RequestBody condition: LawsRegulationsCondition ) = lawService.getLawsRegulationsWithEachType(condition) + + @ApiOperation(value = "鏌ヨ璧勬簮鎵�鍦ㄧ郴鍒�") + @PostMapping("/series") + fun getSeries( + @ApiParam(value = "鐢ㄦ埛id") @RequestParam userId: String, + @ApiParam(value = "鏌ユ壘鏉′欢") @RequestParam(value = "seriesId") seriesId: String, + ) = lawService.getSeries(userId, seriesId) } \ No newline at end of file -- Gitblit v1.9.3