1. admin-web 接入菜单

2. system 迁移菜单接口
This commit is contained in:
YunaiV
2020-04-27 00:08:28 +08:00
parent 18180b3a01
commit 983c01d709
27 changed files with 323 additions and 103 deletions

View File

@@ -0,0 +1,17 @@
package cn.iocoder.mall.system.biz.enums.authorization;
public enum ResourceIdEnum {
ROOT(0);
private final Integer id;
ResourceIdEnum(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
}

View File

@@ -0,0 +1,44 @@
package cn.iocoder.mall.system.biz.enums.authorization;
import cn.iocoder.common.framework.core.IntArrayValuable;
import java.util.Arrays;
/**
* 资源类型枚举
*/
public enum ResourceTypeEnum implements IntArrayValuable {
MENU(1, "菜单"),
BUTTON(2, "按钮");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ResourceTypeEnum::getValue).toArray();
/**
* 资源类型
*/
private final Integer value;
/**
* 资源类型名
*/
private final String name;
ResourceTypeEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}
@Override
public int[] array() {
return ARRAYS;
}
}

View File

@@ -0,0 +1,21 @@
package cn.iocoder.mall.system.biz.enums.authorization;
public enum RoleCodeEnum {
SUPER_ADMIN("SUPER_ADMIN"), // 超级管理员
;
/**
* 角色编码
*/
private final String code;
RoleCodeEnum(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}

View File

@@ -0,0 +1,24 @@
package cn.iocoder.mall.system.biz.enums.authorization;
public enum RoleTypeEnum {
/**
* 内置角色
*/
SYSTEM(1),
/**
* 自定义角色
*/
CUSTOM(2);
private final Integer type;
RoleTypeEnum(Integer type) {
this.type = type;
}
public Integer getType() {
return type;
}
}