Browse Source
Merge in DESIGN/design from ~ANNER/design:fbp/release to fbp/release * commit '377245fadabd2cb85ba0e446b4123c189af48d7a': REPORT-130954 fix: 设计器启动屏蔽不支持的功能fbp/merge
Anner-王敬松
2 months ago
2 changed files with 66 additions and 1 deletions
@ -0,0 +1,62 @@
|
||||
package com.fanruan.boot.adaptation; |
||||
|
||||
import com.fanruan.portal.module.PortalModuleManager; |
||||
import com.fr.third.guava.collect.Sets; |
||||
|
||||
import java.util.Optional; |
||||
import java.util.Set; |
||||
|
||||
import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_GENERAL_ID; |
||||
import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_ID; |
||||
import static com.fanruan.portal.authority.PortalAuthorityItems.MAP_ID; |
||||
import static com.fanruan.portal.authority.PortalAuthorityItems.PORTAL_MANAGEMENT_ID; |
||||
import static com.fanruan.portal.authority.PortalAuthorityItems.SECURITY_ID; |
||||
|
||||
/** |
||||
* 内置服务器支持展示的模块,预期调用顺序在业务模块之后 |
||||
* |
||||
* @author Anner |
||||
* @since 11.0 |
||||
* Created on 2024/10/15 |
||||
*/ |
||||
public class DesignServerSupportModule { |
||||
private final static Set<String> SUPPORT_MODULE = Sets.newHashSet( |
||||
// 系统管理
|
||||
PORTAL_MANAGEMENT_ID, |
||||
// 企业设置
|
||||
ENTERPRISE_ID, |
||||
// 企业设置 - 通用设置
|
||||
ENTERPRISE_GENERAL_ID, |
||||
// 安全管理
|
||||
SECURITY_ID, |
||||
// 地图管理
|
||||
MAP_ID |
||||
); |
||||
|
||||
/** |
||||
* 注册一下支持展示的模块 |
||||
* |
||||
* @param moduleName name |
||||
*/ |
||||
public static void register(String moduleName) { |
||||
Optional.of(moduleName).ifPresent(SUPPORT_MODULE::add); |
||||
} |
||||
|
||||
/** |
||||
* 取消注册展示的模块 |
||||
* |
||||
* @param moduleName name |
||||
*/ |
||||
public static void unregister(String moduleName) { |
||||
Optional.of(moduleName).ifPresent(SUPPORT_MODULE::remove); |
||||
} |
||||
|
||||
/** |
||||
* 启动入口,重建一下展示的module |
||||
*/ |
||||
public static void rebuild() { |
||||
PortalModuleManager.allModules().keySet().stream() |
||||
.filter(m -> !SUPPORT_MODULE.contains(m)) |
||||
.forEach(PortalModuleManager::unregister); |
||||
} |
||||
} |
Loading…
Reference in new issue