13693261870
昨天 32eb942e25aa366563b7f40b05a382c0c462213c
se-system/src/main/java/com/terra/system/controller/sys/RoleController.java
@@ -1,19 +1,21 @@
package com.terra.system.controller.sys;
import com.terra.system.annotation.SysLog;
import com.terra.system.controller.all.BaseController;
import com.terra.system.entity.all.ResponseMsg;
import com.terra.common.annotation.SysLog;
import com.terra.common.controller.all.BaseController;
import com.terra.common.entity.all.ResponseMsg;
import com.terra.system.entity.sys.RoleEntity;
import com.terra.system.entity.sys.UserEntity;
import com.terra.system.service.all.PermsService;
import com.terra.system.service.sys.RoleService;
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("/role")
public class RoleController extends BaseController {
@@ -37,10 +39,10 @@
    PermsService permsService;
    @SysLog()
    @ApiOperation(value = "查询记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "Admin"),
            @ApiImplicitParam(name = "depid", value = "单位ID", dataType = "Integer", paramType = "query", example = "1")
    @Operation(summary = "查询记录数")
    @Parameters({
            @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = "Admin"),
            @Parameter(name = "depid", description = "单位ID", in = ParameterIn.QUERY, example = "1")
    })
    @GetMapping({"/selectCount"})
    public ResponseMsg<Integer> selectCount(String name, Integer depid) {
@@ -54,12 +56,12 @@
    }
    @SysLog()
    @ApiOperation(value = "分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "Admin"),
            @ApiImplicitParam(name = "depid", 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 = "name", description = "名称", in = ParameterIn.QUERY, example = "Admin"),
            @Parameter(name = "depid", 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 = "/selectByPage")
    public ResponseMsg<List<RoleEntity>> selectByPage(String name, Integer depid, Integer pageSize, Integer pageIndex) {
@@ -77,12 +79,12 @@
    }
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "Admin"),
            @ApiImplicitParam(name = "depid", 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 = "name", description = "名称", in = ParameterIn.QUERY, example = "Admin"),
            @Parameter(name = "depid", 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 = "/selectByPageAndCount")
    public ResponseMsg<List<RoleEntity>> selectByPageAndCount(String name, Integer depid, Integer pageSize, Integer pageIndex) {
@@ -105,9 +107,9 @@
    }
    @SysLog()
    @ApiOperation(value = "插入一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "RoleEntity", paramType = "body", example = "")
    @Operation(summary = "插入一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类", example = "")
    })
    @PostMapping(value = "/insertRole", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertRole(@RequestBody RoleEntity entity, HttpServletRequest req) {
@@ -127,9 +129,9 @@
    }
    @SysLog()
    @ApiOperation(value = "插入多条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "List<RoleEntity>", paramType = "body", example = "")
    @Operation(summary = "插入多条")
    @Parameters({
            @Parameter(name = "list", description = "实体类集合", schema = @Schema(type = "array"), example = "")
    })
    @PostMapping(value = "/insertRoles", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> insertRoles(@RequestBody List<RoleEntity> list, HttpServletRequest req) {
@@ -151,9 +153,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 = "/deleteRole")
    public ResponseMsg<Integer> deleteRole(int id) {
@@ -168,9 +170,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> deleteRoles(@RequestParam List<Integer> ids) {
@@ -189,9 +191,9 @@
    }
    @SysLog()
    @ApiOperation(value = "更新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "RoleEntity", paramType = "body", example = "")
    @Operation(summary = "更新一条")
    @Parameters({
            @Parameter(name = "entity", description = "实体类", example = "")
    })
    @ResponseBody
    @PostMapping(value = "/updateRole", produces = "application/json; charset=UTF-8")
@@ -212,9 +214,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 = "/selectRole")
    public ResponseMsg<RoleEntity> selectRole(int id) {
@@ -228,7 +230,7 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有")
    @Operation(summary = "查询所有")
    @GetMapping(value = "/selectRoleAll")
    public ResponseMsg<List<RoleEntity>> selectRoleAll() {
        try {