feat(domain): 添加数据权限控制和菜单路径参数支持
parent
c2f56b82b2
commit
f79685b4da
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.zcloud.domain.domain.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum MenuEnum {
|
||||||
|
//领域部门
|
||||||
|
LYBMGL("/edu/container/supervision/resourceManage/teacherManage/list", "lybmgl"),
|
||||||
|
//领域组
|
||||||
|
LYZGL("/edu/container/supervision/resourceManage/courseware/list", "lyzgl"),
|
||||||
|
//课题任务管理
|
||||||
|
GFDKTRW("/edu/container/supervision/resourceManage/courseManage/list", "gfd-ktrw"),
|
||||||
|
//课题评分管理
|
||||||
|
GFDKTPF("/edu/container/supervision/resourceManage/testPaperManage/list", "gfd-ktpf"),
|
||||||
|
|
||||||
|
|
||||||
|
//企业端
|
||||||
|
//课题任务管理
|
||||||
|
QYDKTRW("/edu/container/branchCompany/resourceManage/courseware/list", "qyd-ktrw"),
|
||||||
|
//课题评分管理
|
||||||
|
QYDKTPF("/edu/container/branchCompany/resourceManage/courseManage/list", "qyd-ktpf"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String path;
|
||||||
|
private final String menuKey;
|
||||||
|
|
||||||
|
private static final Map<String, MenuEnum> PATH_MAP =
|
||||||
|
Arrays.stream(values())
|
||||||
|
.collect(Collectors.toMap(MenuEnum::getPath, Function.identity()));
|
||||||
|
|
||||||
|
MenuEnum(String path, String menuKey) {
|
||||||
|
this.path = path;
|
||||||
|
this.menuKey = menuKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMenuKey() {
|
||||||
|
return menuKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通过name获取枚举
|
||||||
|
public static MenuEnum getByPath(String path) {
|
||||||
|
return PATH_MAP.get(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通过path获取age
|
||||||
|
public static String getMenuKeyByPath(String path) {
|
||||||
|
MenuEnum entry = PATH_MAP.get(path);
|
||||||
|
return entry != null ? entry.getMenuKey() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue