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.SysAgency;
import com.gkhy.assess.system.service.SysAgencyService;
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.web.bind.annotation.*;
 
@Api(tags = "前台首页-机构前端控制器")
@RestController
@RequestMapping("/agency")
public class AgencyController {
    @Autowired
    private SysAgencyService agencyService;
 
    @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("/agencyList")
    public CommonResult agencyList(SysAgency agency){
        agency.setPublication(0);
        agency.setDelFlag(0);
        return CommonResult.success(agencyService.agencyList(agency));
    }
 
 
    @ApiOperation(value = "根据id获取机构详情")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "agencyId", dataType = "int", required = true, value = "机构id")
    })
    @GetMapping("/getAgencyById")
    public CommonResult getAgencyById(@RequestParam(required = true) Long agencyId){
        return CommonResult.success(agencyService.getAgencyById(agencyId));
    }
}