feiyu02
2022-07-04 c93ad66797e4830ccf4de81c1e8787ab90b22791
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,34 @@
@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
        @ApiParam(value = "用户的id") @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(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)
}