准备开始迁移管理员相关模块
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.mall.systemservice.enums.admin;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 管理员的状态枚举
|
||||
*/
|
||||
public enum AdminStatusEnum implements IntArrayValuable {
|
||||
|
||||
ACTIVE(1, "在职"),
|
||||
INACTIVE(2, "离职");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AdminStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 在职状态
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
AdminStatusEnum(Integer status, String name) {
|
||||
this.status = status;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
/**
|
||||
* Resource 编号枚举
|
||||
*/
|
||||
public enum ResourceIdEnum {
|
||||
|
||||
/**
|
||||
* 根节点
|
||||
*/
|
||||
ROOT(0);
|
||||
|
||||
private final Integer id;
|
||||
|
||||
ResourceIdEnum(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
import cn.iocoder.common.framework.core.IntArrayValuable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Resource 类型枚举
|
||||
*/
|
||||
public enum ResourceTypeEnum implements IntArrayValuable {
|
||||
|
||||
MENU(1, "菜单"),
|
||||
BUTTON(2, "按钮");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ResourceTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 资源类型名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
ResourceTypeEnum(Integer type, String name) {
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
public enum RoleCodeEnum {
|
||||
|
||||
SUPER_ADMIN("SUPER_ADMIN"), // 超级管理员
|
||||
;
|
||||
|
||||
/**
|
||||
* 角色编码
|
||||
*/
|
||||
private final String code;
|
||||
|
||||
RoleCodeEnum(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.iocoder.mall.systemservice.enums.permission;
|
||||
|
||||
public enum RoleTypeEnum {
|
||||
|
||||
/**
|
||||
* 内置角色
|
||||
*/
|
||||
SYSTEM(1),
|
||||
/**
|
||||
* 自定义角色
|
||||
*/
|
||||
CUSTOM(2);
|
||||
|
||||
private final Integer type;
|
||||
|
||||
RoleTypeEnum(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user