Skip to content

Commit f53b4f0

Browse files
UCMDB OnOff
1 parent d8a230d commit f53b4f0

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

zero-focus/src/main/java/io/mature/extension/refine/Ox.java

+11-9
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,17 @@ public static JsonArray elementCompress(final JsonArray input, final DataAtom at
767767
return OxJson.elementCompress(input, atom);
768768
}
769769

770+
/**
771+
* 针对插件配置的处理
772+
*
773+
* @param key 插件所需的Key
774+
*
775+
* @return
776+
*/
777+
public static boolean onOff(final String key) {
778+
return OxConfig.onOff(key);
779+
}
780+
770781
/**
771782
* ## 环境静态类
772783
*
@@ -778,15 +789,6 @@ public static JsonArray elementCompress(final JsonArray input, final DataAtom at
778789
*/
779790
public interface Env {
780791

781-
/**
782-
* <value>item.enabled</value>,ITSM 专用流程开关。
783-
*
784-
* @return {@link Boolean} ITSM是否启用
785-
*/
786-
static boolean isItsmEnabled() {
787-
return OxConfig.isItsmEnabled();
788-
}
789-
790792

791793
/**
792794
* <value>cmdb.commutator</value>,反射专用生命周期处理器配置(下层调用上层,使用反射,不能直接使用类型)。

zero-focus/src/main/java/io/mature/extension/refine/OxConfig.java

+6-13
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,13 @@ final class OxConfig {
7171
private OxConfig() {
7272
}
7373

74-
/**
75-
* <value>item.enabled</value>,ITSM 专用流程开关。
76-
*
77-
* @return {@link Boolean} ITSM是否启用
78-
*/
79-
static boolean isItsmEnabled() {
80-
// 新版方法内部调用 ArgoStore.configuration()
74+
static boolean onOff(final String key) {
75+
8176
final JsonObject configuration = ArgoStore.configuration();
82-
final Boolean enabled = configuration.getBoolean("itsm.enabled");
83-
if (Objects.isNull(enabled)) {
84-
return false;
85-
} else {
86-
return enabled;
87-
}
77+
78+
final JsonObject onOff = Ut.valueJObject(configuration, "on-off");
79+
80+
return onOff.getBoolean(key, Boolean.FALSE);
8881
}
8982

9083
/**

0 commit comments

Comments
 (0)