kongzy
2023-12-08 ca5445257b1fdeceddf3fcc2dea18c442023aeb7
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
package com.gkhy.assess.admin.controller.web.front;
 
import com.gkhy.assess.common.api.CommonResult;
import com.gkhy.assess.system.domain.SysLaw;
import com.gkhy.assess.system.service.SysLawService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
@Api(tags = "前台首页-法律法规前端控制器")
@RestController
@RequestMapping("/law")
public class LawController {
    @Autowired
    private SysLawService lawService;
 
    @ApiOperation(value = "法律法规列表(分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10")
    })
    @GetMapping("/lawList")
    public CommonResult lawList(SysLaw law){
        law.setStatus(0);
        return CommonResult.success(lawService.lawList(law));
    }
 
 
    @ApiOperation(value = "根据id获取法律法规详情")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "lawId", dataType = "int", required = true, value = "法律法规id")
    })
    @GetMapping("/getLawById")
    public CommonResult getLawById(@RequestParam(required = true)Long lawId){
        return CommonResult.success(lawService.getLawById(lawId));
    }
}