riku
2021-09-24 4f1b7973c53b45f57e451191bfd5a3d2136a004c
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
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 org.springframework.web.bind.annotation.*
import javax.servlet.http.HttpServletResponse
 
@Api(tags = ["法律法规API接口"])
@RestController
@RequestMapping("/laws")
class LawController(val lawService: LawService) {
 
    @GetMapping
    fun getLaws(
            @RequestParam(value = "page") page: Int,
            @RequestParam(value = "per_page") perPage: Int,
            response: HttpServletResponse
    ) = lawService.getLaws(page, perPage, response)
 
    @GetMapping("/text")
    fun getLawText(
            @RequestParam(value = "id") lawId: String
    ) = lawService.getLawText(lawId)
 
    @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)
 
    @PostMapping("/eachType/{userId}")
    fun getLawsRegulationsWithEachType(
            @PathVariable userId: String,
            @RequestBody condition: LawsRegulationsCondition
    ) = lawService.getLawsRegulationsWithEachType(condition)
}