feiyu02
2024-11-19 752e00503f672ddfe2066afb6c235721a3a912b5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package cn.flightfeather.supervision.lightshare.web
 
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
 
@Api(tags = ["法律法规API接口"])
@RestController
@RequestMapping("/laws")
class LawController(val lawService: LawService) {
 
    @ApiOperation(value = "获取所有法律法规")
    @GetMapping
    fun getLaws(
        @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(
        @ApiParam(value = "法律法规记录id") @RequestParam(value = "id") lawId: String
    ) = lawService.getLawText(lawId)
 
    @ApiOperation(value = "查找法律法规")
    @PostMapping("/condition/{userId}")
    fun getLawsRegulations(
        @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(userId, condition, page, perPage, response)
 
    @ApiOperation(value = "根据行业类型查找相关法律法规")
    @PostMapping("/eachType/{userId}")
    fun getLawsRegulationsWithEachType(
        @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)
}