refactor(权限点): 增加终端类型定义
This commit is contained in:
parent
9063edc6ef
commit
095c48fcb6
@ -0,0 +1,37 @@
|
|||||||
|
package cn.axzo.tyr.client.model.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面适用终端
|
||||||
|
*
|
||||||
|
* @version V1.0
|
||||||
|
* @author: ZhanSiHu
|
||||||
|
* @date: 2023/9/12 11:52
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PageLinkType {
|
||||||
|
PC(1, "PC"),
|
||||||
|
UNI(2, "UNI"),
|
||||||
|
APP(4, "APP"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
private static final Map<Integer, PageLinkType> MAPPING = new HashMap<>();
|
||||||
|
static {
|
||||||
|
for (PageLinkType type : PageLinkType.values()) {
|
||||||
|
MAPPING.put(type.code, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PageLinkType apply(Integer code) {
|
||||||
|
return code == null ? null :MAPPING.get(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -141,12 +141,12 @@ public class SaasFeature extends BaseEntity<SaasFeature> implements Serializable
|
|||||||
private String featureUrl;
|
private String featureUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网关专属字段,是否认证 0:无需要认证 1:需要认证
|
* 网关专属字段,是否认证 0:无需要认证 1:需要认证 - 登录-默认1
|
||||||
*/
|
*/
|
||||||
private Boolean needCert;
|
private Boolean needCert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网关专属字段,是否授权 0:无需要授权 1:需要授权
|
* 网关专属字段,是否授权 0:无需要授权 1:需要授权 - 权限-默认1
|
||||||
*/
|
*/
|
||||||
private Boolean needAuth;
|
private Boolean needAuth;
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,9 @@ public class PermissionPointServiceImpl implements PermissionPointService {
|
|||||||
Map<String, List<PermissionPointTreeNode>> mappingNode = nodesResult.stream()
|
Map<String, List<PermissionPointTreeNode>> mappingNode = nodesResult.stream()
|
||||||
.collect(Collectors.groupingBy(PermissionPointTreeNode::getTerminal));
|
.collect(Collectors.groupingBy(PermissionPointTreeNode::getTerminal));
|
||||||
//构建workspace-terminal工作台层级
|
//构建workspace-terminal工作台层级
|
||||||
List<BasicDictTreeResp> dictList = saasBasicDictService.getBasicDictNodeTree(BasicDictQueryReq.builder().type(DictTypeFiledEnum.TERMINAL).build()).getData();
|
List<BasicDictTreeResp> dictList = saasBasicDictService.getBasicDictNodeTree(BasicDictQueryReq.builder()
|
||||||
|
.type(DictTypeFiledEnum.TERMINAL).build())
|
||||||
|
.getData();
|
||||||
//遍历所有workspace和terminal-构建顶层两级
|
//遍历所有workspace和terminal-构建顶层两级
|
||||||
List<PermissionPointTreeNode> result = new ArrayList<>();
|
List<PermissionPointTreeNode> result = new ArrayList<>();
|
||||||
for (BasicDictTreeResp workspace : dictList) {
|
for (BasicDictTreeResp workspace : dictList) {
|
||||||
@ -102,6 +104,7 @@ public class PermissionPointServiceImpl implements PermissionPointService {
|
|||||||
if (CollectionUtil.isNotEmpty(childrenNodes)) {
|
if (CollectionUtil.isNotEmpty(childrenNodes)) {
|
||||||
PermissionPointTreeNode terminalTree = new PermissionPointTreeNode();
|
PermissionPointTreeNode terminalTree = new PermissionPointTreeNode();
|
||||||
terminalTree.setPermissionName(terminal.getName());
|
terminalTree.setPermissionName(terminal.getName());
|
||||||
|
terminalTree.setTerminal(terminal.getCode());
|
||||||
terminalTree.setCode(terminal.getCode());
|
terminalTree.setCode(terminal.getCode());
|
||||||
terminalTree.setChildren(childrenNodes);
|
terminalTree.setChildren(childrenNodes);
|
||||||
if (workspaceNode == null) {
|
if (workspaceNode == null) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user