13693261870
8 天以前 b8d62de41ff7e1e0549061308aa11f68cf881ed9
se-system/src/main/java/com/terra/system/controller/sys/AuthController.java
@@ -8,12 +8,14 @@
import com.terra.system.service.all.PermsService;
import com.terra.system.service.sys.AuthService;
import com.terra.system.service.sys.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import javax.annotation.Resource;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@@ -23,7 +25,7 @@
 * @author SWS
 * @date 2022-09.28
 */
@Api(tags = "运维管理\\权限管理")
@Tag(name = "运维管理\\权限管理")
@RestController
@RequestMapping("/auth")
public class AuthController extends BaseController {
@@ -37,9 +39,9 @@
    PermsService permsService;
    @SysLog()
    @ApiOperation(value = "查询记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "sys_auth")
    @Operation(summary = "查询记录数")
    @Parameters({
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, required = false, example = "sys_auth")
    })
    @GetMapping({"/selectCount"})
    public ResponseMsg<Integer> selectCount(String name) {
@@ -53,11 +55,11 @@
    }
    @SysLog()
    @ApiOperation(value = "分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "sys_auth"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "分页查询")
    @Parameters({
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = "sys_auth"),
            @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"),
            @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectByPage")
    public ResponseMsg<List<AuthEntity>> selectByPage(String name, Integer pageSize, Integer pageIndex) {
@@ -73,11 +75,11 @@
    }
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "分页查询并返回记录数")
    @Parameters({
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = "1"),
            @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"),
            @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<List<AuthEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) {
@@ -100,11 +102,11 @@
    }
    @SysLog()
    @ApiOperation(value = "根据菜单分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "menuid", value = "菜单ID", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "根据菜单分页查询并返回记录数")
    @Parameters({
            @Parameter(name = "menuid", description = "菜单ID", in = ParameterIn.QUERY, example = "1"),
            @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"),
            @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectByPageForMenu")
    public ResponseMsg<List<AuthEntity>> selectByPageForMenu(Integer menuid, Integer pageSize, Integer pageIndex) {
@@ -127,9 +129,9 @@
    }
    @SysLog()
    @ApiOperation(value = "插入一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "AuthEntity", paramType = "body", example = "")
    @Operation(summary = "插入一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类", example = "")
    })
    @PostMapping(value = "/insertAuth", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertAuth(@RequestBody AuthEntity entity, HttpServletRequest req) {
@@ -151,9 +153,9 @@
    }
    @SysLog()
    @ApiOperation(value = "插入多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "List<AuthEntity>", paramType = "body", example = "")
    @Operation(summary = "插入多条")
    @Parameters({
            @Parameter(name = "list", description = "实体类集合", schema = @Schema(type = "array"), example = "")
    })
    @PostMapping(value = "/insertAuths", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertAuths(@RequestBody List<AuthEntity> list, HttpServletRequest req) {
@@ -177,9 +179,9 @@
    }
    @SysLog()
    @ApiOperation(value = "删除一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "删除一条")
    @Parameters({
            @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/deleteAuth")
    public ResponseMsg<Integer> deleteAuth(int id) {
@@ -196,9 +198,9 @@
    }
    @SysLog()
    @ApiOperation(value = "删除多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "List<Integer>", paramType = "query", example = "1,2")
    @Operation(summary = "删除多条")
    @Parameters({
            @Parameter(name = "ids", description = "ID数组", schema = @Schema(type = "array"), in = ParameterIn.QUERY, example = "1,2")
    })
    @GetMapping(value = "/deleteAuths")
    public ResponseMsg<Integer> deleteAuths(@RequestParam List<Integer> ids) {
@@ -219,9 +221,9 @@
    }
    @SysLog()
    @ApiOperation(value = "更新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "LoginEntity", paramType = "body", example = "")
    @Operation(summary = "更新一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类", schema = @Schema(type = "array"), example = "")
    })
    @ResponseBody
    @PostMapping(value = "/updateAuth", produces = "application/json; charset=UTF-8")
@@ -244,9 +246,9 @@
    }
    @SysLog()
    @ApiOperation(value = "根据ID查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "根据ID查询")
    @Parameters({
            @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping(value = "/selectAuth")
    public ResponseMsg<AuthEntity> selectAuth(int id) {
@@ -260,7 +262,7 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有")
    @Operation(summary = "查询所有")
    @GetMapping(value = "/selectAuthAll")
    public ResponseMsg<List<AuthEntity>> selectAuthAll() {
        try {