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(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)
|
}
|