parent
3e5bd01962
commit
4c3e2bd815
@ -1,182 +0,0 @@
|
|||||||
package com.ruoyi.web.controller.system;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.annotation.Log;
|
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
||||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
|
||||||
import com.ruoyi.framework.web.service.TokenService;
|
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/system/role")
|
|
||||||
public class SysRoleController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private ISysRoleService roleService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenService tokenService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPermissionService permissionService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(SysRole role)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:export')")
|
|
||||||
@GetMapping("/export")
|
|
||||||
public AjaxResult export(SysRole role)
|
|
||||||
{
|
|
||||||
List<SysRole> list = roleService.selectRoleList(role);
|
|
||||||
ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
|
||||||
return util.exportExcel(list, "角色数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据角色编号获取详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
|
||||||
@GetMapping(value = "/{roleId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable Long roleId)
|
|
||||||
{
|
|
||||||
return AjaxResult.success(roleService.selectRoleById(roleId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:add')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@Validated @RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
|
||||||
}
|
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
|
||||||
}
|
|
||||||
role.setCreateBy(SecurityUtils.getUsername());
|
|
||||||
return toAjax(roleService.insertRole(role));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@Validated @RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
|
||||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
|
||||||
}
|
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
|
||||||
{
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
|
||||||
}
|
|
||||||
role.setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
|
|
||||||
if (roleService.updateRole(role) > 0)
|
|
||||||
{
|
|
||||||
// 更新缓存用户权限
|
|
||||||
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
||||||
if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
|
||||||
{
|
|
||||||
loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
|
||||||
loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
|
||||||
tokenService.setLoginUser(loginUser);
|
|
||||||
}
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改保存数据权限
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/dataScope")
|
|
||||||
public AjaxResult dataScope(@RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
|
||||||
return toAjax(roleService.authDataScope(role));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态修改
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:edit')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping("/changeStatus")
|
|
||||||
public AjaxResult changeStatus(@RequestBody SysRole role)
|
|
||||||
{
|
|
||||||
roleService.checkRoleAllowed(role);
|
|
||||||
role.setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
return toAjax(roleService.updateRoleStatus(role));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除角色
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:remove')")
|
|
||||||
@Log(title = "角色管理", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{roleIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] roleIds)
|
|
||||||
{
|
|
||||||
return toAjax(roleService.deleteRoleByIds(roleIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取角色选择框列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:role:query')")
|
|
||||||
@GetMapping("/optionselect")
|
|
||||||
public AjaxResult optionselect()
|
|
||||||
{
|
|
||||||
return AjaxResult.success(roleService.selectRoleAll());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package com.ruoyi.common.core.page;
|
|
||||||
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页数据
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class PageDomain
|
|
||||||
{
|
|
||||||
/** 当前记录起始索引 */
|
|
||||||
private Integer pageNum;
|
|
||||||
|
|
||||||
/** 每页显示记录数 */
|
|
||||||
private Integer pageSize;
|
|
||||||
|
|
||||||
/** 排序列 */
|
|
||||||
private String orderByColumn;
|
|
||||||
|
|
||||||
/** 排序的方向desc或者asc */
|
|
||||||
private String isAsc = "asc";
|
|
||||||
|
|
||||||
public String getOrderBy()
|
|
||||||
{
|
|
||||||
if (StringUtils.isEmpty(orderByColumn))
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.ruoyi.common.core.page;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表格分页数据对象
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class TableDataInfo implements Serializable
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 总记录数 */
|
|
||||||
private long total;
|
|
||||||
|
|
||||||
/** 列表数据 */
|
|
||||||
private List<?> rows;
|
|
||||||
|
|
||||||
/** 消息状态码 */
|
|
||||||
private int code;
|
|
||||||
|
|
||||||
/** 消息内容 */
|
|
||||||
private String msg;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package com.ruoyi.common.core.page;
|
|
||||||
|
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表格数据处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class TableSupport
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 当前记录起始索引
|
|
||||||
*/
|
|
||||||
public static final String PAGE_NUM = "pageNum";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 每页显示记录数
|
|
||||||
*/
|
|
||||||
public static final String PAGE_SIZE = "pageSize";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序列
|
|
||||||
*/
|
|
||||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序的方向 "desc" 或者 "asc".
|
|
||||||
*/
|
|
||||||
public static final String IS_ASC = "isAsc";
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.dashboard.framework.security.core.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据范围枚举类
|
||||||
|
*
|
||||||
|
* 用于实现数据级别的权限
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum DataScopeEnum {
|
||||||
|
|
||||||
|
ALL(1), // 全部数据权限
|
||||||
|
CUSTOM(2), // 自定数据权限
|
||||||
|
DEPT(3), // 部门数据权限
|
||||||
|
DEPT_AND_CHILD(4), // 部门及以下数据权限
|
||||||
|
SELF(5); // 仅本人数据权限
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 范围
|
||||||
|
*/
|
||||||
|
private final Integer score;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,142 @@
|
|||||||
|
package cn.iocoder.dashboard.modules.system.controller.permission;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "角色 API")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/role")
|
||||||
|
public class SysRoleController {
|
||||||
|
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:list')")
|
||||||
|
// @GetMapping("/list")
|
||||||
|
// public TableDataInfo list(SysRole role)
|
||||||
|
// {
|
||||||
|
// startPage();
|
||||||
|
// List<SysRole> list = roleService.selectRoleList(role);
|
||||||
|
// return getDataTable(list);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Log(title = "角色管理", businessType = BusinessType.EXPORT)
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:export')")
|
||||||
|
// @GetMapping("/export")
|
||||||
|
// public AjaxResult export(SysRole role)
|
||||||
|
// {
|
||||||
|
// List<SysRole> list = roleService.selectRoleList(role);
|
||||||
|
// ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
|
||||||
|
// return util.exportExcel(list, "角色数据");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 根据角色编号获取详细信息
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
|
// @GetMapping(value = "/{roleId}")
|
||||||
|
// public AjaxResult getInfo(@PathVariable Long roleId)
|
||||||
|
// {
|
||||||
|
// return AjaxResult.success(roleService.selectRoleById(roleId));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 新增角色
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:add')")
|
||||||
|
// @Log(title = "角色管理", businessType = BusinessType.INSERT)
|
||||||
|
// @PostMapping
|
||||||
|
// public AjaxResult add(@Validated @RequestBody SysRole role)
|
||||||
|
// {
|
||||||
|
// if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||||
|
// {
|
||||||
|
// return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
|
// }
|
||||||
|
// else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||||
|
// {
|
||||||
|
// return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
|
// }
|
||||||
|
// role.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
// return toAjax(roleService.insertRole(role));
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 修改保存角色
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
// @Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
|
// @PutMapping
|
||||||
|
// public AjaxResult edit(@Validated @RequestBody SysRole role)
|
||||||
|
// {
|
||||||
|
// roleService.checkRoleAllowed(role);
|
||||||
|
// if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
|
||||||
|
// {
|
||||||
|
// return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
|
// }
|
||||||
|
// else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
|
||||||
|
// {
|
||||||
|
// return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
|
// }
|
||||||
|
// role.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
//
|
||||||
|
// if (roleService.updateRole(role) > 0)
|
||||||
|
// {
|
||||||
|
// // 更新缓存用户权限
|
||||||
|
// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
||||||
|
// if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
|
||||||
|
// {
|
||||||
|
// loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
|
||||||
|
// loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
|
||||||
|
// tokenService.setLoginUser(loginUser);
|
||||||
|
// }
|
||||||
|
// return AjaxResult.success();
|
||||||
|
// }
|
||||||
|
// return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 修改保存数据权限
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
// @Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
|
// @PutMapping("/dataScope")
|
||||||
|
// public AjaxResult dataScope(@RequestBody SysRole role)
|
||||||
|
// {
|
||||||
|
// roleService.checkRoleAllowed(role);
|
||||||
|
// return toAjax(roleService.authDataScope(role));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 状态修改
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:edit')")
|
||||||
|
// @Log(title = "角色管理", businessType = BusinessType.UPDATE)
|
||||||
|
// @PutMapping("/changeStatus")
|
||||||
|
// public AjaxResult changeStatus(@RequestBody SysRole role)
|
||||||
|
// {
|
||||||
|
// roleService.checkRoleAllowed(role);
|
||||||
|
// role.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
// return toAjax(roleService.updateRoleStatus(role));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 删除角色
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:remove')")
|
||||||
|
// @Log(title = "角色管理", businessType = BusinessType.DELETE)
|
||||||
|
// @DeleteMapping("/{roleIds}")
|
||||||
|
// public AjaxResult remove(@PathVariable Long[] roleIds)
|
||||||
|
// {
|
||||||
|
// return toAjax(roleService.deleteRoleByIds(roleIds));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取角色选择框列表
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:role:query')")
|
||||||
|
// @GetMapping("/optionselect")
|
||||||
|
// public AjaxResult optionselect()
|
||||||
|
// {
|
||||||
|
// return AjaxResult.success(roleService.selectRoleAll());
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.dashboard.modules.system.controller.permission.vo;
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.menu;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.dashboard.modules.system.controller.permission.vo;
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.menu;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.dashboard.modules.system.controller.permission.vo;
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.menu;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.dashboard.modules.system.controller.permission.vo;
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.menu;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.dashboard.modules.system.controller.permission.vo;
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.menu;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
|
||||||
|
|
||||||
|
import cn.iocoder.dashboard.common.pojo.PageParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@ApiModel("角色分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysMenuPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@ApiModel("角色创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysRoleCreateReqVO extends SysRoleBaseVO {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
|
||||||
|
|
||||||
|
import cn.iocoder.dashboard.framework.excel.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色 Excel 导出响应 VO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysRoleExcelRespVO {
|
||||||
|
|
||||||
|
@Excel(name = "角色序号", cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Excel(name = "角色名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Excel(name = "角色标志")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Excel(name = "角色排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
|
||||||
|
private Integer dataScope;
|
||||||
|
|
||||||
|
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ApiModel("角色信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysRoleRespVO extends SysRoleBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色编号", required = true, example = "1")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 DataScopeEnum 枚举类")
|
||||||
|
private Integer dataScope;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "参见 RoleTypeEnum 枚举类")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注", example = "我是一个角色")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.dashboard.modules.system.controller.permission.vo.role;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@ApiModel("角色更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysRoleUpdateReqVO extends SysRoleBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色编号", required = true, example = "1024")
|
||||||
|
@NotNull(message = "角色编号不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.dashboard.modules.system.enums.permission;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum RoleTypeEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内置角色
|
||||||
|
*/
|
||||||
|
SYSTEM(1),
|
||||||
|
/**
|
||||||
|
* 自定义角色
|
||||||
|
*/
|
||||||
|
CUSTOM(2);
|
||||||
|
|
||||||
|
private final Integer type;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue