diff --git a/docs/logo/logo.svg b/docs/logo/logo.svg index 0d8eec21f..29ebf6341 100644 --- a/docs/logo/logo.svg +++ b/docs/logo/logo.svg @@ -5,18 +5,18 @@ - + - + - + - + - + \ No newline at end of file diff --git a/front/src/assets/JVM.svg b/front/src/assets/JVM.svg index 70be42335..f4ab7659c 100644 --- a/front/src/assets/JVM.svg +++ b/front/src/assets/JVM.svg @@ -2,7 +2,7 @@ - + diff --git a/front/src/assets/MySQL.svg b/front/src/assets/MySQL.svg index b18be46a4..2d03bf7ae 100644 --- a/front/src/assets/MySQL.svg +++ b/front/src/assets/MySQL.svg @@ -1,18 +1,18 @@ - + - + - + - + - + - + diff --git a/front/src/assets/SpringBoot.svg b/front/src/assets/SpringBoot.svg index 60d378486..35afeab5f 100644 --- a/front/src/assets/SpringBoot.svg +++ b/front/src/assets/SpringBoot.svg @@ -1,6 +1,6 @@ springboot - - + + diff --git a/front/src/assets/da7ebcf2938e.svg b/front/src/assets/da7ebcf2938e.svg index 5ac2293f1..d49824502 100644 --- a/front/src/assets/da7ebcf2938e.svg +++ b/front/src/assets/da7ebcf2938e.svg @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/front/src/assets/logo.svg b/front/src/assets/logo.svg index 6f5ceaf56..3a532c8fb 100644 --- a/front/src/assets/logo.svg +++ b/front/src/assets/logo.svg @@ -1,9 +1,9 @@ 编组 - + - + @@ -17,7 +17,7 @@ - + diff --git a/front/src/pages/alarm/alarmRuler/Detail.tsx b/front/src/pages/alarm/alarmRuler/Detail.tsx index cf3651b47..046c25f87 100644 --- a/front/src/pages/alarm/alarmRuler/Detail.tsx +++ b/front/src/pages/alarm/alarmRuler/Detail.tsx @@ -120,7 +120,7 @@ const calcuRuler: any = { dm: '求和', }), }; -type TriggerType = 'rule' | 'ai' | 'pql'; +type TriggerType = 'alarmRuleConf' | 'ai' | 'pql'; const Detail: React.FC = (props: any) => { //@ts-ignore const { initialState } = useModel('@@initialState'); @@ -130,7 +130,7 @@ const Detail: React.FC = (props: any) => { const [proForm] = Form.useForm(); const settingFormRef = React.createRef(); const formRef = React.createRef(); - const triggerType: TriggerType = Form.useWatch('triggerType', form) || 'rule'; + const triggerType: TriggerType = Form.useWatch('triggerType', form) || 'alarmRuleConf'; let hookFormRef = useRef(null); const [status, setStatus] = useState([]); // 保存 or 编辑 状态 const [showGroup, setShowGroup] = useState([]); // 集群显示的ID的list @@ -165,7 +165,7 @@ const Detail: React.FC = (props: any) => { id: 'holoinsight.pages.alarm.Detail.RuleManagement', dm: '规则管理', }) - const urlListUrl = changeBreadcrumb ? '/user/alarmsub' : '/alarm/rule' + const urlListUrl = changeBreadcrumb ? '/user/alarmsub' : '/alarm/alarmRuleConf' const urlList = [ { name: `${from === 'log' @@ -242,7 +242,7 @@ const Detail: React.FC = (props: any) => { downsample: '1', //目前先默认写死1 }; } - if (triggerType === 'rule') { + if (triggerType === 'alarmRuleConf') { const newCompareConfigs = item.compareConfigs.map((m: any, n: number) => { const compareParam: any = []; if (m.cmp) { @@ -281,10 +281,10 @@ const Detail: React.FC = (props: any) => { ); const downRequest = id ? alarmRuleUpdate : alarmRuleCreate; - res.ruleType = 'rule'; + res.ruleType = 'alarmRuleConf'; res.timeFilter = timeFilter; res.tenant=initialState?.currentTenant - res.rule = { + res.alarmRuleConf = { boolOperation: res.boolOperation, triggers: newTriggers, }; @@ -314,7 +314,7 @@ const Detail: React.FC = (props: any) => { res = { ...res, triggers: undefined, - rule: {}, + alarmRuleConf: {}, triggerType: 'pql', ruleType: 'pql', }; @@ -432,8 +432,8 @@ const Detail: React.FC = (props: any) => { setSelectValue(res?.timeFilter?.model === 'weeks' ? 'weeks' : 'days'); res.timeFilterValue = res?.timeFilter?.model === 'weeks' ? 'weeks' : 'days'; - res.boolOperation = res?.rule?.boolOperation; - res.triggers = res?.rule?.triggers; + res.boolOperation = res?.alarmRuleConf?.boolOperation; + res.triggers = res?.alarmRuleConf?.triggers; res.weeksDay = res?.timeFilter?.weeks; res.dayTime = [ moment(res?.timeFilter?.from, 'HH:mm:ss'), @@ -521,7 +521,7 @@ const Detail: React.FC = (props: any) => { reuqestBackTagArr(newTagsObj); setShowGroup(showGroupArr); if (!res.triggerType) { - res.triggerType = res.ruleType || 'rule'; + res.triggerType = res.ruleType || 'alarmRuleConf'; } const backTemplate = res?.extra?.notificationConfig?.dingtalkTemplate?.fieldMap; if (Object.keys(backTemplate || {}).length) { @@ -1033,7 +1033,7 @@ const Detail: React.FC = (props: any) => { > { form.setFieldValue('triggers', newData); }} > - DAY=1000 * 60 * 60 * 24L */ public static final long DAY = 1000 * 60 * 60 * 24L; + public static String getDateOf_YYMMDD_Plus_HHMMSS(Date date) { + return getDate(date, "yyyy-MM-dd+HH:mm:ss"); + } + private static ThreadLocal> tsf = new ThreadLocal>(); diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/Debugger.java b/server/common/common/src/main/java/io/holoinsight/server/common/Debugger.java similarity index 95% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/Debugger.java rename to server/common/common/src/main/java/io/holoinsight/server/common/Debugger.java index bbc7bbf4b..1bd0b9d18 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/Debugger.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/Debugger.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/EventBusHolder.java b/server/common/common/src/main/java/io/holoinsight/server/common/EventBusHolder.java similarity index 95% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/EventBusHolder.java rename to server/common/common/src/main/java/io/holoinsight/server/common/EventBusHolder.java index 71613bb29..ce8f3270f 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/EventBusHolder.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/EventBusHolder.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; import com.google.common.eventbus.AsyncEventBus; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/FacadeTemplate.java b/server/common/common/src/main/java/io/holoinsight/server/common/FacadeTemplate.java similarity index 83% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/FacadeTemplate.java rename to server/common/common/src/main/java/io/holoinsight/server/common/FacadeTemplate.java index 0590ae087..bc3f308bc 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/FacadeTemplate.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/FacadeTemplate.java @@ -1,9 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; - -import io.holoinsight.server.common.JsonResult; +package io.holoinsight.server.common; /** * facade 请求模版 diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/FacadeTemplateImpl.java b/server/common/common/src/main/java/io/holoinsight/server/common/FacadeTemplateImpl.java similarity index 97% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/FacadeTemplateImpl.java rename to server/common/common/src/main/java/io/holoinsight/server/common/FacadeTemplateImpl.java index 2e898c111..6f098930c 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/FacadeTemplateImpl.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/FacadeTemplateImpl.java @@ -1,9 +1,8 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; -import io.holoinsight.server.common.JsonResult; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.time.StopWatch; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/GlobalFlag.java b/server/common/common/src/main/java/io/holoinsight/server/common/GlobalFlag.java similarity index 94% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/GlobalFlag.java rename to server/common/common/src/main/java/io/holoinsight/server/common/GlobalFlag.java index 30e1df8fd..990f9cb2e 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/GlobalFlag.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/GlobalFlag.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/JpaUpdateUtil.java b/server/common/common/src/main/java/io/holoinsight/server/common/JpaUpdateUtil.java similarity index 94% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/JpaUpdateUtil.java rename to server/common/common/src/main/java/io/holoinsight/server/common/JpaUpdateUtil.java index 4f27e472e..79df8dcd8 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/JpaUpdateUtil.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/JpaUpdateUtil.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; import org.springframework.beans.BeanWrapper; import org.springframework.beans.BeanWrapperImpl; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/LogMsgUtil.java b/server/common/common/src/main/java/io/holoinsight/server/common/LogMsgUtil.java similarity index 88% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/LogMsgUtil.java rename to server/common/common/src/main/java/io/holoinsight/server/common/LogMsgUtil.java index b215bc560..81c228746 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/LogMsgUtil.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/LogMsgUtil.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; import org.apache.logging.log4j.message.ParameterizedMessage; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ManageCallback.java b/server/common/common/src/main/java/io/holoinsight/server/common/ManageCallback.java similarity index 85% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ManageCallback.java rename to server/common/common/src/main/java/io/holoinsight/server/common/ManageCallback.java index 337ab3b88..3292dd35a 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ManageCallback.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/ManageCallback.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; /** * diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ManageInternalCallback.java b/server/common/common/src/main/java/io/holoinsight/server/common/ManageInternalCallback.java similarity index 83% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ManageInternalCallback.java rename to server/common/common/src/main/java/io/holoinsight/server/common/ManageInternalCallback.java index 55e319272..c5bdd31cf 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ManageInternalCallback.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/ManageInternalCallback.java @@ -2,7 +2,7 @@ * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; /** * @author jsy1001de diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/MonitorException.java b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorException.java similarity index 96% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/MonitorException.java rename to server/common/common/src/main/java/io/holoinsight/server/common/MonitorException.java index 7a5bf7e71..147cbdb55 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/MonitorException.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorException.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; /** * diff --git a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/page/MonitorPageRequest.java b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorPageRequest.java similarity index 94% rename from server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/page/MonitorPageRequest.java rename to server/common/common/src/main/java/io/holoinsight/server/common/MonitorPageRequest.java index d6317a8ed..af72cb3d1 100644 --- a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/page/MonitorPageRequest.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorPageRequest.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.facade.page; +package io.holoinsight.server.common; import lombok.Data; diff --git a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/page/MonitorPageResult.java b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorPageResult.java similarity index 92% rename from server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/page/MonitorPageResult.java rename to server/common/common/src/main/java/io/holoinsight/server/common/MonitorPageResult.java index ca7e8af73..24ebc4362 100644 --- a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/page/MonitorPageResult.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorPageResult.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.facade.page; +package io.holoinsight.server.common; import lombok.Data; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/page/MonitorTimePageRequest.java b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorTimePageRequest.java similarity index 91% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/page/MonitorTimePageRequest.java rename to server/common/common/src/main/java/io/holoinsight/server/common/MonitorTimePageRequest.java index 66464b7cc..9ec26618c 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/page/MonitorTimePageRequest.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/MonitorTimePageRequest.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.page; +package io.holoinsight.server.common; import lombok.Data; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/RequestContext.java b/server/common/common/src/main/java/io/holoinsight/server/common/RequestContext.java similarity index 89% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/RequestContext.java rename to server/common/common/src/main/java/io/holoinsight/server/common/RequestContext.java index 942ae6cca..955bb330d 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/RequestContext.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/RequestContext.java @@ -1,7 +1,12 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common; + +import io.holoinsight.server.common.scope.MonitorAuth; +import io.holoinsight.server.common.scope.MonitorParams; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; import java.util.HashMap; import java.util.Map; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ResultCodeEnum.java b/server/common/common/src/main/java/io/holoinsight/server/common/ResultCodeEnum.java similarity index 98% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ResultCodeEnum.java rename to server/common/common/src/main/java/io/holoinsight/server/common/ResultCodeEnum.java index a2c7de4c0..86a9360a8 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/ResultCodeEnum.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/ResultCodeEnum.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common; /** * diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/AbstractLocalCache.java b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/AbstractLocalCache.java similarity index 94% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/AbstractLocalCache.java rename to server/common/common/src/main/java/io/holoinsight/server/common/cache/local/AbstractLocalCache.java index c994bdd01..3f5da2272 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/AbstractLocalCache.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/AbstractLocalCache.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.cache.local; +package io.holoinsight.server.common.cache.local; import java.util.concurrent.TimeUnit; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/CacheConst.java b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/CacheConst.java similarity index 91% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/CacheConst.java rename to server/common/common/src/main/java/io/holoinsight/server/common/cache/local/CacheConst.java index a2fed46e1..adc7470d9 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/CacheConst.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/CacheConst.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.cache.local; +package io.holoinsight.server.common.cache.local; /** * diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/CommonLocalCache.java b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/CommonLocalCache.java similarity index 94% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/CommonLocalCache.java rename to server/common/common/src/main/java/io/holoinsight/server/common/cache/local/CommonLocalCache.java index e85572222..b486a49f7 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/CommonLocalCache.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/CommonLocalCache.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.cache.local; +package io.holoinsight.server.common.cache.local; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -60,7 +60,7 @@ public static void put(String key, Object value, long cacheTime, TimeUnit unit) public static T get(String key) { LocalCacheItem item = cache.get(key); if (item == null) { - log.info("[CommonLocalCache],[{}],[N]", key); + log.info("[g],[{}],[N]", key); return null; } log.info("[CommonLocalCache],[{}],[Y]", key); diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/LocalCache.java b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/LocalCache.java similarity index 80% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/LocalCache.java rename to server/common/common/src/main/java/io/holoinsight/server/common/cache/local/LocalCache.java index 97b61c0ca..dc033ca9c 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/LocalCache.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/LocalCache.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.cache.local; +package io.holoinsight.server.common.cache.local; /** * diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/LocalCacheItem.java b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/LocalCacheItem.java similarity index 94% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/LocalCacheItem.java rename to server/common/common/src/main/java/io/holoinsight/server/common/cache/local/LocalCacheItem.java index e26f55c9c..6ceecc265 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/LocalCacheItem.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/LocalCacheItem.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.cache.local; +package io.holoinsight.server.common.cache.local; /** * diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/SimpleCache.java b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/SimpleCache.java similarity index 92% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/SimpleCache.java rename to server/common/common/src/main/java/io/holoinsight/server/common/cache/local/SimpleCache.java index 2b76de2ac..e4bda1235 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/cache/local/SimpleCache.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/cache/local/SimpleCache.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.cache.local; +package io.holoinsight.server.common.cache.local; import org.springframework.stereotype.Component; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/retrofit/RetrofitApiFactory.java b/server/common/common/src/main/java/io/holoinsight/server/common/retrofit/RetrofitApiFactory.java similarity index 96% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/retrofit/RetrofitApiFactory.java rename to server/common/common/src/main/java/io/holoinsight/server/common/retrofit/RetrofitApiFactory.java index d6e2e9bb7..37e8802b7 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/retrofit/RetrofitApiFactory.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/retrofit/RetrofitApiFactory.java @@ -1,13 +1,12 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.retrofit; +package io.holoinsight.server.common.retrofit; import java.lang.reflect.Proxy; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import io.holoinsight.server.home.common.util.SSLSocketClient; import okhttp3.ConnectionPool; import okhttp3.OkHttpClient; import retrofit2.Retrofit; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/retrofit/RetrofitProxy.java b/server/common/common/src/main/java/io/holoinsight/server/common/retrofit/RetrofitProxy.java similarity index 93% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/retrofit/RetrofitProxy.java rename to server/common/common/src/main/java/io/holoinsight/server/common/retrofit/RetrofitProxy.java index 03f32e6cf..6a02257e5 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/retrofit/RetrofitProxy.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/retrofit/RetrofitProxy.java @@ -1,11 +1,11 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.retrofit; +package io.holoinsight.server.common.retrofit; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; import lombok.extern.slf4j.Slf4j; import retrofit2.Call; import retrofit2.Response; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/SSLSocketClient.java b/server/common/common/src/main/java/io/holoinsight/server/common/retrofit/SSLSocketClient.java similarity index 97% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/SSLSocketClient.java rename to server/common/common/src/main/java/io/holoinsight/server/common/retrofit/SSLSocketClient.java index 92a3d949a..e2322aac9 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/SSLSocketClient.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/retrofit/SSLSocketClient.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util; +package io.holoinsight.server.common.retrofit; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/AuthTarget.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/AuthTarget.java similarity index 90% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/AuthTarget.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/AuthTarget.java index 9b576bcb5..9de626c7f 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/AuthTarget.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/AuthTarget.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; import lombok.Data; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/AuthTargetType.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/AuthTargetType.java similarity index 93% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/AuthTargetType.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/AuthTargetType.java index c6ed262ae..fee39e28d 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/AuthTargetType.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/AuthTargetType.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; import java.util.ArrayList; import java.util.Arrays; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/IdentityType.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/IdentityType.java similarity index 84% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/IdentityType.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/IdentityType.java index a1a7e7732..8a00fdfef 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/IdentityType.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/IdentityType.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; /** * diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorAuth.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorAuth.java similarity index 94% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorAuth.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorAuth.java index 57dacc89d..fcd029cd6 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorAuth.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorAuth.java @@ -1,10 +1,10 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; -import io.holoinsight.server.home.common.util.scope.MonitorAuthPure.AuthTargetPure; -import io.holoinsight.server.home.common.util.scope.MonitorAuthPure.MonitorAuthPkg; +import io.holoinsight.server.common.scope.MonitorAuthPure.AuthTargetPure; +import io.holoinsight.server.common.scope.MonitorAuthPure.MonitorAuthPkg; import java.util.HashMap; import java.util.HashSet; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorAuthPure.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorAuthPure.java similarity index 95% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorAuthPure.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorAuthPure.java index c9ffee428..12b527b81 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorAuthPure.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorAuthPure.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; import java.util.ArrayList; import java.util.HashSet; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorCookieUtil.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorCookieUtil.java similarity index 92% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorCookieUtil.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorCookieUtil.java index 9428d69bd..ad4db774e 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorCookieUtil.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorCookieUtil.java @@ -1,13 +1,14 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; -import io.holoinsight.server.home.common.util.CookieUtils; -import io.holoinsight.server.home.common.util.CryptoUtils; -import io.holoinsight.server.home.common.util.StringUtil; +import io.holoinsight.server.common.CookieUtils; +import io.holoinsight.server.common.CryptoUtils; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.common.J; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; @@ -49,19 +50,19 @@ public static void addUserCookie(MonitorUser user, HttpServletResponse resp) { * */ public static void addTenantCookie(String tenant, HttpServletResponse resp) { - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { CookieUtils.addCookie(resp, TENANT, tenant); } } public static void addTenantWorkspaceCookie(String workspace, HttpServletResponse resp) { - if (StringUtil.isNotBlank(workspace)) { + if (StringUtils.isNotBlank(workspace)) { CookieUtils.addCookie(resp, WORKSPACE, workspace); } } public static void addTenantEnvironmentCookie(String environment, HttpServletResponse resp) { - if (StringUtil.isNotBlank(environment)) { + if (StringUtils.isNotBlank(environment)) { CookieUtils.addCookie(resp, ENVIRONMENT, environment); } } @@ -104,15 +105,15 @@ public static MonitorScope getScope(HttpServletRequest req, MonitorUser mu) { MonitorScope ms = new MonitorScope(); // String loginTenant = CookieUtils.getCookie(req, TENANT); - if (StringUtil.isNotBlank(mu.getLoginTenant())) { + if (StringUtils.isNotBlank(mu.getLoginTenant())) { ms.tenant = mu.getLoginTenant(); } String loginWorkspace = CookieUtils.getCookie(req, WORKSPACE); - if (StringUtil.isNotBlank(loginWorkspace)) { + if (StringUtils.isNotBlank(loginWorkspace)) { ms.workspace = loginWorkspace; } String loginEnvironment = CookieUtils.getCookie(req, ENVIRONMENT); - if (StringUtil.isNotBlank(loginEnvironment)) { + if (StringUtils.isNotBlank(loginEnvironment)) { ms.environment = loginEnvironment; } return ms; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorParams.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorParams.java similarity index 91% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorParams.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorParams.java index 75c0c216f..db09430a2 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorParams.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorParams.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; import lombok.Data; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorScope.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorScope.java similarity index 82% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorScope.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorScope.java index 365379706..5d708208e 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorScope.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorScope.java @@ -1,10 +1,10 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; -import io.holoinsight.server.home.common.util.StringUtil; -import org.springframework.util.StringUtils; + +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; @@ -25,14 +25,14 @@ public class MonitorScope { public List accreditWsList = new ArrayList<>(); public String getWorkspace() { - if (StringUtil.isBlank(workspace)) { + if (StringUtils.isBlank(workspace)) { return null; } return workspace; } public String getEnvironment() { - if (StringUtil.isBlank(environment)) { + if (StringUtils.isBlank(environment)) { return "SERVER"; } return environment; @@ -43,7 +43,7 @@ public void setWorkspace(String workspace) { } public String getTenant() { - if (StringUtil.isBlank(tenant)) { + if (StringUtils.isBlank(tenant)) { return null; } return tenant; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorTenant.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorTenant.java similarity index 86% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorTenant.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorTenant.java index c7068c7f6..ad4a0ff7d 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorTenant.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorTenant.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorUser.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorUser.java similarity index 96% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorUser.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorUser.java index 4824ad7ab..c8f5c4a6b 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/MonitorUser.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/MonitorUser.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; import lombok.Data; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/PowerConstants.java b/server/common/common/src/main/java/io/holoinsight/server/common/scope/PowerConstants.java similarity index 95% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/PowerConstants.java rename to server/common/common/src/main/java/io/holoinsight/server/common/scope/PowerConstants.java index 61e19c5bd..ed8a1a311 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/scope/PowerConstants.java +++ b/server/common/common/src/main/java/io/holoinsight/server/common/scope/PowerConstants.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.scope; +package io.holoinsight.server.common.scope; import java.util.Set; diff --git a/server/extension/extension-storage-ceresdbx/src/main/java/io/holoinsight/server/extension/ceresdbx/CeresdbxMetricStorage.java b/server/extension/extension-storage-ceresdbx/src/main/java/io/holoinsight/server/extension/ceresdbx/CeresdbxMetricStorage.java index 42be9f958..76464ce8a 100644 --- a/server/extension/extension-storage-ceresdbx/src/main/java/io/holoinsight/server/extension/ceresdbx/CeresdbxMetricStorage.java +++ b/server/extension/extension-storage-ceresdbx/src/main/java/io/holoinsight/server/extension/ceresdbx/CeresdbxMetricStorage.java @@ -166,8 +166,7 @@ public List queryData(QueryParam queryParam) { @Override public List queryTags(QueryParam queryParam) { - List results = queryData(queryParam); - return results; + return queryData(queryParam); } @Override @@ -230,7 +229,7 @@ public List pqlRangeQuery(PqlParam pqlParam) { @Override public DetailResult queryDetail(QueryParam queryParam) { String sql = queryParam.getQl(); - List tables = null; + List tables; if (StringUtils.isNotBlank(sql)) { SqlParser parser = SqlParserFactoryProvider.getSqlParserFactory().getParser(sql); tables = parser.tableNames(); @@ -321,13 +320,13 @@ private void doBatchInsert(Set metrics, String tenant, StatUtils.STORAGE_WRITE.add(StringsKey.of("CeresDBx", tenant, "N"), new long[] {1, oneBatch.size(), System.currentTimeMillis() - start}); if (result != null && null != result.getErr()) { - LOGGER.error("save metrics:{} to CeresDBx error msg:{}", metrics, + LOGGER.error("save metrics:{},[{}] to CeresDBx error msg:{}", metrics, tenant, result.getErr().getError()); } else if (null != throwable) { - LOGGER.error("save metrics:{} to CeresDBx error msg:{}", metrics, + LOGGER.error("save metrics:{},[{}] to CeresDBx error msg:{}", metrics, tenant, throwable.getMessage(), throwable); } else { - LOGGER.error("save metrics:{} to CeresDBx error", metrics); + LOGGER.error("save metrics:{},[{}] to CeresDBx error", metrics, tenant); } } }); diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlarmContentGenerator.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlarmContentGenerator.java index 3df1f0d7a..6cf66bff3 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlarmContentGenerator.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlarmContentGenerator.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.alert.common; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.facade.DataResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; import java.util.List; @@ -14,8 +14,8 @@ */ public class AlarmContentGenerator { - public static String genPqlAlarmContent(String pql, List dataResult) { - return J.toJson(dataResult); + public static String genPqlAlarmContent(String pql, List triggerDataResult) { + return J.toJson(triggerDataResult); } } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlertStat.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlertStat.java index ff3bf2c23..87e09768e 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlertStat.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/AlertStat.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.alert.common; import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; -import io.holoinsight.server.home.facade.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import org.springframework.util.CollectionUtils; import java.util.HashMap; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/PeriodUtil.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/PeriodUtil.java index 5c83b9ee7..739a1a5be 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/PeriodUtil.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/PeriodUtil.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.common; -import io.holoinsight.server.home.facade.emuns.PeriodType; +import io.holoinsight.server.common.dao.emuns.PeriodType; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/TimeRangeUtil.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/TimeRangeUtil.java index 0e635973d..3363892f9 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/TimeRangeUtil.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/common/TimeRangeUtil.java @@ -3,9 +3,9 @@ */ package io.holoinsight.server.home.alert.common; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import org.apache.commons.lang3.StringUtils; /** diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeContext.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeContext.java index fe6791527..b54c4e95b 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeContext.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeContext.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.model.compute; -import io.holoinsight.server.home.facade.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import lombok.Data; /** diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeInfo.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeInfo.java index d879a36a0..228cfdfc7 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeInfo.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeInfo.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.model.compute; -import io.holoinsight.server.home.facade.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import lombok.Data; /** diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeTaskPackage.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeTaskPackage.java index 1f6ec47c1..c3f8e2eb4 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeTaskPackage.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/ComputeTaskPackage.java @@ -3,8 +3,8 @@ */ package io.holoinsight.server.home.alert.model.compute; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import lombok.Data; import java.util.List; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ExtendConfig.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ExtendConfig.java index 991fb46fb..810343397 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ExtendConfig.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ExtendConfig.java @@ -4,9 +4,9 @@ package io.holoinsight.server.home.alert.model.compute.algorithm; import io.holoinsight.server.home.alert.model.function.FunctionConfigAIParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; import lombok.Data; import java.util.ArrayList; @@ -25,7 +25,7 @@ public class ExtendConfig { private Map> trendData; - public static ExtendConfig triggerConverter(DataResult dataResult, + public static ExtendConfig triggerConverter(TriggerDataResult triggerDataResult, FunctionConfigAIParam functionConfigAIParam) { ExtendConfig extendConfig = new ExtendConfig(); if (functionConfigAIParam != null && functionConfigAIParam.getTrigger() != null) { @@ -44,12 +44,12 @@ public static ExtendConfig triggerConverter(DataResult dataResult, datasource.put("end", functionConfigAIParam.getPeriod()); // 指定tag List filters = new ArrayList<>(); - for (String key : dataResult.getTags().keySet()) { + for (String key : triggerDataResult.getTags().keySet()) { Filter filter = new Filter(); // 全值匹配 filter.setType("literal"); filter.setName(key); - filter.setValue(dataResult.getTags().get(key)); + filter.setValue(triggerDataResult.getTags().get(key)); filters.add(filter); } datasource.put("filters", filters); @@ -60,7 +60,7 @@ public static ExtendConfig triggerConverter(DataResult dataResult, dataInfo.put("datasources", datasources); extendConfig.setDataInfo(dataInfo); - trendData.put(triggetDataSource.getMetric(), dataResult.getPoints()); + trendData.put(triggetDataSource.getMetric(), triggerDataResult.getPoints()); extendConfig.setTrendData(trendData); } return extendConfig; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ValueAlgorithmRequest.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ValueAlgorithmRequest.java index 0cd5feeba..4acddce7e 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ValueAlgorithmRequest.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/compute/algorithm/ValueAlgorithmRequest.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.model.compute.algorithm; -import io.holoinsight.server.home.facade.trigger.RuleConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.RuleConfig; import lombok.Data; /** diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/data/DataInput.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/data/DataInput.java index 5ff1e200e..62358adfd 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/data/DataInput.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/data/DataInput.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.model.data; -import io.holoinsight.server.home.facade.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; import lombok.Data; import java.io.Serializable; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotify.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotify.java index 7ee15c9dc..4260d60c8 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotify.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotify.java @@ -6,13 +6,13 @@ import io.holoinsight.server.common.AddressUtil; import io.holoinsight.server.common.J; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.PqlRule; -import io.holoinsight.server.home.facade.TemplateValue; -import io.holoinsight.server.home.facade.emuns.AlertLevel; -import io.holoinsight.server.home.facade.trigger.Trigger; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.PqlRule; +import io.holoinsight.server.common.dao.entity.dto.alarm.TemplateValue; +import io.holoinsight.server.common.dao.emuns.AlertLevel; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRecordLatch.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRecordLatch.java index 6286a41ce..08a4441a0 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRecordLatch.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRecordLatch.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.model.event; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; import lombok.Data; import org.springframework.util.CollectionUtils; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRequest.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRequest.java index b967d608f..5bc5cb9b1 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRequest.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/AlertNotifyRequest.java @@ -4,11 +4,11 @@ package io.holoinsight.server.home.alert.model.event; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.AlertRuleExtra; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.NotificationTemplate; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertRuleExtra; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.NotificationTemplate; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import lombok.Data; import java.util.List; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/EventInfo.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/EventInfo.java index 347bc648a..abc8e72c6 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/EventInfo.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/event/EventInfo.java @@ -3,10 +3,10 @@ */ package io.holoinsight.server.home.alert.model.event; -import io.holoinsight.server.home.facade.PqlRule; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.trigger.Trigger; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.PqlRule; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import lombok.Data; import java.util.HashMap; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigAIParam.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigAIParam.java index 0e0913768..f3c361c00 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigAIParam.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigAIParam.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.model.function; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import lombok.Data; /** diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigParam.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigParam.java index 5388417b9..6e356f9f0 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigParam.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionConfigParam.java @@ -3,8 +3,8 @@ */ package io.holoinsight.server.home.alert.model.function; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.trigger.CompareParam; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; import lombok.Data; import java.util.List; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionLogic.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionLogic.java index 7265310f1..f1044a5cd 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionLogic.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/model/function/FunctionLogic.java @@ -3,9 +3,9 @@ */ package io.holoinsight.server.home.alert.model.function; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import java.io.Serializable; @@ -19,10 +19,11 @@ public interface FunctionLogic extends Serializable { /** * - * @param dataResult + * @param triggerDataResult * @param functionConfigParam * @return */ - TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam); + TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam); } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertNotifyHandler.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertNotifyHandler.java index 29a7476b2..f4248f5eb 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertNotifyHandler.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertNotifyHandler.java @@ -10,7 +10,7 @@ import io.holoinsight.server.home.alert.model.event.AlertNotifyRequest; import io.holoinsight.server.home.alert.service.event.AlertHandlerExecutor; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.CollectionUtils; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertSaveHistoryHandler.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertSaveHistoryHandler.java index 50f6d05e8..9a291731c 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertSaveHistoryHandler.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/AlertSaveHistoryHandler.java @@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.holoinsight.server.common.J; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import io.holoinsight.server.home.alert.common.AlarmContentGenerator; import io.holoinsight.server.home.alert.common.G; import io.holoinsight.server.home.alert.common.TimeRangeUtil; @@ -16,18 +17,17 @@ import io.holoinsight.server.home.alert.service.event.AlertHandlerExecutor; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; import io.holoinsight.server.home.common.service.QueryClientService; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryDetailMapper; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryMapper; -import io.holoinsight.server.home.dal.model.AlarmHistory; -import io.holoinsight.server.home.dal.model.AlarmHistoryDetail; -import io.holoinsight.server.home.facade.AlertHistoryExtra; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.AlertSilenceConfig; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.trigger.AlertHistoryDetailExtra; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryDetailMapper; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryMapper; +import io.holoinsight.server.common.dao.entity.AlarmHistory; +import io.holoinsight.server.common.dao.entity.AlarmHistoryDetail; +import io.holoinsight.server.common.dao.entity.dto.AlertHistoryExtra; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertSilenceConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.AlertHistoryDetailExtra; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import io.holoinsight.server.query.grpc.QueryProto; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -485,7 +485,7 @@ private void genPqlAlertHistoryDetail(AlertNotify alertNotify, Long historyId) { alarmHistoryDetail.setEnvType(alertNotify.getEnvType()); alarmHistoryDetail.setDatasource(alertNotify.getPqlRule().getPql()); List> tagList = alertNotify.getPqlRule().getDataResult().stream() - .map(DataResult::getTags).collect(Collectors.toList()); + .map(TriggerDataResult::getTags).collect(Collectors.toList()); alarmHistoryDetail.setTags(G.get().toJson(tagList)); alarmHistoryDetail.setAlarmContent(AlarmContentGenerator.genPqlAlarmContent( alertNotify.getPqlRule().getPql(), alertNotify.getPqlRule().getDataResult())); diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GatewayService.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GatewayService.java index ee2f89179..b3d5b7f0b 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GatewayService.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GatewayService.java @@ -12,19 +12,19 @@ import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; import io.holoinsight.server.home.biz.plugin.model.PluginContext; import io.holoinsight.server.home.biz.service.IntegrationPluginService; -import io.holoinsight.server.home.dal.converter.AlarmRuleConverter; -import io.holoinsight.server.home.dal.converter.AlertTemplateConverter; -import io.holoinsight.server.home.dal.mapper.AlarmRuleMapper; -import io.holoinsight.server.home.dal.mapper.AlertTemplateMapper; -import io.holoinsight.server.home.dal.model.AlarmRule; -import io.holoinsight.server.home.dal.model.AlertTemplate; +import io.holoinsight.server.common.dao.converter.AlarmRuleConverter; +import io.holoinsight.server.common.dao.converter.AlertTemplateConverter; +import io.holoinsight.server.common.dao.mapper.AlarmRuleMapper; +import io.holoinsight.server.common.dao.mapper.AlertTemplateMapper; +import io.holoinsight.server.common.dao.entity.AlarmRule; +import io.holoinsight.server.common.dao.entity.AlertTemplate; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.AlertTemplateDTO; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.AlertRuleExtra; -import io.holoinsight.server.home.facade.NotificationTemplate; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertTemplateDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertRuleExtra; +import io.holoinsight.server.common.dao.entity.dto.NotificationTemplate; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GetSubscriptionHandler.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GetSubscriptionHandler.java index 28b147d3e..c2a30d595 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GetSubscriptionHandler.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/GetSubscriptionHandler.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.reflect.TypeToken; import io.holoinsight.server.common.J; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import io.holoinsight.server.home.alert.common.G; import io.holoinsight.server.home.alert.model.event.AlertNotify; import io.holoinsight.server.home.alert.model.event.NotifyDataInfo; @@ -14,22 +15,21 @@ import io.holoinsight.server.home.alert.service.converter.DoConvert; import io.holoinsight.server.home.alert.service.event.AlertHandlerExecutor; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.dal.mapper.AlarmBlockMapper; -import io.holoinsight.server.home.dal.mapper.AlarmDingDingRobotMapper; -import io.holoinsight.server.home.dal.mapper.AlarmGroupMapper; -import io.holoinsight.server.home.dal.mapper.AlarmSubscribeMapper; -import io.holoinsight.server.home.dal.mapper.AlarmWebhookMapper; -import io.holoinsight.server.home.dal.model.AlarmBlock; -import io.holoinsight.server.home.dal.model.AlarmDingDingRobot; -import io.holoinsight.server.home.dal.model.AlarmGroup; -import io.holoinsight.server.home.dal.model.AlarmSubscribe; -import io.holoinsight.server.home.dal.model.AlarmWebhook; -import io.holoinsight.server.home.facade.AlertSilenceConfig; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.PqlRule; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.dao.mapper.AlarmBlockMapper; +import io.holoinsight.server.common.dao.mapper.AlarmDingDingRobotMapper; +import io.holoinsight.server.common.dao.mapper.AlarmGroupMapper; +import io.holoinsight.server.common.dao.mapper.AlarmSubscribeMapper; +import io.holoinsight.server.common.dao.mapper.AlarmWebhookMapper; +import io.holoinsight.server.common.dao.entity.AlarmBlock; +import io.holoinsight.server.common.dao.entity.AlarmDingDingRobot; +import io.holoinsight.server.common.dao.entity.AlarmGroup; +import io.holoinsight.server.common.dao.entity.AlarmSubscribe; +import io.holoinsight.server.common.dao.entity.AlarmWebhook; +import io.holoinsight.server.common.dao.entity.dto.AlertSilenceConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.PqlRule; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -278,10 +278,10 @@ private void handleBlock(List alertNotifies) { if (!CollectionUtils.isEmpty(tagMap)) { if (alertNotify.isPqlNotify()) { PqlRule pqlRule = alertNotify.getPqlRule(); - Iterator it = pqlRule.getDataResult().iterator(); + Iterator it = pqlRule.getDataResult().iterator(); while (it.hasNext()) { - DataResult dataResult = it.next(); - Map notifyTags = dataResult.getTags(); + TriggerDataResult triggerDataResult = it.next(); + Map notifyTags = triggerDataResult.getTags(); notifyTags.forEach((key, value) -> { if (tagMap.containsKey(key)) { Pattern pattern = Pattern.compile(tagMap.get(key)); diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/NotifyChain.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/NotifyChain.java index d6f490541..7e0eb4fde 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/NotifyChain.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/plugin/NotifyChain.java @@ -9,7 +9,7 @@ import io.holoinsight.server.home.biz.plugin.model.PluginType; import io.holoinsight.server.home.biz.plugin.model.ScheduleTimeEnum; import io.holoinsight.server.home.biz.plugin.model.WaitPlugin; -import io.holoinsight.server.home.common.exception.HoloinsightAlertIllegalArgumentException; +import io.holoinsight.server.common.model.HoloinsightAlertIllegalArgumentException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/AlertService.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/AlertService.java index 3066de97b..36afa9a42 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/AlertService.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/AlertService.java @@ -15,7 +15,7 @@ import io.holoinsight.server.home.alert.common.webhook.WebhookUtil; import io.holoinsight.server.home.alert.model.event.WebhookInfo; import io.holoinsight.server.home.common.service.query.WebhookResponse; -import io.holoinsight.server.home.dal.model.dto.AlarmWebhookTestDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmWebhookTestDTO; import lombok.Data; @Service diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AbstractUniformInspectRunningRule.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AbstractUniformInspectRunningRule.java index a4dd2a554..062d27220 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AbstractUniformInspectRunningRule.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AbstractUniformInspectRunningRule.java @@ -3,6 +3,7 @@ */ package io.holoinsight.server.home.alert.service.calculate; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; import io.holoinsight.server.home.alert.model.compute.ComputeContext; import io.holoinsight.server.home.alert.model.compute.ComputeInfo; import io.holoinsight.server.home.alert.model.event.EventInfo; @@ -10,16 +11,15 @@ import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; import io.holoinsight.server.home.alert.model.function.FunctionLogic; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.PqlRule; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.trigger.CompareConfig; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.PqlRule; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -133,14 +133,14 @@ private Map> convertFromPql(PqlRule pqlRule, long p trigger.setDatasources(Collections.singletonList(dataSource)); List resultList = new ArrayList<>(); - for (DataResult dataResult : pqlRule.getDataResult()) { + for (TriggerDataResult triggerDataResult : pqlRule.getDataResult()) { TriggerResult triggerResult = new TriggerResult(); triggerResult.setMetric(pqlRule.getPql()); triggerResult.setHit(true); - triggerResult.setTags(dataResult.getTags()); - if (!CollectionUtils.isEmpty(dataResult.getPoints())) { - triggerResult.setCurrentValue(dataResult.getPoints().get(period)); - dataResult.getPoints().forEach(triggerResult::addValue); + triggerResult.setTags(triggerDataResult.getTags()); + if (!CollectionUtils.isEmpty(triggerDataResult.getPoints())) { + triggerResult.setCurrentValue(triggerDataResult.getPoints().get(period)); + triggerDataResult.getPoints().forEach(triggerResult::addValue); } triggerResult.setTriggerLevel(inspectConfig.getAlarmLevel()); resultList.add(triggerResult); @@ -157,20 +157,20 @@ public EventInfo runRule(InspectConfig inspectConfig, long period, List noEventGeneratedList = new ArrayList<>();// 不告警 for (Trigger trigger : inspectConfig.getRule().getTriggers()) { // 后续考虑增加tags比较 - List dataResultList = trigger.getDataResult(); - if (CollectionUtils.isEmpty(dataResultList)) { + List triggerDataResultList = trigger.getDataResult(); + if (CollectionUtils.isEmpty(triggerDataResultList)) { continue; } - int parallelSize = dataResultList.size(); + int parallelSize = triggerDataResultList.size(); ComputeInfo computeInfo = ComputeInfo.getComputeInfo(inspectConfig, period); List triggerResults = new CopyOnWriteArrayList<>(); CountDownLatch latch = new CountDownLatch(parallelSize); logger.info("ALERT_CONCURRENT_MONITOR,size={},rule={}", parallelSize, inspectConfig.getUniqueId()); - for (DataResult dataResult : dataResultList) { + for (TriggerDataResult triggerDataResult : triggerDataResultList) { ruleRunner.execute(() -> { try { - List ruleResults = apply(dataResult, computeInfo, trigger); + List ruleResults = apply(triggerDataResult, computeInfo, trigger); for (TriggerResult ruleResult : ruleResults) { if (ruleResult.isHit()) { triggerResults.add(ruleResult); @@ -189,14 +189,15 @@ public EventInfo runRule(InspectConfig inspectConfig, long period, triggerMap.put(trigger, triggerResults); } } - Rule rule = inspectConfig.getRule(); - if ((BoolOperationEnum.AND.equals(rule.getBoolOperation()) - && rule.getTriggers().size() == triggerMap.size()) - || (BoolOperationEnum.OR.equals(rule.getBoolOperation()) && !triggerMap.isEmpty())) { + AlarmRuleConf alarmRuleConf = inspectConfig.getRule(); + if ((BoolOperationEnum.AND.equals(alarmRuleConf.getBoolOperation()) + && alarmRuleConf.getTriggers().size() == triggerMap.size()) + || (BoolOperationEnum.OR.equals(alarmRuleConf.getBoolOperation()) + && !triggerMap.isEmpty())) { EventInfo eventInfo = new EventInfo(); eventInfo.setAlarmTriggerResults(triggerMap); eventInfo.setUniqueId(inspectConfig.getUniqueId()); - eventInfo.setBoolOperation(rule.getBoolOperation()); + eventInfo.setBoolOperation(alarmRuleConf.getBoolOperation()); eventInfo.setAlarmTime(period); eventInfo.setIsRecover(false); eventInfo.setEnvType(inspectConfig.getEnvType()); @@ -218,12 +219,12 @@ public EventInfo runRule(InspectConfig inspectConfig, long period, /** * 执行规则 * - * @param dataResult 数据结果 + * @param triggerDataResult 数据结果 * @param computeInfo 计算信息 * @param trigger 触发 * @return {@link TriggerResult} */ - public List apply(DataResult dataResult, ComputeInfo computeInfo, + public List apply(TriggerDataResult triggerDataResult, ComputeInfo computeInfo, Trigger trigger) { FunctionLogic inspectFunction = FunctionManager.functionMap.get(trigger.getType()); // 增加智能告警算法执行 @@ -233,9 +234,9 @@ public List apply(DataResult dataResult, ComputeInfo computeInfo, List triggerResults = new ArrayList<>(); List functionConfigParams = buildFunctionConfigParam(computeInfo, trigger); for (FunctionConfigParam functionConfigParam : functionConfigParams) { - TriggerResult ruleResult = inspectFunction.invoke(dataResult, functionConfigParam); - ruleResult.setMetric(dataResult.getMetric()); - ruleResult.setTags(dataResult.getTags()); + TriggerResult ruleResult = inspectFunction.invoke(triggerDataResult, functionConfigParam); + ruleResult.setMetric(triggerDataResult.getMetric()); + ruleResult.setTags(triggerDataResult.getTags()); ruleResult.setCompareParam(functionConfigParam.getCmp()); ruleResult.setTriggerContent(functionConfigParam.getTriggerContent()); ruleResult.setTriggerLevel(functionConfigParam.getTriggerLevel()); @@ -244,9 +245,10 @@ public List apply(DataResult dataResult, ComputeInfo computeInfo, break; } } - List nullValTimes = this.nullValueTracker.hasNullValue(dataResult, functionConfigParams); + List nullValTimes = + this.nullValueTracker.hasNullValue(triggerDataResult, functionConfigParams); if (!CollectionUtils.isEmpty(nullValTimes)) { - this.nullValueTracker.record(dataResult, trigger, nullValTimes, computeInfo); + this.nullValueTracker.record(triggerDataResult, trigger, nullValTimes, computeInfo); } return triggerResults; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskCompute.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskCompute.java index 56a97b401..61027316a 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskCompute.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskCompute.java @@ -4,6 +4,7 @@ package io.holoinsight.server.home.alert.service.calculate; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import io.holoinsight.server.home.alert.common.AlertStat; import io.holoinsight.server.home.alert.common.G; import io.holoinsight.server.home.alert.model.compute.ComputeContext; @@ -15,11 +16,10 @@ import io.holoinsight.server.home.alert.service.event.AlertEventService; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; import io.holoinsight.server.home.alert.service.task.AlarmTaskExecutor; -import io.holoinsight.server.home.common.exception.HoloinsightAlertIllegalArgumentException; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryMapper; -import io.holoinsight.server.home.dal.model.AlarmHistory; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.InspectConfig; +import io.holoinsight.server.common.model.HoloinsightAlertIllegalArgumentException; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryMapper; +import io.holoinsight.server.common.dao.entity.AlarmHistory; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyDownAbnormalDetect.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyDownAbnormalDetect.java index f0992ad48..36e29bb04 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyDownAbnormalDetect.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyDownAbnormalDetect.java @@ -12,10 +12,10 @@ import io.holoinsight.server.home.alert.model.function.FunctionConfigAIParam; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; import io.holoinsight.server.home.alert.model.function.FunctionLogic; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.TriggerAIResult; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerAIResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -41,7 +41,8 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { FunctionConfigAIParam functionConfigAIParam = (FunctionConfigAIParam) functionConfigParam; AnomalyAlgorithmRequest algorithmRequest = new AnomalyAlgorithmRequest(); AlgorithmConfig algorithmConfig = new AlgorithmConfig(); @@ -55,7 +56,7 @@ public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionC algorithmRequest.setAlgorithmConfig(algorithmConfig); algorithmRequest.setRuleConfig(ruleConfig); Map inputTimeSeries = new HashMap<>(); - dataResult.getPoints().forEach((k, v) -> inputTimeSeries.put(k.toString(), v)); + triggerDataResult.getPoints().forEach((k, v) -> inputTimeSeries.put(k.toString(), v)); algorithmRequest.setInputTimeSeries(inputTimeSeries); TriggerAIResult triggerAIResult = new TriggerAIResult(); @@ -69,8 +70,8 @@ public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionC if (anomalyAlgorithmResponse != null && anomalyAlgorithmResponse.getIsSuccessful() && anomalyAlgorithmResponse.getIsException()) { triggerAIResult.setHit(true); - triggerAIResult - .setCurrentValue(dataResult.getPoints().get(anomalyAlgorithmResponse.getDetectTime())); + triggerAIResult.setCurrentValue( + triggerDataResult.getPoints().get(anomalyAlgorithmResponse.getDetectTime())); } return triggerAIResult; } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyUpAbnormalDetect.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyUpAbnormalDetect.java index 8cafe2075..fa9f9c2de 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyUpAbnormalDetect.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/AnomalyUpAbnormalDetect.java @@ -12,10 +12,10 @@ import io.holoinsight.server.home.alert.model.function.FunctionConfigAIParam; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; import io.holoinsight.server.home.alert.model.function.FunctionLogic; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.TriggerAIResult; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerAIResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -41,7 +41,8 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { FunctionConfigAIParam functionConfigAIParam = (FunctionConfigAIParam) functionConfigParam; AnomalyAlgorithmRequest algorithmRequest = new AnomalyAlgorithmRequest(); AlgorithmConfig algorithmConfig = new AlgorithmConfig(); @@ -55,7 +56,7 @@ public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionC algorithmRequest.setAlgorithmConfig(algorithmConfig); algorithmRequest.setRuleConfig(ruleConfig); Map inputTimeSeries = new HashMap<>(); - dataResult.getPoints().forEach((k, v) -> inputTimeSeries.put(k.toString(), v)); + triggerDataResult.getPoints().forEach((k, v) -> inputTimeSeries.put(k.toString(), v)); algorithmRequest.setInputTimeSeries(inputTimeSeries); TriggerAIResult triggerAIResult = new TriggerAIResult(); @@ -69,8 +70,8 @@ public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionC if (anomalyAlgorithmResponse != null && anomalyAlgorithmResponse.getIsSuccessful() && anomalyAlgorithmResponse.getIsException()) { triggerAIResult.setHit(true); - triggerAIResult - .setCurrentValue(dataResult.getPoints().get(anomalyAlgorithmResponse.getDetectTime())); + triggerAIResult.setCurrentValue( + triggerDataResult.getPoints().get(anomalyAlgorithmResponse.getDetectTime())); } return triggerAIResult; } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/BaseFunction.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/BaseFunction.java index 088d92ef3..c743dca21 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/BaseFunction.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/BaseFunction.java @@ -5,10 +5,10 @@ import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; import io.holoinsight.server.home.alert.model.function.FunctionLogic; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import java.util.Map; @@ -42,12 +42,13 @@ protected Double fillOne(boolean zeroFill, Double value) { return value; } - protected TriggerResult doInvoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { + protected TriggerResult doInvoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { TriggerResult result = new TriggerResult(); result.setHit(false); long delta = getDelta(functionConfigParam.getPeriodType()); - Map points = dataResult.getPoints(); + Map points = triggerDataResult.getPoints(); Double currentValue = points.get(functionConfigParam.getPeriod()); if (currentValue == null && functionConfigParam.isZeroFill()) { currentValue = 0d; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Current.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Current.java index caa4114db..b0fb3e9e8 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Current.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Current.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.springframework.stereotype.Service; /** @@ -22,8 +22,9 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { - return doInvoke(dataResult, functionConfigParam); + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { + return doInvoke(triggerDataResult, functionConfigParam); } @Override diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/FunctionManager.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/FunctionManager.java index a2526f579..3a3aadc10 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/FunctionManager.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/FunctionManager.java @@ -5,7 +5,7 @@ import io.holoinsight.server.home.alert.model.function.FunctionLogic; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; import org.springframework.beans.factory.InitializingBean; import org.springframework.stereotype.Service; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/NullValueTracker.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/NullValueTracker.java index 7848eca9b..63fcfb53e 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/NullValueTracker.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/NullValueTracker.java @@ -9,8 +9,8 @@ import io.holoinsight.server.home.alert.service.data.load.RuleAlarmLoadData; import io.holoinsight.server.home.biz.common.MetaDictUtil; import io.holoinsight.server.home.common.service.QueryClientService; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import io.holoinsight.server.query.grpc.QueryProto; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -43,24 +43,25 @@ public class NullValueTracker { private ConcurrentHashMap> map = new ConcurrentHashMap<>(); - public void record(DataResult dataResult, Trigger trigger, List nullValTimes, + public void record(TriggerDataResult triggerDataResult, Trigger trigger, List nullValTimes, ComputeInfo computeInfo) { if (!enable()) { return; } long period = computeInfo.getPeriod(); - log.info("record at {} {}", period, dataResult.getKey()); + log.info("record at {} {}", period, triggerDataResult.getKey()); List records = map.computeIfAbsent(period, k -> new ArrayList<>()); - records.add(new Record(dataResult, trigger, nullValTimes, period, computeInfo.getTenant())); + records + .add(new Record(triggerDataResult, trigger, nullValTimes, period, computeInfo.getTenant())); } - public List hasNullValue(DataResult dataResult, + public List hasNullValue(TriggerDataResult triggerDataResult, List functionConfigParams) { if (CollectionUtils.isEmpty(functionConfigParams)) { return Collections.emptyList(); } List nullValTimes = new ArrayList<>(); - Map points = dataResult.getPoints(); + Map points = triggerDataResult.getPoints(); for (FunctionConfigParam functionConfigParam : functionConfigParams) { long duration = functionConfigParam.getDuration(); for (long i = 0; i < duration; i++) { @@ -136,15 +137,15 @@ private CheckResult doCheck(Record record) { } private static class Record { - DataResult dataResult; + TriggerDataResult triggerDataResult; Trigger trigger; List nullValTimes; long period; String tenant; - public Record(DataResult dataResult, Trigger trigger, List nullValTimes, long period, - String tenant) { - this.dataResult = dataResult; + public Record(TriggerDataResult triggerDataResult, Trigger trigger, List nullValTimes, + long period, String tenant) { + this.triggerDataResult = triggerDataResult; this.trigger = trigger; this.nullValTimes = nullValTimes; this.period = period; @@ -152,10 +153,10 @@ public Record(DataResult dataResult, Trigger trigger, List nullValTimes, l } public boolean equalMetricAndTags(QueryProto.Result result) { - DataResult key = new DataResult(); + TriggerDataResult key = new TriggerDataResult(); key.setMetric(result.getMetric()); key.setTags(result.getTagsMap()); - return StringUtils.equals(dataResult.getKey(), key.getKey()); + return StringUtils.equals(triggerDataResult.getKey(), key.getKey()); } } @@ -178,8 +179,8 @@ public static CheckResult conflictAt(Double curValue, Record record, Long timest CheckResult checkResult = new CheckResult(); checkResult.conflict = true; checkResult.curValue = curValue; - checkResult.metric = record.dataResult.getMetric(); - checkResult.tags = record.dataResult.getTags(); + checkResult.metric = record.triggerDataResult.getMetric(); + checkResult.tags = record.triggerDataResult.getTags(); checkResult.cur = timestamp; return checkResult; } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbs.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbs.java index 93c0a6c22..4d7859ec8 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbs.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbs.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.springframework.stereotype.Service; /** @@ -22,8 +22,9 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { - return doInvoke(dataResult, functionConfigParam); + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { + return doInvoke(triggerDataResult, functionConfigParam); } @Override diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodRate.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodRate.java index 39417aa12..4670fd9eb 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodRate.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodRate.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.springframework.stereotype.Service; /** @@ -22,8 +22,9 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { - return doInvoke(dataResult, functionConfigParam); + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { + return doInvoke(triggerDataResult, functionConfigParam); } @Override diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodValue.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodValue.java index 985176412..bf208a4d6 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodValue.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/PeriodValue.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.springframework.stereotype.Service; /** @@ -22,8 +22,9 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { - return doInvoke(dataResult, functionConfigParam); + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { + return doInvoke(triggerDataResult, functionConfigParam); } @Override diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Step.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Step.java index c41d6f3e3..34690cc21 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Step.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/Step.java @@ -10,10 +10,10 @@ import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; import io.holoinsight.server.home.alert.model.function.FunctionLogic; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.springframework.stereotype.Service; import java.util.Map; @@ -28,13 +28,14 @@ public FunctionEnum getFunc() { return FunctionEnum.Step; } - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { TriggerResult fr = new TriggerResult(); fr.setHit(false); int triggerNum = 0; // 循环周期 (是否手动计算周期再循环) - for (Map.Entry m : dataResult.getPoints().entrySet()) { + for (Map.Entry m : triggerDataResult.getPoints().entrySet()) { // 循环条件 boolean isTrigger = true; for (CompareParam cmp : functionConfigParam.getCmp()) { @@ -49,10 +50,10 @@ public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionC } } if (triggerNum >= functionConfigParam.getDuration()) { - fr.setCurrentValue(dataResult.getPoints().get(functionConfigParam.getPeriod())); + fr.setCurrentValue(triggerDataResult.getPoints().get(functionConfigParam.getPeriod())); fr.setHit(true); fr.setCompareParam(functionConfigParam.getCmp()); - fr.setTags(dataResult.getTags()); + fr.setTags(triggerDataResult.getTags()); } return fr; } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/TriggerLogicNew.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/TriggerLogicNew.java index e0b643ddb..d1d69422a 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/TriggerLogicNew.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/TriggerLogicNew.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.service.calculate; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; import java.io.Serializable; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueDownAbnormalDetect.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueDownAbnormalDetect.java index 90f7d1f88..7536f7b3d 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueDownAbnormalDetect.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueDownAbnormalDetect.java @@ -13,12 +13,12 @@ import io.holoinsight.server.home.alert.model.function.FunctionConfigAIParam; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; import io.holoinsight.server.home.alert.model.function.FunctionLogic; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.trigger.RuleConfig; -import io.holoinsight.server.home.facade.trigger.TriggerAIResult; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.RuleConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerAIResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -43,7 +43,8 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { FunctionConfigAIParam functionConfigAIParam = (FunctionConfigAIParam) functionConfigParam; TriggerAIResult triggerAIResult = new TriggerAIResult(); ValueAlgorithmRequest valueAlgorithmRequest = new ValueAlgorithmRequest(); @@ -64,10 +65,10 @@ public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionC .setDetectTime(functionConfigAIParam.getPeriod() + PeriodType.MINUTE.intervalMillis()); valueAlgorithmRequest.setAlgorithmConfig(algorithmConfig); valueAlgorithmRequest - .setExtendConfig(ExtendConfig.triggerConverter(dataResult, functionConfigAIParam)); + .setExtendConfig(ExtendConfig.triggerConverter(triggerDataResult, functionConfigAIParam)); RuleConfig ruleConfig = functionConfigAIParam.getTrigger().getRuleConfig(); if (ruleConfig == null) { - ruleConfig = RuleConfig.defaultDownConfig(dataResult.getMetric()); + ruleConfig = RuleConfig.defaultDownConfig(triggerDataResult.getMetric()); } valueAlgorithmRequest.setRuleConfig(ruleConfig); // Set the name of the algorithm interface diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueUpAbnormalDetect.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueUpAbnormalDetect.java index ecc771219..cc08d42d0 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueUpAbnormalDetect.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/calculate/ValueUpAbnormalDetect.java @@ -13,12 +13,12 @@ import io.holoinsight.server.home.alert.model.function.FunctionConfigAIParam; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; import io.holoinsight.server.home.alert.model.function.FunctionLogic; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.trigger.RuleConfig; -import io.holoinsight.server.home.facade.trigger.TriggerAIResult; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.RuleConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerAIResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -43,7 +43,8 @@ public FunctionEnum getFunc() { } @Override - public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionConfigParam) { + public TriggerResult invoke(TriggerDataResult triggerDataResult, + FunctionConfigParam functionConfigParam) { FunctionConfigAIParam functionConfigAIParam = (FunctionConfigAIParam) functionConfigParam; TriggerAIResult triggerAIResult = new TriggerAIResult(); ValueAlgorithmRequest valueAlgorithmRequest = new ValueAlgorithmRequest(); @@ -64,10 +65,10 @@ public TriggerResult invoke(DataResult dataResult, FunctionConfigParam functionC .setDetectTime(functionConfigAIParam.getPeriod() + PeriodType.MINUTE.intervalMillis()); valueAlgorithmRequest.setAlgorithmConfig(algorithmConfig); valueAlgorithmRequest - .setExtendConfig(ExtendConfig.triggerConverter(dataResult, functionConfigAIParam)); + .setExtendConfig(ExtendConfig.triggerConverter(triggerDataResult, functionConfigAIParam)); RuleConfig ruleConfig = functionConfigAIParam.getTrigger().getRuleConfig(); if (ruleConfig == null) { - ruleConfig = RuleConfig.defaultUpConfig(dataResult.getMetric()); + ruleConfig = RuleConfig.defaultUpConfig(triggerDataResult.getMetric()); } valueAlgorithmRequest.setRuleConfig(ruleConfig); // Set the name of the algorithm interface diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/converter/DoConvert.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/converter/DoConvert.java index f60380cb0..532458c0f 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/converter/DoConvert.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/converter/DoConvert.java @@ -8,17 +8,16 @@ import io.holoinsight.server.home.alert.model.event.AlertNotify; import io.holoinsight.server.home.alert.model.event.NotifyDataInfo; import io.holoinsight.server.home.alert.model.event.WebhookInfo; -import io.holoinsight.server.home.dal.model.AlarmHistory; -import io.holoinsight.server.home.dal.model.AlarmRule; -import io.holoinsight.server.home.dal.model.AlarmWebhook; -import io.holoinsight.server.home.dal.model.AlertmanagerWebhook; -import io.holoinsight.server.home.facade.AlertRuleExtra; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.PqlRule; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.TimeFilter; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.AlarmHistory; +import io.holoinsight.server.common.dao.entity.AlarmRule; +import io.holoinsight.server.common.dao.entity.AlarmWebhook; +import io.holoinsight.server.common.dao.entity.dto.AlertRuleExtra; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.PqlRule; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.TimeFilter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +52,7 @@ public static InspectConfig alarmRuleConverter(AlarmRule alarmRuleDO) { inspectConfig.setIsPql(true); inspectConfig.setPqlRule(pqlRule); } else { - inspectConfig.setRule(G.get().fromJson(alarmRuleDO.getRule(), Rule.class)); + inspectConfig.setRule(G.get().fromJson(alarmRuleDO.getRule(), AlarmRuleConf.class)); inspectConfig.setIsPql(false); inspectConfig.setMetrics(getMetricsFromRule(inspectConfig.getRule())); } @@ -73,12 +72,12 @@ public static InspectConfig alarmRuleConverter(AlarmRule alarmRuleDO) { return inspectConfig; } - private static List getMetricsFromRule(Rule rule) { + private static List getMetricsFromRule(AlarmRuleConf alarmRuleConf) { List metrics = new ArrayList<>(); - if (rule == null || CollectionUtils.isEmpty(rule.getTriggers())) { + if (alarmRuleConf == null || CollectionUtils.isEmpty(alarmRuleConf.getTriggers())) { return metrics; } - for (Trigger trigger : rule.getTriggers()) { + for (Trigger trigger : alarmRuleConf.getTriggers()) { if (CollectionUtils.isEmpty(trigger.getDatasources())) { continue; } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmDataSet.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmDataSet.java index 7cafc5162..115147f67 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmDataSet.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmDataSet.java @@ -6,10 +6,10 @@ import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.alert.service.data.load.PqlAlarmLoadData; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.PqlRule; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.PqlRule; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -54,7 +54,7 @@ public void loadData(ComputeTaskPackage computeTaskPackage) { try { PqlRule pqlRule = inspectConfig.getPqlRule(); if (pqlRule != null && !StringUtils.isEmpty(pqlRule.getPql())) { - List result = + List result = pqlAlarmLoadData.queryDataResult(computeTaskPackage, inspectConfig); pqlRule.setDataResult(result); inspectConfig.setPqlRule(pqlRule); @@ -69,20 +69,20 @@ public void loadData(ComputeTaskPackage computeTaskPackage) { } } else { // 处理rule&ai告警逻辑 - Rule rule = inspectConfig.getRule(); - if (rule == null || CollectionUtils.isEmpty(rule.getTriggers())) { + AlarmRuleConf alarmRuleConf = inspectConfig.getRule(); + if (alarmRuleConf == null || CollectionUtils.isEmpty(alarmRuleConf.getTriggers())) { return; } boolean notifySuccess = true; - for (Trigger trigger : rule.getTriggers()) { + for (Trigger trigger : alarmRuleConf.getTriggers()) { if (null == trigger || null == trigger.getType()) continue; try { // 接入统一数据源,查询数据信息 alarmLoadData = loadDataFactory.getLoadDataService(trigger.getType().getType()); - List dataResults = + List triggerDataResults = alarmLoadData.queryDataResult(computeTaskPackage, inspectConfig, trigger); - trigger.setDataResult(dataResults); + trigger.setDataResult(triggerDataResults); } catch (Exception exception) { LOGGER.error("{} AlarmLoadData Exception", inspectConfig.getTraceId(), exception); RecordSucOrFailNotify.alertNotifyProcessFail("alarm load data Exception: " + exception, diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmLoadData.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmLoadData.java index c8e65537e..4478c2c69 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmLoadData.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/AlarmLoadData.java @@ -4,9 +4,9 @@ package io.holoinsight.server.home.alert.service.data; import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import java.util.List; @@ -16,6 +16,6 @@ */ public interface AlarmLoadData { - List queryDataResult(ComputeTaskPackage computeTask, InspectConfig inspectConfig, - Trigger trigger); + List queryDataResult(ComputeTaskPackage computeTask, + InspectConfig inspectConfig, Trigger trigger); } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/CacheData.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/CacheData.java index e280dac76..909bc3c12 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/CacheData.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/CacheData.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.alert.service.data; -import io.holoinsight.server.home.facade.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import lombok.Data; import org.springframework.stereotype.Service; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/AIAlarmLoadData.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/AIAlarmLoadData.java index 1d1fa74ab..15a60af0f 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/AIAlarmLoadData.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/AIAlarmLoadData.java @@ -7,12 +7,12 @@ import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.alert.service.data.AlarmLoadData; import io.holoinsight.server.home.common.service.QueryClientService; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Filter; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import io.holoinsight.server.query.grpc.QueryProto; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -39,24 +39,24 @@ public class AIAlarmLoadData implements AlarmLoadData { private QueryClientService queryClientService; @Override - public List queryDataResult(ComputeTaskPackage computeTask, + public List queryDataResult(ComputeTaskPackage computeTask, InspectConfig inspectConfig, Trigger trigger) { - List dataResults = new ArrayList<>(); + List triggerDataResults = new ArrayList<>(); QueryProto.QueryResponse response = queryDataCount(computeTask, inspectConfig, trigger); if (response != null) { for (QueryProto.Result result : response.getResultsList()) { - DataResult dataResult = new DataResult(); - dataResult.setMetric(result.getMetric()); - dataResult.setTags(result.getTagsMap()); + TriggerDataResult triggerDataResult = new TriggerDataResult(); + triggerDataResult.setMetric(result.getMetric()); + triggerDataResult.setTags(result.getTagsMap()); Map points = new HashMap<>(); for (QueryProto.Point point : result.getPointsList()) { points.put(point.getTimestamp(), point.getValue()); } - dataResult.setPoints(points); - dataResults.add(dataResult); + triggerDataResult.setPoints(points); + triggerDataResults.add(triggerDataResult); } } - return dataResults; + return triggerDataResults; } private QueryProto.QueryResponse queryDataCount(ComputeTaskPackage computeTask, diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/PqlAlarmLoadData.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/PqlAlarmLoadData.java index 723e39a12..96d2e4aba 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/PqlAlarmLoadData.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/PqlAlarmLoadData.java @@ -6,9 +6,9 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.common.service.QueryClientService; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.emuns.PeriodType; import io.holoinsight.server.query.grpc.QueryProto; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,9 +33,9 @@ public class PqlAlarmLoadData { @Resource private QueryClientService queryClientService; - public List queryDataResult(ComputeTaskPackage computeTask, + public List queryDataResult(ComputeTaskPackage computeTask, InspectConfig inspectConfig) { - List dataResults = new ArrayList<>(); + List triggerDataResults = new ArrayList<>(); QueryProto.PqlRangeRequest pqlRangeRequest = QueryProto.PqlRangeRequest.newBuilder() .setTenant(inspectConfig.getTenant()).setStart(computeTask.getTimestamp()) .setEnd(computeTask.getTimestamp() + 1L * PeriodType.MINUTE.intervalMillis() - 1L) @@ -44,21 +44,21 @@ public List queryDataResult(ComputeTaskPackage computeTask, QueryProto.QueryResponse response = queryClientService.queryPqlRange(pqlRangeRequest); if (response != null) { for (QueryProto.Result result : response.getResultsList()) { - DataResult dataResult = new DataResult(); - dataResult.setMetric(result.getMetric()); - dataResult.setTags(result.getTagsMap()); + TriggerDataResult triggerDataResult = new TriggerDataResult(); + triggerDataResult.setMetric(result.getMetric()); + triggerDataResult.setTags(result.getTagsMap()); Map points = new HashMap<>(); for (QueryProto.Point point : result.getPointsList()) { Double value = Double.valueOf(point.getStrValue()); points.put(point.getTimestamp(), value); } - dataResult.setPoints(points); - dataResults.add(dataResult); + triggerDataResult.setPoints(points); + triggerDataResults.add(triggerDataResult); } } LOGGER.info("query pql result from {} {} {}", computeTask.getTimestamp(), - inspectConfig.getPqlRule().getPql(), J.toJson(dataResults)); - return dataResults; + inspectConfig.getPqlRule().getPql(), J.toJson(triggerDataResults)); + return triggerDataResults; } } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/RuleAlarmLoadData.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/RuleAlarmLoadData.java index 6967828e3..d1c3b2b48 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/RuleAlarmLoadData.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/data/load/RuleAlarmLoadData.java @@ -7,12 +7,12 @@ import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.alert.service.data.AlarmLoadData; import io.holoinsight.server.home.common.service.QueryClientService; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Filter; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import io.holoinsight.server.query.grpc.QueryProto; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -39,9 +39,9 @@ public class RuleAlarmLoadData implements AlarmLoadData { private QueryClientService queryClientService; @Override - public List queryDataResult(ComputeTaskPackage computeTask, + public List queryDataResult(ComputeTaskPackage computeTask, InspectConfig inspectConfig, Trigger trigger) { - List dataResults = new ArrayList<>(); + List triggerDataResults = new ArrayList<>(); QueryProto.QueryResponse response = null; QueryProto.QueryRequest request = null; QueryProto.QueryRequest deltaRequest = null; @@ -50,13 +50,13 @@ public List queryDataResult(ComputeTaskPackage computeTask, request = buildRequest(computeTask.getTimestamp(), inspectConfig.getTenant(), trigger); LOGGER.debug("{} alert query request {}", inspectConfig.getTraceId(), request.toString()); response = queryClientService.queryData(request, "ALERT"); - dataResults = merge(dataResults, response); + triggerDataResults = merge(triggerDataResults, response); long deltaTimestamp = getDeltaTimestamp(trigger.getPeriodType()); if (deltaTimestamp > 0) { deltaRequest = buildRequest(computeTask.getTimestamp() - deltaTimestamp, inspectConfig.getTenant(), trigger); deltaResponse = queryClientService.queryData(deltaRequest, "ALERT"); - dataResults = merge(dataResults, deltaResponse); + triggerDataResults = merge(triggerDataResults, deltaResponse); } } catch (Exception exception) { LOGGER.error( @@ -64,7 +64,7 @@ public List queryDataResult(ComputeTaskPackage computeTask, inspectConfig.getTraceId(), G.get().toJson(request), G.get().toJson(response), G.get().toJson(deltaRequest), G.get().toJson(deltaResponse), exception); } - return dataResults; + return triggerDataResults; } private long getDeltaTimestamp(PeriodType periodType) { @@ -75,25 +75,25 @@ private long getDeltaTimestamp(PeriodType periodType) { } } - protected List merge(List dataResults, + protected List merge(List triggerDataResults, QueryProto.QueryResponse response) { - Map map = new HashMap<>(); - if (!CollectionUtils.isEmpty(dataResults)) { - for (DataResult dataResult : dataResults) { - map.put(dataResult.getKey(), dataResult); + Map map = new HashMap<>(); + if (!CollectionUtils.isEmpty(triggerDataResults)) { + for (TriggerDataResult triggerDataResult : triggerDataResults) { + map.put(triggerDataResult.getKey(), triggerDataResult); } } if (response != null && !CollectionUtils.isEmpty(response.getResultsList())) { for (QueryProto.Result result : response.getResultsList()) { - DataResult key = new DataResult(); + TriggerDataResult key = new TriggerDataResult(); key.setMetric(result.getMetric()); key.setTags(result.getTagsMap()); - DataResult dataResult = map.computeIfAbsent(key.getKey(), k -> key); - if (dataResult.getPoints() == null) { - dataResult.setPoints(new HashMap<>()); + TriggerDataResult triggerDataResult = map.computeIfAbsent(key.getKey(), k -> key); + if (triggerDataResult.getPoints() == null) { + triggerDataResult.setPoints(new HashMap<>()); } for (QueryProto.Point point : result.getPointsList()) { - dataResult.getPoints().put(point.getTimestamp(), point.getValue()); + triggerDataResult.getPoints().put(point.getTimestamp(), point.getValue()); } } } diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/RecordSucOrFailNotify.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/RecordSucOrFailNotify.java index 463bd0fc5..c8f935aaa 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/RecordSucOrFailNotify.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/RecordSucOrFailNotify.java @@ -7,15 +7,15 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.biz.common.MetaDictUtil; -import io.holoinsight.server.home.biz.service.AlertNotifyRecordService; +import io.holoinsight.server.common.service.AlertNotifyRecordService; import io.holoinsight.server.home.common.service.SpringContext; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.NotifyErrorMsg; -import io.holoinsight.server.home.facade.NotifyStage; -import io.holoinsight.server.home.facade.NotifyUser; -import io.holoinsight.server.home.facade.Steps; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.NotifyErrorMsg; +import io.holoinsight.server.common.dao.entity.dto.alarm.NotifyStage; +import io.holoinsight.server.common.dao.entity.dto.alarm.NotifyUser; +import io.holoinsight.server.common.dao.entity.dto.alarm.Steps; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerBuildMsgHandler.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerBuildMsgHandler.java index 89dfc4918..a4da2ea5b 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerBuildMsgHandler.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerBuildMsgHandler.java @@ -12,8 +12,8 @@ import io.holoinsight.server.home.alert.model.event.ElementSpiEnum; import io.holoinsight.server.home.alert.service.event.AlertHandlerExecutor; import io.holoinsight.server.home.alert.service.event.element.ElementSpiServiceFactory; -import io.holoinsight.server.home.common.exception.HoloinsightAlertInternalException; -import io.holoinsight.server.home.facade.TemplateValue; +import io.holoinsight.server.common.model.HoloinsightAlertInternalException; +import io.holoinsight.server.common.dao.entity.dto.alarm.TemplateValue; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerSaveHistoryHandler.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerSaveHistoryHandler.java index 4260989c0..47bf4acb2 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerSaveHistoryHandler.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/event/alertManagerEvent/AlertManagerSaveHistoryHandler.java @@ -6,8 +6,8 @@ import io.holoinsight.server.home.alert.common.G; import io.holoinsight.server.home.alert.model.event.AlertNotify; import io.holoinsight.server.home.alert.service.event.AlertHandlerExecutor; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryMapper; -import io.holoinsight.server.home.dal.model.AlarmHistory; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryMapper; +import io.holoinsight.server.common.dao.entity.AlarmHistory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/AlertTaskScheduler.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/AlertTaskScheduler.java index f03859224..680ffadf1 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/AlertTaskScheduler.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/AlertTaskScheduler.java @@ -6,10 +6,10 @@ import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.alert.service.calculate.AlertTaskCompute; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; -import io.holoinsight.server.home.common.exception.HoloinsightAlertInternalException; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.emuns.PeriodType; +import io.holoinsight.server.common.model.HoloinsightAlertInternalException; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; +import io.holoinsight.server.common.dao.emuns.PeriodType; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.quartz.CronScheduleBuilder; import org.quartz.CronTrigger; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/CacheAlertTask.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/CacheAlertTask.java index 8e455390c..caa6b2d5a 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/CacheAlertTask.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/CacheAlertTask.java @@ -5,16 +5,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.holoinsight.server.common.dao.entity.MetricInfo; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import io.holoinsight.server.common.dao.mapper.MetricInfoMapper; import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.alert.service.converter.DoConvert; import io.holoinsight.server.home.alert.service.data.CacheData; import io.holoinsight.server.home.alert.service.event.RecordSucOrFailNotify; -import io.holoinsight.server.home.dal.mapper.AlarmRuleMapper; -import io.holoinsight.server.home.dal.model.AlarmRule; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.InspectConfig; -import io.holoinsight.server.home.facade.NotifyStage; +import io.holoinsight.server.common.dao.mapper.AlarmRuleMapper; +import io.holoinsight.server.common.dao.entity.AlarmRule; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.NotifyStage; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/coordinator/OrderMap.java b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/coordinator/OrderMap.java index 2bd49ce43..d73635dea 100644 --- a/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/coordinator/OrderMap.java +++ b/server/home/home-alert/src/main/java/io/holoinsight/server/home/alert/service/task/coordinator/OrderMap.java @@ -7,7 +7,7 @@ import io.holoinsight.server.common.DateUtil; import io.holoinsight.server.common.J; import io.holoinsight.server.home.alert.service.task.coordinator.client.Client; -import io.holoinsight.server.home.facade.emuns.PeriodType; +import io.holoinsight.server.common.dao.emuns.PeriodType; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import lombok.Data; diff --git a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskComputeTest.java b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskComputeTest.java index b77a5b652..fe5efb93a 100644 --- a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskComputeTest.java +++ b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/AlertTaskComputeTest.java @@ -5,9 +5,9 @@ import io.holoinsight.server.home.alert.model.compute.ComputeTaskPackage; import io.holoinsight.server.home.alert.model.event.EventInfo; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryMapper; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.InspectConfig; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryMapper; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.InspectConfig; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; diff --git a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/CurrentTest.java b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/CurrentTest.java index 730a3dede..a7428af61 100644 --- a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/CurrentTest.java +++ b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/CurrentTest.java @@ -5,10 +5,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.junit.Assert; import org.junit.Test; @@ -24,13 +24,13 @@ public class CurrentTest { @Test public void testZeroFill() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 0d); points.put(1678079400000L, 0d); points.put(1678079460000L, 0d); points.put(1678079580000L, 0d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(0d); @@ -43,24 +43,24 @@ public void testZeroFill() { functionConfigParam.setCmp(Arrays.asList(compareParam)); Current current = new Current(); - TriggerResult triggerResult = current.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = current.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); functionConfigParam.setZeroFill(true); - triggerResult = current.invoke(dataResult, functionConfigParam); + triggerResult = current.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); } @Test public void testHit() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); points.put(1678079460000L, 14d); points.put(1678079520000L, 14d); points.put(1678079580000L, 10d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(10d); @@ -72,20 +72,20 @@ public void testHit() { functionConfigParam.setCmp(Arrays.asList(compareParam)); Current current = new Current(); - TriggerResult triggerResult = current.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = current.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); } @Test public void testMiss() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); points.put(1678079460000L, 14d); points.put(1678079520000L, 1d); points.put(1678079580000L, 10d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(10d); @@ -97,7 +97,7 @@ public void testMiss() { functionConfigParam.setCmp(Arrays.asList(compareParam)); Current current = new Current(); - TriggerResult triggerResult = current.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = current.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); } } diff --git a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbsTest.java b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbsTest.java index 01d65e048..c06c26164 100644 --- a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbsTest.java +++ b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodAbsTest.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.junit.Assert; import org.junit.Test; @@ -15,8 +15,8 @@ import java.util.LinkedHashMap; import java.util.Map; -import static io.holoinsight.server.home.facade.emuns.PeriodType.HOUR; -import static io.holoinsight.server.home.facade.emuns.PeriodType.WEEK; +import static io.holoinsight.server.common.dao.emuns.PeriodType.HOUR; +import static io.holoinsight.server.common.dao.emuns.PeriodType.WEEK; /** * @author masaimu @@ -26,7 +26,7 @@ public class PeriodAbsTest { @Test public void testHit() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); @@ -39,7 +39,7 @@ public void testHit() { points.put(1678079460000L - HOUR.intervalMillis(), 140d); points.put(1678079520000L - HOUR.intervalMillis(), 140d); points.put(1678079580000L - HOUR.intervalMillis(), 100d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(50d); @@ -52,13 +52,13 @@ public void testHit() { functionConfigParam.setPeriodType(HOUR); PeriodAbs periodAbs = new PeriodAbs(); - TriggerResult triggerResult = periodAbs.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodAbs.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); } @Test public void testMiss() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); @@ -71,7 +71,7 @@ public void testMiss() { points.put(1678079460000L - WEEK.intervalMillis(), 140d); points.put(1678079520000L - WEEK.intervalMillis(), 140d); points.put(1678079580000L - WEEK.intervalMillis(), 150d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(100d); @@ -84,13 +84,13 @@ public void testMiss() { functionConfigParam.setPeriodType(WEEK); PeriodAbs periodAbs = new PeriodAbs(); - TriggerResult triggerResult = periodAbs.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodAbs.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); } @Test public void testZeroFill() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); @@ -102,7 +102,7 @@ public void testZeroFill() { points.put(1678079460000L - HOUR.intervalMillis(), 140d); points.put(1678079520000L - HOUR.intervalMillis(), 140d); points.put(1678079580000L - HOUR.intervalMillis(), 100d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(50d); @@ -116,11 +116,11 @@ public void testZeroFill() { functionConfigParam.setZeroFill(true); PeriodAbs periodAbs = new PeriodAbs(); - TriggerResult triggerResult = periodAbs.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodAbs.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); functionConfigParam.setZeroFill(false); - triggerResult = periodAbs.invoke(dataResult, functionConfigParam); + triggerResult = periodAbs.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); } diff --git a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodRateTest.java b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodRateTest.java index 2710b65cd..742139a84 100644 --- a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodRateTest.java +++ b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodRateTest.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.junit.Assert; import org.junit.Test; @@ -15,8 +15,7 @@ import java.util.LinkedHashMap; import java.util.Map; -import static io.holoinsight.server.home.facade.emuns.PeriodType.MINUTE; -import static io.holoinsight.server.home.facade.emuns.PeriodType.QUARTER_HOUR; +import static io.holoinsight.server.common.dao.emuns.PeriodType.QUARTER_HOUR; /** * @author masaimu @@ -26,7 +25,7 @@ public class PeriodRateTest { @Test public void testHit() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L - QUARTER_HOUR.intervalMillis(), 11d); points.put(1678079400000L - QUARTER_HOUR.intervalMillis(), 13d); @@ -39,7 +38,7 @@ public void testHit() { points.put(1678079460000L, 24d); points.put(1678079520000L, 24d); points.put(1678079580000L, 15d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(50d); @@ -52,13 +51,13 @@ public void testHit() { functionConfigParam.setPeriodType(QUARTER_HOUR); PeriodRate periodRate = new PeriodRate(); - TriggerResult triggerResult = periodRate.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodRate.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); } @Test public void testMiss() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L - QUARTER_HOUR.intervalMillis(), 11d); points.put(1678079400000L - QUARTER_HOUR.intervalMillis(), 13d); @@ -71,7 +70,7 @@ public void testMiss() { points.put(1678079460000L, 24d); points.put(1678079520000L, 24d); points.put(1678079580000L, 15d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(20d); @@ -84,13 +83,13 @@ public void testMiss() { functionConfigParam.setPeriodType(QUARTER_HOUR); PeriodRate periodRate = new PeriodRate(); - TriggerResult triggerResult = periodRate.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodRate.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); } @Test public void testZeroFill() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L - QUARTER_HOUR.intervalMillis(), 11d); points.put(1678079400000L - QUARTER_HOUR.intervalMillis(), 13d); @@ -102,7 +101,7 @@ public void testZeroFill() { points.put(1678079460000L, 24d); points.put(1678079520000L, 24d); points.put(1678079580000L, 15d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(50d); @@ -116,15 +115,15 @@ public void testZeroFill() { functionConfigParam.setZeroFill(true); PeriodRate periodRate = new PeriodRate(); - TriggerResult triggerResult = periodRate.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodRate.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); functionConfigParam.setZeroFill(false); - triggerResult = periodRate.invoke(dataResult, functionConfigParam); + triggerResult = periodRate.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); functionConfigParam.setDuration(1); - triggerResult = periodRate.invoke(dataResult, functionConfigParam); + triggerResult = periodRate.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); } } diff --git a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodValueTest.java b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodValueTest.java index edd58f266..4228ccd29 100644 --- a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodValueTest.java +++ b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/calculate/PeriodValueTest.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.alert.service.calculate; import io.holoinsight.server.home.alert.model.function.FunctionConfigParam; -import io.holoinsight.server.home.facade.DataResult; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.TriggerResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerDataResult; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.TriggerResult; import org.junit.Assert; import org.junit.Test; @@ -15,8 +15,8 @@ import java.util.LinkedHashMap; import java.util.Map; -import static io.holoinsight.server.home.facade.emuns.PeriodType.HOUR; -import static io.holoinsight.server.home.facade.emuns.PeriodType.WEEK; +import static io.holoinsight.server.common.dao.emuns.PeriodType.HOUR; +import static io.holoinsight.server.common.dao.emuns.PeriodType.WEEK; /** * @author masaimu @@ -26,7 +26,7 @@ public class PeriodValueTest { @Test public void testHit() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); @@ -39,7 +39,7 @@ public void testHit() { points.put(1678079460000L - HOUR.intervalMillis(), 140d); points.put(1678079520000L - HOUR.intervalMillis(), 140d); points.put(1678079580000L - HOUR.intervalMillis(), 100d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(-50d); @@ -52,13 +52,13 @@ public void testHit() { functionConfigParam.setPeriodType(HOUR); PeriodValue periodValue = new PeriodValue(); - TriggerResult triggerResult = periodValue.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodValue.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); } @Test public void testMiss() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); @@ -71,7 +71,7 @@ public void testMiss() { points.put(1678079460000L - WEEK.intervalMillis(), 140d); points.put(1678079520000L - WEEK.intervalMillis(), 140d); points.put(1678079580000L - WEEK.intervalMillis(), 150d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(-100d); @@ -84,13 +84,13 @@ public void testMiss() { functionConfigParam.setPeriodType(WEEK); PeriodValue periodValue = new PeriodValue(); - TriggerResult triggerResult = periodValue.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodValue.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); } @Test public void testZeroFill() { - DataResult dataResult = new DataResult(); + TriggerDataResult triggerDataResult = new TriggerDataResult(); Map points = new LinkedHashMap<>(); points.put(1678079340000L, 11d); points.put(1678079400000L, 13d); @@ -102,7 +102,7 @@ public void testZeroFill() { points.put(1678079460000L - HOUR.intervalMillis(), 140d); points.put(1678079520000L - HOUR.intervalMillis(), 140d); points.put(1678079580000L - HOUR.intervalMillis(), 100d); - dataResult.setPoints(points); + triggerDataResult.setPoints(points); CompareParam compareParam = new CompareParam(); compareParam.setCmpValue(-50d); @@ -116,11 +116,11 @@ public void testZeroFill() { functionConfigParam.setZeroFill(true); PeriodValue periodValue = new PeriodValue(); - TriggerResult triggerResult = periodValue.invoke(dataResult, functionConfigParam); + TriggerResult triggerResult = periodValue.invoke(triggerDataResult, functionConfigParam); Assert.assertTrue(triggerResult.isHit()); functionConfigParam.setZeroFill(false); - triggerResult = periodValue.invoke(dataResult, functionConfigParam); + triggerResult = periodValue.invoke(triggerDataResult, functionConfigParam); Assert.assertFalse(triggerResult.isHit()); } diff --git a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/task/CacheAlertTaskTest.java b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/task/CacheAlertTaskTest.java index f206af643..f51441ff2 100644 --- a/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/task/CacheAlertTaskTest.java +++ b/server/home/home-alert/src/test/java/io/holoinsight/server/home/alert/service/task/CacheAlertTaskTest.java @@ -5,8 +5,8 @@ package io.holoinsight.server.home.alert.service.task; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.holoinsight.server.home.dal.mapper.AlarmRuleMapper; -import io.holoinsight.server.home.dal.model.AlarmRule; +import io.holoinsight.server.common.dao.mapper.AlarmRuleMapper; +import io.holoinsight.server.common.dao.entity.AlarmRule; import org.junit.Assert; import org.junit.Test; import org.mockito.ArgumentCaptor; diff --git a/server/home/home-boot/src/main/java/io/holoinsight/server/home/bootstrap/HoloinsightHomeConfiguration.java b/server/home/home-boot/src/main/java/io/holoinsight/server/home/bootstrap/HoloinsightHomeConfiguration.java index d9b4ae464..05476f6ff 100644 --- a/server/home/home-boot/src/main/java/io/holoinsight/server/home/bootstrap/HoloinsightHomeConfiguration.java +++ b/server/home/home-boot/src/main/java/io/holoinsight/server/home/bootstrap/HoloinsightHomeConfiguration.java @@ -8,7 +8,10 @@ import io.holoinsight.server.common.ctl.ProductCtlServiceImpl; import io.holoinsight.server.common.dao.CommonDaoConfiguration; import io.holoinsight.server.common.service.AccessRecordService; -import io.holoinsight.server.common.service.CommonServiceAutoConfiguration; +import io.holoinsight.server.common.service.AlertRuleService; +import io.holoinsight.server.common.service.config.CommonServiceAutoConfiguration; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.service.impl.AlertRuleServiceImpl; import io.holoinsight.server.common.springboot.ConditionalOnRole; import io.holoinsight.server.home.alert.plugin.AlertNotifyHandler; import io.holoinsight.server.home.alert.plugin.DefaultAlertNotifyHandler; @@ -20,18 +23,15 @@ import io.holoinsight.server.home.biz.plugin.MarketplaceProductHandler; import io.holoinsight.server.home.biz.plugin.MetricInfoCheckService; import io.holoinsight.server.home.biz.plugin.MetricInfoCheckServiceImpl; -import io.holoinsight.server.home.biz.service.AlertRuleService; import io.holoinsight.server.home.biz.service.EnvironmentService; import io.holoinsight.server.home.biz.service.TenantInitService; import io.holoinsight.server.home.biz.service.UserinfoVerificationService; -import io.holoinsight.server.home.biz.service.impl.AlertRuleServiceImpl; import io.holoinsight.server.home.biz.service.impl.DefaultEnvironmentServiceImpl; import io.holoinsight.server.home.biz.service.impl.DefaultTenantInitServiceImpl; import io.holoinsight.server.home.biz.service.impl.UserinfoVerificationServiceImpl; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.service.RequestContextAdapterImpl; -import io.holoinsight.server.home.web.security.ApiSecurityService; +import io.holoinsight.server.common.service.impl.RequestContextAdapterImpl; import io.holoinsight.server.home.web.controller.TraceAgentFacadeImpl; +import io.holoinsight.server.home.web.security.ApiSecurityService; import io.holoinsight.server.home.web.security.ApiSecurityServiceImpl; import io.holoinsight.server.home.web.security.ParameterSecurityService; import io.holoinsight.server.home.web.security.ParameterSecurityServiceImpl; diff --git a/server/home/home-bootstrap/src/main/resources/log4j2-spring.xml b/server/home/home-bootstrap/src/main/resources/log4j2-spring.xml index 774a50275..5d6e4a7f4 100644 --- a/server/home/home-bootstrap/src/main/resources/log4j2-spring.xml +++ b/server/home/home-bootstrap/src/main/resources/log4j2-spring.xml @@ -219,7 +219,7 @@ - + diff --git a/server/home/home-common/pom.xml b/server/home/home-common/pom.xml index 21d22c77c..1b88238fe 100644 --- a/server/home/home-common/pom.xml +++ b/server/home/home-common/pom.xml @@ -21,11 +21,6 @@ common ${project.version} - - ${project.groupId} - home-proto - ${project.version} - com.google.code.gson gson @@ -34,14 +29,7 @@ commons-codec commons-codec - - com.squareup.retrofit2 - retrofit - - - com.squareup.retrofit2 - converter-gson - + org.apache.commons commons-lang3 @@ -77,18 +65,14 @@ ${project.version} - - com.alibaba - fastjson - + + + + org.yaml snakeyaml - - com.squareup.okhttp3 - okhttp - com.aliyun.openservices aliyun-log diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/ByteUtil.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/ByteUtil.java similarity index 99% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/ByteUtil.java rename to server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/ByteUtil.java index 0783a525a..239013761 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/ByteUtil.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/ByteUtil.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.http; +package io.holoinsight.server.home.common.http; import java.io.ByteArrayOutputStream; import java.io.InputStream; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpAsync.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpAsync.java similarity index 99% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpAsync.java rename to server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpAsync.java index 9fb09d6a6..f60a456cb 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpAsync.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpAsync.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.http; +package io.holoinsight.server.home.common.http; import lombok.Getter; import org.apache.http.Consts; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpException.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpException.java similarity index 86% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpException.java rename to server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpException.java index 2ea0fa581..d350d388f 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpException.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpException.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.http; +package io.holoinsight.server.home.common.http; public class HttpException extends Exception { diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpProxy.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpProxy.java similarity index 99% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpProxy.java rename to server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpProxy.java index 77d11fd91..ba040875a 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/HttpProxy.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/HttpProxy.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.http; +package io.holoinsight.server.home.common.http; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/Util.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/Util.java similarity index 98% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/Util.java rename to server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/Util.java index ee4ebbc87..64a22b4e1 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/Util.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/Util.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.http; +package io.holoinsight.server.home.common.http; import org.apache.commons.lang3.StringUtils; import org.apache.http.Header; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/XHttpRequest.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/XHttpRequest.java similarity index 99% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/XHttpRequest.java rename to server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/XHttpRequest.java index 7d4c48074..735ea5fa1 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/XHttpRequest.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/XHttpRequest.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.http; +package io.holoinsight.server.home.common.http; import java.io.Serializable; import java.util.Map; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/XHttpResponse.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/XHttpResponse.java similarity index 95% rename from server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/XHttpResponse.java rename to server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/XHttpResponse.java index 056334999..15551aacc 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/http/XHttpResponse.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/http/XHttpResponse.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.home.common.util.http; +package io.holoinsight.server.home.common.http; import java.io.Serializable; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/QueryClientService.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/QueryClientService.java index b56b59903..031ad3553 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/QueryClientService.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/QueryClientService.java @@ -14,6 +14,7 @@ import io.holoinsight.server.apm.common.model.query.VirtualComponent; import io.holoinsight.server.apm.common.model.specification.sw.Trace; import io.holoinsight.server.common.J; +import io.holoinsight.server.common.service.RequestContextAdapter; import io.holoinsight.server.home.common.service.query.KeyResult; import io.holoinsight.server.home.common.service.query.QueryDetailResponse; import io.holoinsight.server.home.common.service.query.QueryDetailResponse.DetailResult; @@ -21,7 +22,7 @@ import io.holoinsight.server.home.common.service.query.QuerySchemaResponse; import io.holoinsight.server.home.common.service.query.Result; import io.holoinsight.server.home.common.service.query.ValueResult; -import io.holoinsight.server.home.common.util.Debugger; +import io.holoinsight.server.common.Debugger; import io.holoinsight.server.query.common.convertor.ApmConvertor; import io.holoinsight.server.query.grpc.QueryProto; import io.holoinsight.server.query.grpc.QueryProto.Datasource; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/RegistryService.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/RegistryService.java index 69bb3ff2f..a0d193e05 100644 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/RegistryService.java +++ b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/RegistryService.java @@ -15,7 +15,7 @@ import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.holoinsight.server.common.grpc.FileNode; -import io.holoinsight.server.home.common.util.MonitorException; +import io.holoinsight.server.common.MonitorException; import io.holoinsight.server.registry.grpc.prod.InspectRequest; import io.holoinsight.server.registry.grpc.prod.InspectResponse; import io.holoinsight.server.registry.grpc.prod.ListFilesRequest; diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TableInfo.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TableInfo.java deleted file mode 100644 index ff02d9e4b..000000000 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TableInfo.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.common.service.test; - -import lombok.Data; - -import java.util.List; - -/** - * - * @author jsy1001de - * @version 1.0: TableInfo.java, v 0.1 2022年02月23日 3:31 下午 jinsong.yjs Exp $ - */ -@Data -public class TableInfo { - - private List fieldTypes; - private List fields; - private String periodType; - private String table; - private String tenant; - -} diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TestApiService.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TestApiService.java deleted file mode 100644 index d9201d8bd..000000000 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TestApiService.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.common.service.test; - -import io.holoinsight.server.common.JsonResult; - -/** - * - * @author jsy1001de - * @version 1.0: TestService.java, v 0.1 2022年02月23日 2:10 下午 jinsong.yjs Exp $ - */ -public interface TestApiService { - JsonResult createTable(TableInfo table); - - JsonResult queryTable(String name); -} diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TestService.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TestService.java deleted file mode 100644 index 7fc46cca2..000000000 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/service/test/TestService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.common.service.test; - -import io.holoinsight.server.common.JsonResult; -import retrofit2.Call; -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.POST; -import retrofit2.http.Path; - -/** - * - * @author jsy1001de - * @version 1.0: TestService.java, v 0.1 2022年02月23日 2:10 下午 jinsong.yjs Exp $ - */ -public interface TestService { - - // 定义一条接口请求 - @POST("/internal/api/meta/table") - Call> createTable(@Body TableInfo table); - - @GET("/internal/api/meta/tsd/query/{name}") - Call> queryTable(@Path("name") String name); -} diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/MonitorConstants.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/MonitorConstants.java deleted file mode 100644 index 1d5d82db3..000000000 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/MonitorConstants.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.common.util; - -/** - * - * @author jsy1001de - * @version 1.0: MonitorConstants.java, v 0.1 2022年06月08日 3:33 下午 jinsong.yjs Exp $ - */ -public interface MonitorConstants { - - - int QUERY_DEFAULT_DPS_LIMIT = 86400; - int QUERY_DEFAULT_TAGS_LIMIT = 50000; -} diff --git a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/StringUtil.java b/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/StringUtil.java deleted file mode 100644 index e1273d603..000000000 --- a/server/home/home-common/src/main/java/io/holoinsight/server/home/common/util/StringUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.common.util; - - -/** - * 有关字符串处理的工具类。 - */ -public class StringUtil { - - public static boolean isBlank(String str) { - int len; - - if ((str == null) || ((len = str.length()) == 0)) { - return true; - } - - for (int i = 0; i < len; i++) { - if (!Character.isWhitespace(str.charAt(i))) { - return false; - } - } - - return true; - } - - public static boolean isNotBlank(String str) { - int len; - - if ((str == null) || ((len = str.length()) == 0)) { - return false; - } - - for (int i = 0; i < len; i++) { - if (!Character.isWhitespace(str.charAt(i))) { - return true; - } - } - - return false; - } - - -} diff --git a/server/home/home-dal/pom.xml b/server/home/home-dal/pom.xml index e40f1b578..439df4296 100644 --- a/server/home/home-dal/pom.xml +++ b/server/home/home-dal/pom.xml @@ -28,6 +28,11 @@ org.springframework.data spring-data-commons + + com.fasterxml.jackson.module + jackson-module-jsonSchema + 2.14.2 + org.mapstruct mapstruct @@ -37,11 +42,6 @@ home-common ${project.version} - - ${project.groupId} - home-facade - ${project.version} - ${project.groupId} registry-model diff --git a/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/dto/CustomPluginDTO.java b/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/dto/CustomPluginDTO.java index e0dc95acf..b2176e4f2 100644 --- a/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/dto/CustomPluginDTO.java +++ b/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/dto/CustomPluginDTO.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.dal.model.dto; -import io.holoinsight.server.home.dal.model.AlarmMetric; +import io.holoinsight.server.common.dao.entity.AlarmMetric; import io.holoinsight.server.home.dal.model.dto.conf.CustomPluginConf; import lombok.Data; diff --git a/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/openai/AlarmRuleFc.java b/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/openai/AlarmRuleFc.java index a5b60b3e5..7ced7ef15 100644 --- a/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/openai/AlarmRuleFc.java +++ b/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/model/openai/AlarmRuleFc.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.module.jsonSchema.JsonSchema; import com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.facade.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; import lombok.Data; import java.util.Arrays; diff --git a/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/transformer/AggTaskV1ConfigMapper.java b/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/transformer/AggTaskV1ConfigMapper.java deleted file mode 100644 index 14149235a..000000000 --- a/server/home/home-dal/src/main/java/io/holoinsight/server/home/dal/transformer/AggTaskV1ConfigMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ - -package io.holoinsight.server.home.dal.transformer; - -import com.google.gson.reflect.TypeToken; -import io.holoinsight.server.agg.v1.core.conf.AggTask; -import io.holoinsight.server.common.J; - -import java.lang.reflect.Type; - -/** - * @author jsy1001de - * @version 1.0: AggTaskV1ConfigMapper.java, Date: 2023-12-06 Time: 15:44 - */ -public class AggTaskV1ConfigMapper { - public static String asString(AggTask json) { - return J.toJson(json); - } - - public static AggTask asObj(String json) { - Type t = new TypeToken() {}.getType(); - return J.fromJson(json, t); - } -} diff --git a/server/home/home-facade/pom.xml b/server/home/home-facade/pom.xml deleted file mode 100644 index 3e2f577f2..000000000 --- a/server/home/home-facade/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - 4.0.0 - - - io.holoinsight.server - server-parent - 1.0.0-SNAPSHOT - ../../server-parent/pom.xml - - - home-facade - home-facade - - - - ${project.groupId} - home-proto - ${project.version} - - - net.devh - grpc-client-spring-boot-starter - - - org.apache.commons - commons-lang3 - - - ${project.groupId} - common - ${project.version} - - - - com.fasterxml.jackson.module - jackson-module-jsonSchema - 2.14.2 - - - ${project.groupId} - home-common - ${project.version} - - - - - diff --git a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/DateUtil.java b/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/DateUtil.java deleted file mode 100644 index 12e31c0a2..000000000 --- a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/DateUtil.java +++ /dev/null @@ -1,481 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.facade; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.TimeZone; - -/** - * @author wangsiyuan - * @date 2022/3/21 7:46 下午 - */ -public class DateUtil { - public final static long ONE_DAY_SECONDS = 86400; - - private static ThreadLocal> tsf = - new ThreadLocal>(); - - public static Date addSeconds(Date date1, long secs) { - return new Date(date1.getTime() + (secs * 1000)); - } - - public static Date addMinutes(Date date1, long minute) { - return new Date(date1.getTime() + (minute * 1000 * 60)); - } - - public static Date addHours(Date date1, long hour) { - return new Date(date1.getTime() + (hour * 1000 * 3600)); - } - - public static Date addDays(Date date1, long days) { - return addSeconds(date1, days * ONE_DAY_SECONDS); - } - - /** - * 获取开始时间和结束时间之间的日期区间数组,包括头尾 - * - * @param start - * @param end - * @return - */ - public static List getDatesBetween(Date start, Date end) { - List ret = new ArrayList(); - start = setHoursToEmpty(start); - end = setHoursToEmpty(end); - while (start.getTime() <= end.getTime()) { - ret.add(start); - start = addDays(start, 1); - } - return ret; - } - - /** - * 获取开始与结束时间之间的秒数 - * - * @param start - * @param end - * @return - */ - public static int getSecondsBetween(Date start, Date end) { - int seconds = -1; - if (start != null && end != null) { - long startTime = start.getTime(); - long endTime = end.getTime(); - if (startTime <= endTime) { - return (int) ((endTime - startTime) / 1000); - } - } - return seconds; - } - - /** - * 以分钟为间隔 获取开始时间和结束时间之间的日期区间数组,包括头尾, - * - * @param start - * @param end - * @return - */ - public static List getMinutesBetween(Date start, Date end) { - List ret = new ArrayList(); - start = setSecondsToEmpty(start); - end = setSecondsToEmpty(end); - while (start.getTime() <= end.getTime()) { - ret.add(start); - start = addSeconds(start, 60); - } - return ret; - } - - /** - * 以为间隔 获取开始时间和结束时间之间的日期区间数组,包括头尾, - * - * @param start - * @param end - * @return - */ - public static List getSecondsListBetween(Date start, Date end) { - List ret = new ArrayList(); - start = setMillSecondsToEmpty(start); - end = setMillSecondsToEmpty(end); - while (start.getTime() <= end.getTime()) { - ret.add(start); - start = addSeconds(start, 1); - } - return ret; - } - - /** - * 定位到一天的最后一毫秒 - */ - public static Date getEndOfThisDay(Date date) { - long time = setHoursToEmpty(date).getTime(); - return new Date(time + 24 * 3600 * 1000 - 1); - } - - public static long setSecondsToEmpty(long timestamp) { - return timestamp / 60000 * 60000; - } - - public static Date setSecondsToEmpty(Date date) { - return new Date(date.getTime() / (60000) * (60000)); - } - - public static Date setMillSecondsToEmpty(Date date) { - return new Date(date.getTime() / (1000) * (1000)); - } - - public static Date setSecondsToEnd(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - - calendar.set(Calendar.SECOND, 59); - calendar.set(Calendar.MILLISECOND, 0); - return calendar.getTime(); - } - - public static Date setMinutesToEmpty(Date date) { - return new Date(date.getTime() / (3600000) * (3600000)); - } - - // 这个方法实际上是得到一天的开始时间 - public static Date setHoursToEmpty(Date date) { - Calendar calendar = Calendar.getInstance(); - int timeTypes[] = - {Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND, Calendar.MILLISECOND}; - calendar.setTime(date); - for (int i = 0; i < timeTypes.length; i++) { - calendar.set(timeTypes[i], 0); - } - return calendar.getTime(); - } - - /** - * 计算start到end之间的天 包括start和end - * - * @param start - * @param end - * @return - */ - public static List getDays(Date start, Date end) { - List dates = new ArrayList(); - Calendar calendar = Calendar.getInstance(); - int timeTypes[] = - {Calendar.MILLISECOND, Calendar.SECOND, Calendar.MINUTE, Calendar.HOUR_OF_DAY}; - calendar.setTime(start); - for (int i = 0; i < timeTypes.length; i++) { - calendar.set(timeTypes[i], 0); - } - start = calendar.getTime(); - while (start.getTime() <= end.getTime()) { - dates.add(start); - start = DateUtil.addDays(start, 1); - } - return dates; - } - - /** - * 计算start到end之间的小时 包括start和end - * - * @param start - * @param end - * @return - */ - public static List getHours(Date start, Date end) { - List dates = new ArrayList(); - start = setMinutesToEmpty(start); - while (start.getTime() <= end.getTime()) { - dates.add(start); - start = addHours(start, 1); - } - return dates; - } - - /** - * 计算start到end之间分钟,包括端点 - * - * @param start - * @param end - * @return - */ - public static List getMinutes(Date start, Date end) { - List dates = new ArrayList(); - start = setSecondsToEmpty(start); - while (start.getTime() <= end.getTime()) { - dates.add(start); - start = DateUtil.addMinutes(start, 1); - } - return dates; - } - - /** - * 获取本线程下对应的format zone使用默认配置 - */ - public static DateFormat getFormatFromThreadLocal(String format) { - return getFormatFromThreadLocal(format, null); - } - - /** - * 获取本线程下对应的format 使用指定的timeZone,如中国地区的"GMT+8:00" - */ - public static DateFormat getFormatFromThreadLocal(String format, String zoneId) { - Map lf = tsf.get(); - if (lf == null) { - lf = new HashMap(); - tsf.set(lf); - } - DateFormat df = lf.get(format + zoneId); - if (df == null) { - df = new SimpleDateFormat(format, Locale.US); - if (zoneId != null) { - df.setTimeZone(TimeZone.getTimeZone(zoneId)); - } - lf.put(format + zoneId, df); - } - return df; - } - - public static String getDate(Date date, String format) { - DateFormat df = getFormatFromThreadLocal(format); - return df.format(date); - } - - /** - * 对传入的日期进行格式化 - * - * @param date - * @return - */ - public static String getDateOf_YYMMDD(Date date) { - return getDate(date, "yyyy-MM-dd"); - } - - public static String getDateOf_HH(Date date) { - return getDate(date, "HH"); - } - - public static String getDateOf_MMDD_HHMM(Date date) { - return getDate(date, "MM-dd HH:mm"); - } - - public static String getDateOf_MMDD(Date date) { - return getDate(date, "MM-dd"); - } - - public static String getDateOf_YYMMDD_HHMMSS(Date date) { - return getDate(date, "yyyy-MM-dd HH:mm:ss"); - } - - public static String getDateOf_YYMMDD_Plus_HHMMSS(Date date) { - return getDate(date, "yyyy-MM-dd+HH:mm:ss"); - } - - public static String getDateOf_HHMM(Date date) { - return getDate(date, "HH:mm"); - } - - public static String getDateOf_HHMMSS(Date date) { - return getDate(date, "HH:mm:ss"); - } - - public static String getDateOf_MMSS(Date date) { - return getDate(date, "mm:ss"); - } - - public static String getDateOf_YYMMDD_HHMM(Date date) { - return getDate(date, "yyyy-MM-dd HH:mm"); - } - - public static String getDateOf_YYYYMMDDHHMM(Date date) { - return getDate(date, "yyyyMMddHHmm"); - } - - /** - * 返回"2011-11-11 11:11:11,123" - * - * @param date - * @return - */ - public static String getDateOf_YYMMDD_HHMMSSMS(Date date) { - return getDate(date, "yyyy-MM-dd HH:mm:ss,SSS"); - } - - /** - * 获得当前的分钟数 - * - * @param date - * @return - */ - public static int getMinute(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.MINUTE); - } - - public static int getHour(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.HOUR_OF_DAY); - } - - public static int getDayOfMonth(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.DAY_OF_MONTH); - } - - public static int getDayOfWeek(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.DAY_OF_WEEK); - } - - public static int getMonth(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.MONTH); - } - - public static int getYear(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.YEAR); - } - - public static Date getYesterday() { - return getDateByGivenHour(new Date(), -24); - // return addSeconds(new Date(), -1); - } - - /** - * 返回从给定日期相差小时的date - * - * @param givenDate 给定的日期 - * @param numOfHour 与给定日期相差的小时数,可以是负数 - * @return 日期 - */ - public static Date getDateByGivenHour(Date givenDate, int numOfHour) { - long givenDateStamp = givenDate.getTime(); - long resultDateStamp = givenDateStamp + numOfHour * 3600000; - return new Date(resultDateStamp); - } - - public static Date setMinute(Date date, int minute) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - calendar.set(Calendar.MINUTE, minute); - return calendar.getTime(); - } - - /** - * 获得当前的分钟数 - * - * @param date - * @return - */ - public static int getSecond(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.SECOND); - } - - public static Date parseDate(String date, String format) throws ParseException { - DateFormat df = getFormatFromThreadLocal(format); - return df.parse(date); - } - - public static Date parseDate(String date, String format, String zoneId) throws ParseException { - DateFormat df = getFormatFromThreadLocal(format, zoneId); - return df.parse(date); - } - - /** - * 对传入的格式化字符串反解出日期 - * - * @param date "2011-11-11" - * @return - * @throws ParseException - */ - public static Date parseDateOf_YYMMDD(String date) throws ParseException { - return parseDate(date, "yyyy-MM-dd"); - } - - /** - * 对传入的格式化字符串反解出日期 - * - * @param date "2011-11-11 11" - * @return - * @throws ParseException - */ - public static Date parseDateOf_YYMMDD_HH(String date) throws ParseException { - return parseDate(date, "yyyy-MM-dd HH"); - } - - /** - * 对传入的格式化字符串反解出日期 - * - * @param date "2011-11-11 11:11" - * @return - */ - public static Date parseDateOf_YYMMDD_HHMM(String date) throws ParseException { - return parseDate(date, "yyyy-MM-dd HH:mm"); - } - - /** - * 对传入的格式化字符串反解出日期 - * - * @param date "2011-11-11 11:11:11" - * @return - */ - public static Date parseDateOf_YYMMDD_HHMMSS(String date) throws ParseException { - return parseDate(date, "yyyy-MM-dd HH:mm:ss"); - } - - /** - * 返回long型时间的字符串 - * - * @param date - * @return - */ - public static String getDateTime(Date date) { - return date.getTime() + ""; - } - - /** - * 对传入的日期字符串翻译为时间 - * - * @param date - * @return - * @throws ParseException - * @throws ParseException - */ - public static Date parseDateOf_YYMMDD_HHMMORTime(String date) throws ParseException { - if (date.indexOf("-") < 0) { - // 认为是time数字 - long time = Long.parseLong(date); - return new Date(time); - } - return parseDateOf_YYMMDD_HHMM(date); - } - - /** - * 获得当前是今天的第几分钟 - * - * @param date - * @return - */ - public static int getMinutesPresentation(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - return calendar.get(Calendar.HOUR_OF_DAY) * 60 + calendar.get(Calendar.MINUTE); - } -} diff --git a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/utils/ParaCheckUtil.java b/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/utils/ParaCheckUtil.java deleted file mode 100644 index 02fd202bd..000000000 --- a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/utils/ParaCheckUtil.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.facade.utils; - -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import org.apache.commons.lang3.StringUtils; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Parameter checker - * - * @author jsy1001de - * @version 1.0: ParaCheckUtil.java, v 0.1 2022-03-15 13:14 - */ -public class ParaCheckUtil { - - private static Pattern PATTERN_CN_SQL = - Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\u3000-\\u303f\\uFF0C\\-_ ,|:\\.]*$"); - private static Pattern PATTERN_SQL = - Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_ ,|:\\.]*$"); - private static Pattern PATTERN_STRICT_SQL = - Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_,|\\.]*$"); - - private static Pattern uniCodePattern = Pattern.compile("\\\\u[0-9a-f]{4}"); - - /** - * Check whether the boolean result is true. - */ - public static void checkParaBoolean(Boolean result, String errorMsg) { - if (!result) { - throw new MonitorException(ResultCodeEnum.PARAMETER_ILLEGAL, errorMsg); - } - } - - public static boolean sqlNameCheck(String param) { - Matcher commonAllowed = PATTERN_SQL.matcher(param); - if (commonAllowed.find()) { - if (!unicodeCheck(param)) { - return false; - } - return true; - } - return false; - } - - public static boolean sqlCnNameCheck(String param) { - Matcher commonAllowed = PATTERN_CN_SQL.matcher(param); - if (commonAllowed.find()) { - if (!unicodeCheck(param)) { - return false; - } - return true; - } - return false; - } - - public static boolean sqlFieldCheck(String param) { - Matcher commonAllowed = PATTERN_STRICT_SQL.matcher(param); - if (commonAllowed.find()) { - if (!unicodeCheck(param)) { - return false; - } - return true; - } - return false; - } - - private static boolean unicodeCheck(String param) { - // unicode encoding check - int start = 0; - Matcher uniCodeMatcher = uniCodePattern.matcher(param); - while (uniCodeMatcher.find(start)) { - start = uniCodeMatcher.end(); - String keyword = uniCodeMatcher.group(0); - if (StringUtils.isNotBlank(keyword) && keyword.startsWith("\\u")) { - String hexString = StringUtils.substring(keyword, 2); - int valueInteger = Integer.parseInt(hexString, 16); - if (valueInteger < 19968 || valueInteger > 40869) { - return false; - } - } - } - return true; - } - - public static void checkTimeRange(Long start, Long end, String errorMsg) { - if (start > end) { - throw new MonitorException(ResultCodeEnum.PARAMETER_ILLEGAL, errorMsg); - } - } -} diff --git a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/utils/SecurityMethodCategory.java b/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/utils/SecurityMethodCategory.java deleted file mode 100644 index 56027f1bc..000000000 --- a/server/home/home-facade/src/main/java/io/holoinsight/server/home/facade/utils/SecurityMethodCategory.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.facade.utils; - -/** - * @author masaimu - * @version 2023-12-06 16:46:00 - */ -public enum SecurityMethodCategory { - create, update, delete, query -} diff --git a/server/home/home-facade/src/test/java/io/holoinsight/server/home/facade/AlarmRuleDTOTest.java b/server/home/home-facade/src/test/java/io/holoinsight/server/home/facade/AlarmRuleDTOTest.java deleted file mode 100644 index 57263dcf3..000000000 --- a/server/home/home-facade/src/test/java/io/holoinsight/server/home/facade/AlarmRuleDTOTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ - -package io.holoinsight.server.home.facade; - -import io.holoinsight.server.common.J; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; -import org.apache.commons.lang3.StringUtils; -import org.junit.Assert; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static io.holoinsight.server.home.facade.AlarmRuleDTO.getApmLink; -import static org.junit.Assert.*; - -/** - * @author masaimu - * @version 2023-03-14 18:30:00 - */ -public class AlarmRuleDTOTest { - - @Test - public void testGetApmLink() { - AlarmRuleDTO alarmRuleDTO = new AlarmRuleDTO(); - alarmRuleDTO.setRule(buildRule("test_metric")); - alarmRuleDTO.setSourceType("apm_appName"); - String domain = "http://testdomain/"; - Map> systemMetrics = - new HashMap<>(); - systemMetrics.put("test_metric", Collections.singletonMap("server", "page")); - String link = getApmLink(alarmRuleDTO, domain, systemMetrics); - Assert.assertTrue(StringUtils.equals("http://testdomain/page&app=appName", link)); - - alarmRuleDTO.setRule(buildRule("fake_test_metric")); - link = getApmLink(alarmRuleDTO, domain, systemMetrics); - Assert.assertTrue(StringUtils.isEmpty(link)); - } - - private Map buildRule(String metric) { - Rule rule = new Rule(); - rule.setTriggers(Arrays.asList(new Trigger())); - Trigger trigger = rule.getTriggers().get(0); - trigger.setDatasources(Arrays.asList(new DataSource())); - DataSource dataSource = trigger.getDatasources().get(0); - dataSource.setMetric(metric); - return J.toMap(J.toJson(rule)); - } -} diff --git a/server/home/home-facade/src/test/java/io/holoinsight/server/home/facade/AlertSilenceConfigTest.java b/server/home/home-facade/src/test/java/io/holoinsight/server/home/facade/AlertSilenceConfigTest.java deleted file mode 100644 index d827b74ac..000000000 --- a/server/home/home-facade/src/test/java/io/holoinsight/server/home/facade/AlertSilenceConfigTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.facade; - -import io.holoinsight.server.home.facade.emuns.PeriodType; -import org.junit.Test; - -import java.util.Date; - -import static org.junit.Assert.*; - -/** - * @author masaimu - * @version 2023-10-23 18:02:00 - */ -public class AlertSilenceConfigTest { - - @Test - public void fixed() { - AlertSilenceConfig alertSilenceConfig = new AlertSilenceConfig(); - alertSilenceConfig.setSilenceMode("fixed"); - - long cur = PeriodType.MINUTE.rounding(System.currentTimeMillis()); - for (int i = 0; i < 50; i++) { - if (alertSilenceConfig.timeIsUp(cur)) { - alertSilenceConfig.updatePeriod(cur); - } - - if (alertSilenceConfig.needShoot(cur)) { - System.out.println(DateUtil.getDateOf_YYMMDD_HHMMSS(new Date(cur)) + " " - + alertSilenceConfig.needShoot(cur)); - } - - cur += PeriodType.MINUTE.intervalMillis(); - } - } - - @Test - public void defaulted() { - AlertSilenceConfig alertSilenceConfig = new AlertSilenceConfig(); - - long cur = PeriodType.MINUTE.rounding(System.currentTimeMillis()); - for (int i = 0; i < 50; i++) { - if (alertSilenceConfig.timeIsUp(cur)) { - alertSilenceConfig.updatePeriod(cur); - } - - if (alertSilenceConfig.needShoot(cur)) { - System.out.println(DateUtil.getDateOf_YYMMDD_HHMMSS(new Date(cur)) + " " - + alertSilenceConfig.needShoot(cur)); - } - - cur += PeriodType.MINUTE.intervalMillis(); - } - } - - @Test - public void gradual() { - AlertSilenceConfig alertSilenceConfig = new AlertSilenceConfig(); - alertSilenceConfig.setSilenceMode("gradual"); - - long cur = PeriodType.MINUTE.rounding(System.currentTimeMillis()); - for (int i = 0; i < 50; i++) { - if (alertSilenceConfig.timeIsUp(cur)) { - alertSilenceConfig.updatePeriod(cur); - } - - if (alertSilenceConfig.needShoot(cur)) { - System.out.println(DateUtil.getDateOf_YYMMDD_HHMMSS(new Date(cur)) + " " - + alertSilenceConfig.needShoot(cur)); - } - - cur += PeriodType.MINUTE.intervalMillis(); - } - } -} diff --git a/server/home/home-proto/pom.xml b/server/home/home-proto/pom.xml deleted file mode 100644 index 59b79da4d..000000000 --- a/server/home/home-proto/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - - io.holoinsight.server - server-parent - 1.0.0-SNAPSHOT - ../../server-parent/pom.xml - - - home-proto - home-proto - - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - - - - - kr.motd.maven - os-maven-plugin - 1.6.2 - - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.5.1 - - com.google.protobuf:protoc:3.4.0:exe:${os.detected.classifier} - grpc-java - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} - ${project.basedir}/src/main/proto - ${project.basedir}/src/main/java - false - ${project.build.directory}/protoc-dependencies - - *.proto - - - - - - compile - compile-custom - - - - - - - diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/BaseServiceProto.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/BaseServiceProto.java deleted file mode 100644 index 703e40042..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/BaseServiceProto.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: BaseService.proto - -package io.holoinsight.server.home.proto.base; - -public final class BaseServiceProto { - private BaseServiceProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor internal_static_DataBaseResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_DataBaseResponse_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - static { - String[] descriptorData = {"\n\021BaseService.proto\"V\n\020DataBaseResponse\022" - + "\017\n\007success\030\001 \001(\010\022\016\n\006errMsg\030\002 \001(\t\022\020\n\010rows" - + "Json\030\003 \001(\t\022\017\n\007traceId\030\004 \001(\tB=\n\'com.alipa" - + "y.cloudmonitor.prod.proto.baseB\020BaseServ" + "iceProtoP\001b\006proto3"}; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); - internal_static_DataBaseResponse_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_DataBaseResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_DataBaseResponse_descriptor, - new String[] {"Success", "ErrMsg", "RowsJson", "TraceId",}); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/DataBaseResponse.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/DataBaseResponse.java deleted file mode 100644 index 868a735a5..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/DataBaseResponse.java +++ /dev/null @@ -1,823 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: BaseService.proto - -package io.holoinsight.server.home.proto.base; - -/** - * Protobuf type {@code DataBaseResponse} - */ -public final class DataBaseResponse extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:DataBaseResponse) - DataBaseResponseOrBuilder { - private static final long serialVersionUID = 0L; - - // Use DataBaseResponse.newBuilder() to construct. - private DataBaseResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DataBaseResponse() { - success_ = false; - errMsg_ = ""; - rowsJson_ = ""; - traceId_ = ""; - } - - @Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DataBaseResponse(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 8: { - - success_ = input.readBool(); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - errMsg_ = s; - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - rowsJson_ = s; - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - traceId_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.holoinsight.server.home.proto.base.BaseServiceProto.internal_static_DataBaseResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.holoinsight.server.home.proto.base.BaseServiceProto.internal_static_DataBaseResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.holoinsight.server.home.proto.base.DataBaseResponse.class, - io.holoinsight.server.home.proto.base.DataBaseResponse.Builder.class); - } - - public static final int SUCCESS_FIELD_NUMBER = 1; - private boolean success_; - - /** - * bool success = 1; - */ - public boolean getSuccess() { - return success_; - } - - public static final int ERRMSG_FIELD_NUMBER = 2; - private volatile Object errMsg_; - - /** - * string errMsg = 2; - */ - public String getErrMsg() { - Object ref = errMsg_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - errMsg_ = s; - return s; - } - } - - /** - * string errMsg = 2; - */ - public com.google.protobuf.ByteString getErrMsgBytes() { - Object ref = errMsg_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); - errMsg_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ROWSJSON_FIELD_NUMBER = 3; - private volatile Object rowsJson_; - - /** - * string rowsJson = 3; - */ - public String getRowsJson() { - Object ref = rowsJson_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - rowsJson_ = s; - return s; - } - } - - /** - * string rowsJson = 3; - */ - public com.google.protobuf.ByteString getRowsJsonBytes() { - Object ref = rowsJson_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); - rowsJson_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TRACEID_FIELD_NUMBER = 4; - private volatile Object traceId_; - - /** - * string traceId = 4; - */ - public String getTraceId() { - Object ref = traceId_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - traceId_ = s; - return s; - } - } - - /** - * string traceId = 4; - */ - public com.google.protobuf.ByteString getTraceIdBytes() { - Object ref = traceId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); - traceId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (success_ != false) { - output.writeBool(1, success_); - } - if (!getErrMsgBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errMsg_); - } - if (!getRowsJsonBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, rowsJson_); - } - if (!getTraceIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, traceId_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (success_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, success_); - } - if (!getErrMsgBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errMsg_); - } - if (!getRowsJsonBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, rowsJson_); - } - if (!getTraceIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, traceId_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.holoinsight.server.home.proto.base.DataBaseResponse)) { - return super.equals(obj); - } - io.holoinsight.server.home.proto.base.DataBaseResponse other = - (io.holoinsight.server.home.proto.base.DataBaseResponse) obj; - - boolean result = true; - result = result && (getSuccess() == other.getSuccess()); - result = result && getErrMsg().equals(other.getErrMsg()); - result = result && getRowsJson().equals(other.getRowsJson()); - result = result && getTraceId().equals(other.getTraceId()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SUCCESS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSuccess()); - hash = (37 * hash) + ERRMSG_FIELD_NUMBER; - hash = (53 * hash) + getErrMsg().hashCode(); - hash = (37 * hash) + ROWSJSON_FIELD_NUMBER; - hash = (53 * hash) + getRowsJson().hashCode(); - hash = (37 * hash) + TRACEID_FIELD_NUMBER; - hash = (53 * hash) + getTraceId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, - extensionRegistry); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, - extensionRegistry); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, - extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - io.holoinsight.server.home.proto.base.DataBaseResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code DataBaseResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:DataBaseResponse) - io.holoinsight.server.home.proto.base.DataBaseResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.holoinsight.server.home.proto.base.BaseServiceProto.internal_static_DataBaseResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.holoinsight.server.home.proto.base.BaseServiceProto.internal_static_DataBaseResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.holoinsight.server.home.proto.base.DataBaseResponse.class, - io.holoinsight.server.home.proto.base.DataBaseResponse.Builder.class); - } - - // Construct using io.holoinsight.server.home.proto.base.DataBaseResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() {} - - public Builder clear() { - super.clear(); - success_ = false; - - errMsg_ = ""; - - rowsJson_ = ""; - - traceId_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.holoinsight.server.home.proto.base.BaseServiceProto.internal_static_DataBaseResponse_descriptor; - } - - public io.holoinsight.server.home.proto.base.DataBaseResponse getDefaultInstanceForType() { - return io.holoinsight.server.home.proto.base.DataBaseResponse.getDefaultInstance(); - } - - public io.holoinsight.server.home.proto.base.DataBaseResponse build() { - io.holoinsight.server.home.proto.base.DataBaseResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.holoinsight.server.home.proto.base.DataBaseResponse buildPartial() { - io.holoinsight.server.home.proto.base.DataBaseResponse result = - new io.holoinsight.server.home.proto.base.DataBaseResponse(this); - result.success_ = success_; - result.errMsg_ = errMsg_; - result.rowsJson_ = rowsJson_; - result.traceId_ = traceId_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.holoinsight.server.home.proto.base.DataBaseResponse) { - return mergeFrom((io.holoinsight.server.home.proto.base.DataBaseResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.holoinsight.server.home.proto.base.DataBaseResponse other) { - if (other == io.holoinsight.server.home.proto.base.DataBaseResponse.getDefaultInstance()) - return this; - if (other.getSuccess() != false) { - setSuccess(other.getSuccess()); - } - if (!other.getErrMsg().isEmpty()) { - errMsg_ = other.errMsg_; - onChanged(); - } - if (!other.getRowsJson().isEmpty()) { - rowsJson_ = other.rowsJson_; - onChanged(); - } - if (!other.getTraceId().isEmpty()) { - traceId_ = other.traceId_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - io.holoinsight.server.home.proto.base.DataBaseResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.holoinsight.server.home.proto.base.DataBaseResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean success_; - - /** - * bool success = 1; - */ - public boolean getSuccess() { - return success_; - } - - /** - * bool success = 1; - */ - public Builder setSuccess(boolean value) { - - success_ = value; - onChanged(); - return this; - } - - /** - * bool success = 1; - */ - public Builder clearSuccess() { - - success_ = false; - onChanged(); - return this; - } - - private Object errMsg_ = ""; - - /** - * string errMsg = 2; - */ - public String getErrMsg() { - Object ref = errMsg_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - errMsg_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string errMsg = 2; - */ - public com.google.protobuf.ByteString getErrMsgBytes() { - Object ref = errMsg_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - errMsg_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string errMsg = 2; - */ - public Builder setErrMsg(String value) { - if (value == null) { - throw new NullPointerException(); - } - - errMsg_ = value; - onChanged(); - return this; - } - - /** - * string errMsg = 2; - */ - public Builder clearErrMsg() { - - errMsg_ = getDefaultInstance().getErrMsg(); - onChanged(); - return this; - } - - /** - * string errMsg = 2; - */ - public Builder setErrMsgBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - errMsg_ = value; - onChanged(); - return this; - } - - private Object rowsJson_ = ""; - - /** - * string rowsJson = 3; - */ - public String getRowsJson() { - Object ref = rowsJson_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - rowsJson_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string rowsJson = 3; - */ - public com.google.protobuf.ByteString getRowsJsonBytes() { - Object ref = rowsJson_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - rowsJson_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string rowsJson = 3; - */ - public Builder setRowsJson(String value) { - if (value == null) { - throw new NullPointerException(); - } - - rowsJson_ = value; - onChanged(); - return this; - } - - /** - * string rowsJson = 3; - */ - public Builder clearRowsJson() { - - rowsJson_ = getDefaultInstance().getRowsJson(); - onChanged(); - return this; - } - - /** - * string rowsJson = 3; - */ - public Builder setRowsJsonBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - rowsJson_ = value; - onChanged(); - return this; - } - - private Object traceId_ = ""; - - /** - * string traceId = 4; - */ - public String getTraceId() { - Object ref = traceId_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - traceId_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string traceId = 4; - */ - public com.google.protobuf.ByteString getTraceIdBytes() { - Object ref = traceId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - traceId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string traceId = 4; - */ - public Builder setTraceId(String value) { - if (value == null) { - throw new NullPointerException(); - } - - traceId_ = value; - onChanged(); - return this; - } - - /** - * string traceId = 4; - */ - public Builder clearTraceId() { - - traceId_ = getDefaultInstance().getTraceId(); - onChanged(); - return this; - } - - /** - * string traceId = 4; - */ - public Builder setTraceIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - traceId_ = value; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:DataBaseResponse) - } - - // @@protoc_insertion_point(class_scope:DataBaseResponse) - private static final io.holoinsight.server.home.proto.base.DataBaseResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new io.holoinsight.server.home.proto.base.DataBaseResponse(); - } - - public static io.holoinsight.server.home.proto.base.DataBaseResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public DataBaseResponse parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DataBaseResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.holoinsight.server.home.proto.base.DataBaseResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/DataBaseResponseOrBuilder.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/DataBaseResponseOrBuilder.java deleted file mode 100644 index 0ef95d457..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/base/DataBaseResponseOrBuilder.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: BaseService.proto - -package io.holoinsight.server.home.proto.base; - -public interface DataBaseResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:DataBaseResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * bool success = 1; - */ - boolean getSuccess(); - - /** - * string errMsg = 2; - */ - String getErrMsg(); - - /** - * string errMsg = 2; - */ - com.google.protobuf.ByteString getErrMsgBytes(); - - /** - * string rowsJson = 3; - */ - String getRowsJson(); - - /** - * string rowsJson = 3; - */ - com.google.protobuf.ByteString getRowsJsonBytes(); - - /** - * string traceId = 4; - */ - String getTraceId(); - - /** - * string traceId = 4; - */ - com.google.protobuf.ByteString getTraceIdBytes(); -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloRequest.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloRequest.java deleted file mode 100644 index e8f899835..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloRequest.java +++ /dev/null @@ -1,1012 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: HiService.proto - -package io.holoinsight.server.home.proto.hello; - -/** - * Protobuf type {@code scheduler.HelloRequest} - */ -public final class HelloRequest extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:scheduler.HelloRequest) - HelloRequestOrBuilder { - private static final long serialVersionUID = 0L; - - // Use HelloRequest.newBuilder() to construct. - private HelloRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private HelloRequest() { - name_ = ""; - age_ = 0; - hobbies_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private HelloRequest(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: { - - age_ = input.readInt32(); - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - hobbies_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - hobbies_.add(s); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000008; - } - com.google.protobuf.MapEntry tags__ = input.readMessage( - TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - tags_.getMutableMap().put(tags__.getKey(), tags__.getValue()); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - hobbies_ = hobbies_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloRequest_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetTags(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized(io.holoinsight.server.home.proto.hello.HelloRequest.class, - io.holoinsight.server.home.proto.hello.HelloRequest.Builder.class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int AGE_FIELD_NUMBER = 2; - private int age_; - - /** - * int32 age = 2; - */ - public int getAge() { - return age_; - } - - public static final int HOBBIES_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList hobbies_; - - /** - * repeated string hobbies = 3; - */ - public com.google.protobuf.ProtocolStringList getHobbiesList() { - return hobbies_; - } - - /** - * repeated string hobbies = 3; - */ - public int getHobbiesCount() { - return hobbies_.size(); - } - - /** - * repeated string hobbies = 3; - */ - public String getHobbies(int index) { - return hobbies_.get(index); - } - - /** - * repeated string hobbies = 3; - */ - public com.google.protobuf.ByteString getHobbiesBytes(int index) { - return hobbies_.getByteString(index); - } - - public static final int TAGS_FIELD_NUMBER = 4; - - private static final class TagsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloRequest_TagsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, "", - com.google.protobuf.WireFormat.FieldType.STRING, ""); - } - - private com.google.protobuf.MapField tags_; - - private com.google.protobuf.MapField internalGetTags() { - if (tags_ == null) { - return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); - } - return tags_; - } - - public int getTagsCount() { - return internalGetTags().getMap().size(); - } - - /** - * map<string, string> tags = 4; - */ - - public boolean containsTags(String key) { - if (key == null) { - throw new NullPointerException(); - } - return internalGetTags().getMap().containsKey(key); - } - - /** - * Use {@link #getTagsMap()} instead. - */ - @Deprecated - public java.util.Map getTags() { - return getTagsMap(); - } - - /** - * map<string, string> tags = 4; - */ - - public java.util.Map getTagsMap() { - return internalGetTags().getMap(); - } - - /** - * map<string, string> tags = 4; - */ - - public String getTagsOrDefault(String key, String defaultValue) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = internalGetTags().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - - /** - * map<string, string> tags = 4; - */ - - public String getTagsOrThrow(String key) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = internalGetTags().getMap(); - if (!map.containsKey(key)) { - throw new IllegalArgumentException(); - } - return map.get(key); - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (age_ != 0) { - output.writeInt32(2, age_); - } - for (int i = 0; i < hobbies_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, hobbies_.getRaw(i)); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(output, internalGetTags(), - TagsDefaultEntryHolder.defaultEntry, 4); - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (age_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, age_); - } - { - int dataSize = 0; - for (int i = 0; i < hobbies_.size(); i++) { - dataSize += computeStringSizeNoTag(hobbies_.getRaw(i)); - } - size += dataSize; - size += 1 * getHobbiesList().size(); - } - for (java.util.Map.Entry entry : internalGetTags().getMap().entrySet()) { - com.google.protobuf.MapEntry tags__ = TagsDefaultEntryHolder.defaultEntry - .newBuilderForType().setKey(entry.getKey()).setValue(entry.getValue()).build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, tags__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.holoinsight.server.home.proto.hello.HelloRequest)) { - return super.equals(obj); - } - io.holoinsight.server.home.proto.hello.HelloRequest other = - (io.holoinsight.server.home.proto.hello.HelloRequest) obj; - - boolean result = true; - result = result && getName().equals(other.getName()); - result = result && (getAge() == other.getAge()); - result = result && getHobbiesList().equals(other.getHobbiesList()); - result = result && internalGetTags().equals(other.internalGetTags()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + AGE_FIELD_NUMBER; - hash = (53 * hash) + getAge(); - if (getHobbiesCount() > 0) { - hash = (37 * hash) + HOBBIES_FIELD_NUMBER; - hash = (53 * hash) + getHobbiesList().hashCode(); - } - if (!internalGetTags().getMap().isEmpty()) { - hash = (37 * hash) + TAGS_FIELD_NUMBER; - hash = (53 * hash) + internalGetTags().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, - extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, - extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, - extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.holoinsight.server.home.proto.hello.HelloRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code scheduler.HelloRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:scheduler.HelloRequest) - io.holoinsight.server.home.proto.hello.HelloRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloRequest_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetTags(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 4: - return internalGetMutableTags(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.holoinsight.server.home.proto.hello.HelloRequest.class, - io.holoinsight.server.home.proto.hello.HelloRequest.Builder.class); - } - - // Construct using io.holoinsight.server.home.proto.hello.HelloRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() {} - - public Builder clear() { - super.clear(); - name_ = ""; - - age_ = 0; - - hobbies_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - internalGetMutableTags().clear(); - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloRequest_descriptor; - } - - public io.holoinsight.server.home.proto.hello.HelloRequest getDefaultInstanceForType() { - return io.holoinsight.server.home.proto.hello.HelloRequest.getDefaultInstance(); - } - - public io.holoinsight.server.home.proto.hello.HelloRequest build() { - io.holoinsight.server.home.proto.hello.HelloRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.holoinsight.server.home.proto.hello.HelloRequest buildPartial() { - io.holoinsight.server.home.proto.hello.HelloRequest result = - new io.holoinsight.server.home.proto.hello.HelloRequest(this); - int to_bitField0_ = 0; - result.name_ = name_; - result.age_ = age_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - hobbies_ = hobbies_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.hobbies_ = hobbies_; - result.tags_ = internalGetTags(); - result.tags_.makeImmutable(); - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.holoinsight.server.home.proto.hello.HelloRequest) { - return mergeFrom((io.holoinsight.server.home.proto.hello.HelloRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.holoinsight.server.home.proto.hello.HelloRequest other) { - if (other == io.holoinsight.server.home.proto.hello.HelloRequest.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getAge() != 0) { - setAge(other.getAge()); - } - if (!other.hobbies_.isEmpty()) { - if (hobbies_.isEmpty()) { - hobbies_ = other.hobbies_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureHobbiesIsMutable(); - hobbies_.addAll(other.hobbies_); - } - onChanged(); - } - internalGetMutableTags().mergeFrom(other.internalGetTags()); - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - io.holoinsight.server.home.proto.hello.HelloRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.holoinsight.server.home.proto.hello.HelloRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private Object name_ = ""; - - /** - * string name = 1; - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string name = 1; - */ - public com.google.protobuf.ByteString getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 1; - */ - public Builder setName(String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - * string name = 1; - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - * string name = 1; - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int age_; - - /** - * int32 age = 2; - */ - public int getAge() { - return age_; - } - - /** - * int32 age = 2; - */ - public Builder setAge(int value) { - - age_ = value; - onChanged(); - return this; - } - - /** - * int32 age = 2; - */ - public Builder clearAge() { - - age_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList hobbies_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureHobbiesIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - hobbies_ = new com.google.protobuf.LazyStringArrayList(hobbies_); - bitField0_ |= 0x00000004; - } - } - - /** - * repeated string hobbies = 3; - */ - public com.google.protobuf.ProtocolStringList getHobbiesList() { - return hobbies_.getUnmodifiableView(); - } - - /** - * repeated string hobbies = 3; - */ - public int getHobbiesCount() { - return hobbies_.size(); - } - - /** - * repeated string hobbies = 3; - */ - public String getHobbies(int index) { - return hobbies_.get(index); - } - - /** - * repeated string hobbies = 3; - */ - public com.google.protobuf.ByteString getHobbiesBytes(int index) { - return hobbies_.getByteString(index); - } - - /** - * repeated string hobbies = 3; - */ - public Builder setHobbies(int index, String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHobbiesIsMutable(); - hobbies_.set(index, value); - onChanged(); - return this; - } - - /** - * repeated string hobbies = 3; - */ - public Builder addHobbies(String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureHobbiesIsMutable(); - hobbies_.add(value); - onChanged(); - return this; - } - - /** - * repeated string hobbies = 3; - */ - public Builder addAllHobbies(Iterable values) { - ensureHobbiesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hobbies_); - onChanged(); - return this; - } - - /** - * repeated string hobbies = 3; - */ - public Builder clearHobbies() { - hobbies_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - /** - * repeated string hobbies = 3; - */ - public Builder addHobbiesBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureHobbiesIsMutable(); - hobbies_.add(value); - onChanged(); - return this; - } - - private com.google.protobuf.MapField tags_; - - private com.google.protobuf.MapField internalGetTags() { - if (tags_ == null) { - return com.google.protobuf.MapField.emptyMapField(TagsDefaultEntryHolder.defaultEntry); - } - return tags_; - } - - private com.google.protobuf.MapField internalGetMutableTags() { - onChanged(); - if (tags_ == null) { - tags_ = com.google.protobuf.MapField.newMapField(TagsDefaultEntryHolder.defaultEntry); - } - if (!tags_.isMutable()) { - tags_ = tags_.copy(); - } - return tags_; - } - - public int getTagsCount() { - return internalGetTags().getMap().size(); - } - - /** - * map<string, string> tags = 4; - */ - - public boolean containsTags(String key) { - if (key == null) { - throw new NullPointerException(); - } - return internalGetTags().getMap().containsKey(key); - } - - /** - * Use {@link #getTagsMap()} instead. - */ - @Deprecated - public java.util.Map getTags() { - return getTagsMap(); - } - - /** - * map<string, string> tags = 4; - */ - - public java.util.Map getTagsMap() { - return internalGetTags().getMap(); - } - - /** - * map<string, string> tags = 4; - */ - - public String getTagsOrDefault(String key, String defaultValue) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = internalGetTags().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - - /** - * map<string, string> tags = 4; - */ - - public String getTagsOrThrow(String key) { - if (key == null) { - throw new NullPointerException(); - } - java.util.Map map = internalGetTags().getMap(); - if (!map.containsKey(key)) { - throw new IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearTags() { - internalGetMutableTags().getMutableMap().clear(); - return this; - } - - /** - * map<string, string> tags = 4; - */ - - public Builder removeTags(String key) { - if (key == null) { - throw new NullPointerException(); - } - internalGetMutableTags().getMutableMap().remove(key); - return this; - } - - /** - * Use alternate mutation accessors instead. - */ - @Deprecated - public java.util.Map getMutableTags() { - return internalGetMutableTags().getMutableMap(); - } - - /** - * map<string, string> tags = 4; - */ - public Builder putTags(String key, String value) { - if (key == null) { - throw new NullPointerException(); - } - if (value == null) { - throw new NullPointerException(); - } - internalGetMutableTags().getMutableMap().put(key, value); - return this; - } - - /** - * map<string, string> tags = 4; - */ - - public Builder putAllTags(java.util.Map values) { - internalGetMutableTags().getMutableMap().putAll(values); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:scheduler.HelloRequest) - } - - // @@protoc_insertion_point(class_scope:scheduler.HelloRequest) - private static final io.holoinsight.server.home.proto.hello.HelloRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new io.holoinsight.server.home.proto.hello.HelloRequest(); - } - - public static io.holoinsight.server.home.proto.hello.HelloRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public HelloRequest parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HelloRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.holoinsight.server.home.proto.hello.HelloRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloRequestOrBuilder.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloRequestOrBuilder.java deleted file mode 100644 index 84737a4db..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloRequestOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: HiService.proto - -package io.holoinsight.server.home.proto.hello; - -public interface HelloRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:scheduler.HelloRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - */ - String getName(); - - /** - * string name = 1; - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * int32 age = 2; - */ - int getAge(); - - /** - * repeated string hobbies = 3; - */ - java.util.List getHobbiesList(); - - /** - * repeated string hobbies = 3; - */ - int getHobbiesCount(); - - /** - * repeated string hobbies = 3; - */ - String getHobbies(int index); - - /** - * repeated string hobbies = 3; - */ - com.google.protobuf.ByteString getHobbiesBytes(int index); - - /** - * map<string, string> tags = 4; - */ - int getTagsCount(); - - /** - * map<string, string> tags = 4; - */ - boolean containsTags(String key); - - /** - * Use {@link #getTagsMap()} instead. - */ - @Deprecated - java.util.Map getTags(); - - /** - * map<string, string> tags = 4; - */ - java.util.Map getTagsMap(); - - /** - * map<string, string> tags = 4; - */ - - String getTagsOrDefault(String key, String defaultValue); - - /** - * map<string, string> tags = 4; - */ - - String getTagsOrThrow(String key); -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloResponse.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloResponse.java deleted file mode 100644 index db8dffc21..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloResponse.java +++ /dev/null @@ -1,513 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: HiService.proto - -package io.holoinsight.server.home.proto.hello; - -/** - * Protobuf type {@code scheduler.HelloResponse} - */ -public final class HelloResponse extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:scheduler.HelloResponse) - HelloResponseOrBuilder { - private static final long serialVersionUID = 0L; - - // Use HelloResponse.newBuilder() to construct. - private HelloResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private HelloResponse() { - greeting_ = ""; - } - - @Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private HelloResponse(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - greeting_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized(io.holoinsight.server.home.proto.hello.HelloResponse.class, - io.holoinsight.server.home.proto.hello.HelloResponse.Builder.class); - } - - public static final int GREETING_FIELD_NUMBER = 1; - private volatile Object greeting_; - - /** - * string greeting = 1; - */ - public String getGreeting() { - Object ref = greeting_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - greeting_ = s; - return s; - } - } - - /** - * string greeting = 1; - */ - public com.google.protobuf.ByteString getGreetingBytes() { - Object ref = greeting_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); - greeting_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getGreetingBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, greeting_); - } - unknownFields.writeTo(output); - } - - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (!getGreetingBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, greeting_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.holoinsight.server.home.proto.hello.HelloResponse)) { - return super.equals(obj); - } - io.holoinsight.server.home.proto.hello.HelloResponse other = - (io.holoinsight.server.home.proto.hello.HelloResponse) obj; - - boolean result = true; - result = result && getGreeting().equals(other.getGreeting()); - result = result && unknownFields.equals(other.unknownFields); - return result; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + GREETING_FIELD_NUMBER; - hash = (53 * hash) + getGreeting().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, - extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, - extensionRegistry); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, - extensionRegistry); - } - - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.holoinsight.server.home.proto.hello.HelloResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code scheduler.HelloResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:scheduler.HelloResponse) - io.holoinsight.server.home.proto.hello.HelloResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloResponse_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.holoinsight.server.home.proto.hello.HelloResponse.class, - io.holoinsight.server.home.proto.hello.HelloResponse.Builder.class); - } - - // Construct using io.holoinsight.server.home.proto.hello.HelloResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() {} - - public Builder clear() { - super.clear(); - greeting_ = ""; - - return this; - } - - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.internal_static_scheduler_HelloResponse_descriptor; - } - - public io.holoinsight.server.home.proto.hello.HelloResponse getDefaultInstanceForType() { - return io.holoinsight.server.home.proto.hello.HelloResponse.getDefaultInstance(); - } - - public io.holoinsight.server.home.proto.hello.HelloResponse build() { - io.holoinsight.server.home.proto.hello.HelloResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public io.holoinsight.server.home.proto.hello.HelloResponse buildPartial() { - io.holoinsight.server.home.proto.hello.HelloResponse result = - new io.holoinsight.server.home.proto.hello.HelloResponse(this); - result.greeting_ = greeting_; - onBuilt(); - return result; - } - - public Builder clone() { - return (Builder) super.clone(); - } - - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { - return (Builder) super.setField(field, value); - } - - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.holoinsight.server.home.proto.hello.HelloResponse) { - return mergeFrom((io.holoinsight.server.home.proto.hello.HelloResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.holoinsight.server.home.proto.hello.HelloResponse other) { - if (other == io.holoinsight.server.home.proto.hello.HelloResponse.getDefaultInstance()) - return this; - if (!other.getGreeting().isEmpty()) { - greeting_ = other.greeting_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - io.holoinsight.server.home.proto.hello.HelloResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (io.holoinsight.server.home.proto.hello.HelloResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object greeting_ = ""; - - /** - * string greeting = 1; - */ - public String getGreeting() { - Object ref = greeting_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - greeting_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string greeting = 1; - */ - public com.google.protobuf.ByteString getGreetingBytes() { - Object ref = greeting_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - greeting_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string greeting = 1; - */ - public Builder setGreeting(String value) { - if (value == null) { - throw new NullPointerException(); - } - - greeting_ = value; - onChanged(); - return this; - } - - /** - * string greeting = 1; - */ - public Builder clearGreeting() { - - greeting_ = getDefaultInstance().getGreeting(); - onChanged(); - return this; - } - - /** - * string greeting = 1; - */ - public Builder setGreetingBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - greeting_ = value; - onChanged(); - return this; - } - - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFieldsProto3(unknownFields); - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:scheduler.HelloResponse) - } - - // @@protoc_insertion_point(class_scope:scheduler.HelloResponse) - private static final io.holoinsight.server.home.proto.hello.HelloResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new io.holoinsight.server.home.proto.hello.HelloResponse(); - } - - public static io.holoinsight.server.home.proto.hello.HelloResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - public HelloResponse parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new HelloResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - public io.holoinsight.server.home.proto.hello.HelloResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloResponseOrBuilder.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloResponseOrBuilder.java deleted file mode 100644 index e48594956..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloResponseOrBuilder.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: HiService.proto - -package io.holoinsight.server.home.proto.hello; - -public interface HelloResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:scheduler.HelloResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * string greeting = 1; - */ - String getGreeting(); - - /** - * string greeting = 1; - */ - com.google.protobuf.ByteString getGreetingBytes(); -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloServiceGrpc.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloServiceGrpc.java deleted file mode 100644 index 7dcba2145..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HelloServiceGrpc.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.proto.hello; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.42.2)", - comments = "Source: HiService.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class HelloServiceGrpc { - - private HelloServiceGrpc() {} - - public static final String SERVICE_NAME = "scheduler.HelloService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getHelloMethod; - - @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + "hello", - requestType = io.holoinsight.server.home.proto.hello.HelloRequest.class, - responseType = io.holoinsight.server.home.proto.hello.HelloResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getHelloMethod() { - io.grpc.MethodDescriptor getHelloMethod; - if ((getHelloMethod = HelloServiceGrpc.getHelloMethod) == null) { - synchronized (HelloServiceGrpc.class) { - if ((getHelloMethod = HelloServiceGrpc.getHelloMethod) == null) { - HelloServiceGrpc.getHelloMethod = getHelloMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "hello")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.holoinsight.server.home.proto.hello.HelloRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.holoinsight.server.home.proto.hello.HelloResponse.getDefaultInstance())) - .setSchemaDescriptor(new HelloServiceMethodDescriptorSupplier("hello")).build(); - } - } - } - return getHelloMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static HelloServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @Override - public HelloServiceStub newStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new HelloServiceStub(channel, callOptions); - } - }; - return HelloServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static HelloServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @Override - public HelloServiceBlockingStub newStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new HelloServiceBlockingStub(channel, callOptions); - } - }; - return HelloServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static HelloServiceFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @Override - public HelloServiceFutureStub newStub(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new HelloServiceFutureStub(channel, callOptions); - } - }; - return HelloServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class HelloServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void hello(io.holoinsight.server.home.proto.hello.HelloRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getHelloMethod(), responseObserver); - } - - @Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod(getHelloMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - this, METHODID_HELLO))) - .build(); - } - } - - /** - */ - public static final class HelloServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private HelloServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @Override - protected HelloServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new HelloServiceStub(channel, callOptions); - } - - /** - */ - public void hello(io.holoinsight.server.home.proto.hello.HelloRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getHelloMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class HelloServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private HelloServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @Override - protected HelloServiceBlockingStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new HelloServiceBlockingStub(channel, callOptions); - } - - /** - */ - public io.holoinsight.server.home.proto.hello.HelloResponse hello( - io.holoinsight.server.home.proto.hello.HelloRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall(getChannel(), getHelloMethod(), - getCallOptions(), request); - } - } - - /** - */ - public static final class HelloServiceFutureStub - extends io.grpc.stub.AbstractFutureStub { - private HelloServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @Override - protected HelloServiceFutureStub build(io.grpc.Channel channel, - io.grpc.CallOptions callOptions) { - return new HelloServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture hello( - io.holoinsight.server.home.proto.hello.HelloRequest request) { - return io.grpc.stub.ClientCalls - .futureUnaryCall(getChannel().newCall(getHelloMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_HELLO = 0; - - private static final class MethodHandlers - implements io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final HelloServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(HelloServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @Override - @SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_HELLO: - serviceImpl.hello((io.holoinsight.server.home.proto.hello.HelloRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @Override - @SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class HelloServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - HelloServiceBaseDescriptorSupplier() {} - - @Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return io.holoinsight.server.home.proto.hello.HiServiceProto.getDescriptor(); - } - - @Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("HelloService"); - } - } - - private static final class HelloServiceFileDescriptorSupplier - extends HelloServiceBaseDescriptorSupplier { - HelloServiceFileDescriptorSupplier() {} - } - - private static final class HelloServiceMethodDescriptorSupplier extends - HelloServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - HelloServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (HelloServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new HelloServiceFileDescriptorSupplier()) - .addMethod(getHelloMethod()).build(); - } - } - } - return result; - } -} diff --git a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HiServiceProto.java b/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HiServiceProto.java deleted file mode 100644 index 75714c740..000000000 --- a/server/home/home-proto/src/main/java/io/holoinsight/server/home/proto/hello/HiServiceProto.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: HiService.proto - -package io.holoinsight.server.home.proto.hello; - -public final class HiServiceProto { - private HiServiceProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor internal_static_scheduler_HelloRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_scheduler_HelloRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor internal_static_scheduler_HelloRequest_TagsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_scheduler_HelloRequest_TagsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor internal_static_scheduler_HelloResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_scheduler_HelloResponse_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - static { - String[] descriptorData = {"\n\017HiService.proto\022\tscheduler\"\230\001\n\014HelloRe" - + "quest\022\014\n\004name\030\001 \001(\t\022\013\n\003age\030\002 \001(\005\022\017\n\007hobb" - + "ies\030\003 \003(\t\022/\n\004tags\030\004 \003(\0132!.scheduler.Hell" - + "oRequest.TagsEntry\032+\n\tTagsEntry\022\013\n\003key\030\001" - + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"!\n\rHelloResponse" - + "\022\020\n\010greeting\030\001 \001(\t2J\n\014HelloService\022:\n\005he" - + "llo\022\027.scheduler.HelloRequest\032\030.scheduler" - + ".HelloResponseB<\n(com.alipay.cloudmonito" - + "r.prod.proto.helloB\016HiServiceProtoP\001b\006pr" + "oto3"}; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); - internal_static_scheduler_HelloRequest_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_scheduler_HelloRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_scheduler_HelloRequest_descriptor, - new String[] {"Name", "Age", "Hobbies", "Tags",}); - internal_static_scheduler_HelloRequest_TagsEntry_descriptor = - internal_static_scheduler_HelloRequest_descriptor.getNestedTypes().get(0); - internal_static_scheduler_HelloRequest_TagsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_scheduler_HelloRequest_TagsEntry_descriptor, - new String[] {"Key", "Value",}); - internal_static_scheduler_HelloResponse_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_scheduler_HelloResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_scheduler_HelloResponse_descriptor, new String[] {"Greeting",}); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/AccessConfigService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/AccessConfigService.java index a70e53523..b1f2448c8 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/AccessConfigService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/AccessConfigService.java @@ -6,8 +6,8 @@ import com.alibaba.fastjson.JSON; import io.holoinsight.server.home.biz.access.model.AccessConfig; import io.holoinsight.server.home.biz.access.model.MonitorAccessConfig; -import io.holoinsight.server.home.biz.service.ApiKeyService; -import io.holoinsight.server.home.dal.model.ApiKey; +import io.holoinsight.server.common.service.ApiKeyService; +import io.holoinsight.server.common.dao.entity.ApiKey; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/MonitorAccessService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/MonitorAccessService.java index 8c0a81313..813a6f9f3 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/MonitorAccessService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/access/MonitorAccessService.java @@ -6,10 +6,10 @@ import com.alibaba.fastjson.JSON; import io.holoinsight.server.home.biz.access.model.MonitorAccessConfig; import io.holoinsight.server.home.biz.access.model.MonitorTokenData; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.common.util.scope.RequestContext.Context; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.RequestContext.Context; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Hex; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/GaeaSqlTaskUtil.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/GaeaSqlTaskUtil.java index 6b3f606b2..c360c6d8d 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/GaeaSqlTaskUtil.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/GaeaSqlTaskUtil.java @@ -3,13 +3,19 @@ */ package io.holoinsight.server.home.biz.common; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.dal.model.dto.conf.*; +import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric; import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric.AfterFilter; import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric.LogSampleRule; import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric.Metric; +import io.holoinsight.server.home.dal.model.dto.conf.CustomPluginConf; import io.holoinsight.server.home.dal.model.dto.conf.CustomPluginConf.ExtraConfig; import io.holoinsight.server.home.dal.model.dto.conf.CustomPluginConf.SplitCol; +import io.holoinsight.server.home.dal.model.dto.conf.Filter; +import io.holoinsight.server.home.dal.model.dto.conf.LogParse; +import io.holoinsight.server.home.dal.model.dto.conf.LogPath; +import io.holoinsight.server.home.dal.model.dto.conf.LogPattern; +import io.holoinsight.server.home.dal.model.dto.conf.MultiLine; +import io.holoinsight.server.home.dal.model.dto.conf.Rule; import io.holoinsight.server.home.dal.model.dto.conf.Translate.TranslateTransform; import io.holoinsight.server.registry.model.Elect; import io.holoinsight.server.registry.model.Elect.RefIndex; @@ -49,7 +55,11 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.util.CollectionUtils; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @@ -142,7 +152,7 @@ public static From buildFrom(List logPaths, LogParse logParse, ExtraCon { Parse parse = new Parse(); - if (StringUtil.isBlank(logParse.splitType)) { + if (StringUtils.isBlank(logParse.splitType)) { parse.setType("none"); } else { switch (logParse.splitType) { diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/MetaDictUtil.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/MetaDictUtil.java index 5e026aa2e..34dfb90b2 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/MetaDictUtil.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/common/MetaDictUtil.java @@ -8,7 +8,7 @@ import io.holoinsight.server.common.dao.entity.MetaDataDictValue; import io.holoinsight.server.common.service.SuperCacheService; import io.holoinsight.server.home.common.service.SpringContext; -import io.holoinsight.server.home.common.util.scope.IdentityType; +import io.holoinsight.server.common.scope.IdentityType; import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleHistoryUpdateListener.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleHistoryUpdateListener.java index 1bc8eb7a2..7266505c6 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleHistoryUpdateListener.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleHistoryUpdateListener.java @@ -7,10 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.eventbus.AllowConcurrentEvents; import com.google.common.eventbus.Subscribe; -import io.holoinsight.server.home.common.util.EventBusHolder; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryDetailMapper; -import io.holoinsight.server.home.dal.model.AlarmHistoryDetail; -import io.holoinsight.server.home.facade.AlarmHistoryDTO; +import io.holoinsight.server.common.EventBusHolder; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryDetailMapper; +import io.holoinsight.server.common.dao.entity.AlarmHistoryDetail; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java index 6fd5f5d55..6f49a6d5e 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java @@ -9,15 +9,15 @@ import com.google.common.eventbus.Subscribe; import com.google.gson.reflect.TypeToken; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.biz.service.AlarmMetricService; -import io.holoinsight.server.home.common.util.EventBusHolder; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryMapper; -import io.holoinsight.server.home.dal.model.AlarmHistory; -import io.holoinsight.server.home.dal.model.AlarmMetric; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.service.AlarmMetricService; +import io.holoinsight.server.common.EventBusHolder; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryMapper; +import io.holoinsight.server.common.dao.entity.AlarmHistory; +import io.holoinsight.server.common.dao.entity.AlarmMetric; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -57,13 +57,14 @@ public void onEvent(AlarmRuleDTO alarmRuleDTO) { if (CollectionUtils.isEmpty(alarmRuleDTO.getRule())) { return; } - Rule rule = J.fromJson(J.toJson(alarmRuleDTO.getRule()), new TypeToken() {}.getType()); + AlarmRuleConf alarmRuleConf = + J.fromJson(J.toJson(alarmRuleDTO.getRule()), new TypeToken() {}.getType()); - if (CollectionUtils.isEmpty(rule.getTriggers())) { + if (CollectionUtils.isEmpty(alarmRuleConf.getTriggers())) { return; } - for (Trigger trigger : rule.getTriggers()) { + for (Trigger trigger : alarmRuleConf.getTriggers()) { if (CollectionUtils.isEmpty(trigger.getDatasources())) { continue; } diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/CustomPluginUpdateListener.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/CustomPluginUpdateListener.java index 062c65f01..cb92c05c9 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/CustomPluginUpdateListener.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/CustomPluginUpdateListener.java @@ -3,18 +3,20 @@ */ package io.holoinsight.server.home.biz.listener; +import com.google.common.eventbus.AllowConcurrentEvents; +import com.google.common.eventbus.Subscribe; import io.holoinsight.server.agg.v1.core.conf.AggTask; +import io.holoinsight.server.common.EventBusHolder; +import io.holoinsight.server.common.J; +import io.holoinsight.server.common.dao.entity.dto.AggTaskV1DTO; import io.holoinsight.server.common.dao.entity.dto.MetricInfoDTO; +import io.holoinsight.server.common.service.AggTaskV1Service; import io.holoinsight.server.common.service.MetricInfoService; import io.holoinsight.server.home.biz.common.AggTaskUtil; import io.holoinsight.server.home.biz.common.GaeaConvertUtil; import io.holoinsight.server.home.biz.common.GaeaSqlTaskUtil; -import io.holoinsight.server.home.biz.service.AggTaskV1Service; import io.holoinsight.server.home.biz.service.GaeaCollectConfigService; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.common.util.EventBusHolder; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.dal.model.dto.AggTaskV1DTO; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; import io.holoinsight.server.home.dal.model.dto.CustomPluginStatus; import io.holoinsight.server.home.dal.model.dto.GaeaCollectConfigDTO; @@ -22,8 +24,6 @@ import io.holoinsight.server.home.dal.model.dto.conf.CustomPluginConf; import io.holoinsight.server.home.dal.model.dto.conf.CustomPluginConf.SplitCol; import io.holoinsight.server.home.dal.model.dto.conf.LogPath; -import com.google.common.eventbus.AllowConcurrentEvents; -import com.google.common.eventbus.Subscribe; import io.holoinsight.server.registry.model.ExecuteRule; import io.holoinsight.server.registry.model.From; import io.holoinsight.server.registry.model.GroupBy; @@ -33,6 +33,7 @@ import io.holoinsight.server.registry.model.Where; import io.holoinsight.server.registry.model.Window; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -98,7 +99,7 @@ public void onEvent(CustomPluginDTO customPluginDTO) { SqlTask sqlTask = buildSqlTask(logPaths, collectMetric, customPluginDTO); String name = collectMetric.name; - if (StringUtil.isNotBlank(collectMetric.tableName)) { + if (StringUtils.isNotBlank(collectMetric.tableName)) { name = collectMetric.tableName; } String tableName = String.format("%s_%s", name, customPluginDTO.id); @@ -243,7 +244,7 @@ private List upsertAgg(Map aggTasks, CustomPluginDTO cust for (Map.Entry entry : aggTasks.entrySet()) { AggTaskV1DTO aggTaskV1DTO = new AggTaskV1DTO(); aggTaskV1DTO.setDeleted(false); - aggTaskV1DTO.setJson(entry.getValue()); + aggTaskV1DTO.setJson(J.toJson(entry.getValue())); aggTaskV1DTO.setAggId(entry.getKey()); aggTaskV1DTO.setVersion(1L); aggTaskV1DTO.setRefId("custom_" + customPluginDTO.getId()); diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationGeneratedUpdateListener.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationGeneratedUpdateListener.java index 339f33319..1348a3c33 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationGeneratedUpdateListener.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationGeneratedUpdateListener.java @@ -13,7 +13,7 @@ import io.holoinsight.server.home.biz.plugin.config.MetaLabel; import io.holoinsight.server.home.biz.plugin.config.PortCheckPluginConfig; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.common.util.EventBusHolder; +import io.holoinsight.server.common.EventBusHolder; import io.holoinsight.server.home.dal.model.dto.CloudMonitorRange; import io.holoinsight.server.home.dal.model.dto.GaeaCollectConfigDTO.GaeaCollectRange; import io.holoinsight.server.home.dal.model.dto.IntegrationGeneratedDTO; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationPluginUpdateListener.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationPluginUpdateListener.java index 967b0954c..9f7c9897b 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationPluginUpdateListener.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/IntegrationPluginUpdateListener.java @@ -9,7 +9,7 @@ import io.holoinsight.server.home.biz.service.GaeaCollectConfigService; import io.holoinsight.server.home.biz.service.TenantInitService; import io.holoinsight.server.home.biz.service.openai.OpenAiService; -import io.holoinsight.server.home.common.util.EventBusHolder; +import io.holoinsight.server.common.EventBusHolder; import io.holoinsight.server.home.dal.model.dto.GaeaCollectConfigDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; import com.google.common.eventbus.AllowConcurrentEvents; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/OpenmetricsScraperUpdateListener.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/OpenmetricsScraperUpdateListener.java index c2b8e49dd..49b5a09fa 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/OpenmetricsScraperUpdateListener.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/OpenmetricsScraperUpdateListener.java @@ -6,7 +6,7 @@ import io.holoinsight.server.home.biz.common.GaeaConvertUtil; import io.holoinsight.server.home.biz.service.GaeaCollectConfigService; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.common.util.EventBusHolder; +import io.holoinsight.server.common.EventBusHolder; import io.holoinsight.server.home.dal.model.dto.GaeaCollectConfigDTO; import io.holoinsight.server.home.dal.model.dto.OpenmetricsScraperDTO; import com.google.common.eventbus.AllowConcurrentEvents; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/AbstractHostingAlertPlugin.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/AbstractHostingAlertPlugin.java index 83fe765e3..24c3d2b6b 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/AbstractHostingAlertPlugin.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/AbstractHostingAlertPlugin.java @@ -8,18 +8,18 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.home.biz.plugin.model.HostingAlertList; import io.holoinsight.server.home.biz.plugin.model.HostingPlugin; -import io.holoinsight.server.home.biz.service.AlertRuleService; +import io.holoinsight.server.common.service.AlertRuleService; import io.holoinsight.server.home.biz.service.IntegrationProductService; -import io.holoinsight.server.home.dal.mapper.AlarmSubscribeMapper; -import io.holoinsight.server.home.dal.mapper.AlarmWebhookMapper; -import io.holoinsight.server.home.dal.model.AlarmSubscribe; -import io.holoinsight.server.home.dal.model.AlarmWebhook; +import io.holoinsight.server.common.dao.mapper.AlarmSubscribeMapper; +import io.holoinsight.server.common.dao.mapper.AlarmWebhookMapper; +import io.holoinsight.server.common.dao.entity.AlarmSubscribe; +import io.holoinsight.server.common.dao.entity.AlarmWebhook; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.facade.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/DefaultMarketplaceProductHandler.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/DefaultMarketplaceProductHandler.java index 7fe327a7d..2132e6b13 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/DefaultMarketplaceProductHandler.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/DefaultMarketplaceProductHandler.java @@ -5,16 +5,16 @@ import com.google.gson.reflect.TypeToken; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.biz.service.AlertWebhookService; -import io.holoinsight.server.home.biz.service.ApiKeyService; +import io.holoinsight.server.common.service.AlertWebhookService; +import io.holoinsight.server.common.service.ApiKeyService; import io.holoinsight.server.home.biz.service.MarketplacePluginService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.AlarmWebhook; -import io.holoinsight.server.home.dal.model.ApiKey; -import io.holoinsight.server.home.dal.model.dto.AlarmWebhookDTO; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.AlarmWebhook; +import io.holoinsight.server.common.dao.entity.ApiKey; +import io.holoinsight.server.common.dao.entity.dto.AlarmWebhookDTO; import io.holoinsight.server.home.dal.model.dto.MarketplacePluginDTO; import io.holoinsight.server.home.dal.model.dto.MarketplaceProductDTO; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/core/LogPluginUtil.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/core/LogPluginUtil.java index 550d847f3..955487828 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/core/LogPluginUtil.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/core/LogPluginUtil.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.biz.plugin.core; -import io.holoinsight.server.home.common.util.MonitorException; +import io.holoinsight.server.common.MonitorException; import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric; import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric.AfterFilter; import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric.Metric; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/DefaultHostingAlertPlugin.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/DefaultHostingAlertPlugin.java index c108f5463..6c82481d6 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/DefaultHostingAlertPlugin.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/DefaultHostingAlertPlugin.java @@ -5,7 +5,7 @@ import io.holoinsight.server.home.biz.plugin.AbstractHostingAlertPlugin; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; import org.springframework.stereotype.Component; /** diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlert.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlert.java index 26ed018c3..3d8898e8d 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlert.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlert.java @@ -4,23 +4,23 @@ package io.holoinsight.server.home.biz.plugin.model; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.AlarmRule; +import io.holoinsight.server.common.dao.entity.AlarmRule; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.TimeFilter; -import io.holoinsight.server.home.facade.emuns.AlertLevel; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.emuns.TimeFilterEnum; -import io.holoinsight.server.home.facade.trigger.CompareConfig; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Filter; -import io.holoinsight.server.home.facade.trigger.RuleConfig; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.TimeFilter; +import io.holoinsight.server.common.dao.emuns.AlertLevel; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.TimeFilterEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.RuleConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import org.apache.commons.lang3.StringUtils; import org.springframework.util.CollectionUtils; @@ -56,22 +56,22 @@ public class HostingAlert { public List compareConfigs; public static HostingAlert parseAlarmRuleVO(AlarmRule alarmRule) { - Rule rule = J.fromJson(alarmRule.getRule(), Rule.class); + AlarmRuleConf alarmRuleConf = J.fromJson(alarmRule.getRule(), AlarmRuleConf.class); HostingAlert vo = new HostingAlert(); vo.ruleId = String.valueOf(alarmRule.getId()); vo.alertType = alarmRule.getRuleType(); - vo.alertMetric = getMetric(rule); - vo.alertScope = getScope(rule); + vo.alertMetric = getMetric(alarmRuleConf); + vo.alertScope = getScope(alarmRuleConf); vo.alertTitle = alarmRule.getRuleName(); vo.tenant = alarmRule.getTenant(); return vo; } - private static String getScope(Rule rule) { - if (CollectionUtils.isEmpty(rule.getTriggers())) { + private static String getScope(AlarmRuleConf alarmRuleConf) { + if (CollectionUtils.isEmpty(alarmRuleConf.getTriggers())) { return StringUtils.EMPTY; } - Trigger trigger = rule.getTriggers().get(0); + Trigger trigger = alarmRuleConf.getTriggers().get(0); if (CollectionUtils.isEmpty(trigger.getDatasources())) { return StringUtils.EMPTY; } @@ -87,11 +87,11 @@ private static String getScope(Rule rule) { return J.toJson(map); } - private static String getMetric(Rule rule) { - if (CollectionUtils.isEmpty(rule.getTriggers())) { + private static String getMetric(AlarmRuleConf alarmRuleConf) { + if (CollectionUtils.isEmpty(alarmRuleConf.getTriggers())) { return StringUtils.EMPTY; } - Trigger trigger = rule.getTriggers().get(0); + Trigger trigger = alarmRuleConf.getTriggers().get(0); if (CollectionUtils.isEmpty(trigger.getDatasources())) { return StringUtils.EMPTY; } @@ -153,10 +153,10 @@ private Map buildTimeFilter() { } private Map buildRule(IntegrationProductDTO product, List filters) { - Rule alertRule = new Rule(); - alertRule.setBoolOperation(BoolOperationEnum.AND); - alertRule.setTriggers(buildTriggers(product, filters)); - return J.toMap(J.toJson(alertRule)); + AlarmRuleConf alertAlarmRuleConf = new AlarmRuleConf(); + alertAlarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alertAlarmRuleConf.setTriggers(buildTriggers(product, filters)); + return J.toMap(J.toJson(alertAlarmRuleConf)); } private List buildTriggers(IntegrationProductDTO product, List filters) { diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlertList.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlertList.java index c1f90e091..5320a946e 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlertList.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/HostingAlertList.java @@ -5,8 +5,8 @@ import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; import org.springframework.util.CollectionUtils; import java.util.ArrayList; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/PluginContext.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/PluginContext.java index 7c8ecd45f..c6a6f61e4 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/PluginContext.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/model/PluginContext.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.biz.plugin.model; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; import java.util.HashMap; import java.util.Map; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/CustomPluginService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/CustomPluginService.java index 9c456f537..e4025909f 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/CustomPluginService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/CustomPluginService.java @@ -3,8 +3,8 @@ */ package io.holoinsight.server.home.biz.service; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.dal.model.CustomPlugin; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; import com.baomidou.mybatisplus.extension.service.IService; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/DashboardService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/DashboardService.java index 65b9374d1..94f415a1c 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/DashboardService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/DashboardService.java @@ -4,8 +4,8 @@ package io.holoinsight.server.home.biz.service; import io.holoinsight.server.home.dal.model.Dashboard; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/EnvironmentService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/EnvironmentService.java index 48b3d4f43..eeb6a5b5e 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/EnvironmentService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/EnvironmentService.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.biz.service; -import io.holoinsight.server.home.common.model.TaskEnum; +import io.holoinsight.server.common.model.TaskEnum; /** * diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationPluginService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationPluginService.java index 4a1d3bafd..d60839eb8 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationPluginService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationPluginService.java @@ -6,8 +6,8 @@ import com.baomidou.mybatisplus.extension.service.IService; import io.holoinsight.server.home.dal.model.IntegrationPlugin; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import java.util.List; import java.util.Map; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationProductService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationProductService.java index befc58620..fbf18207e 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationProductService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/IntegrationProductService.java @@ -3,8 +3,8 @@ */ package io.holoinsight.server.home.biz.service; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.dal.model.IntegrationProduct; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; import com.baomidou.mybatisplus.extension.service.IService; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplacePluginService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplacePluginService.java index 112c68cc9..1dca768c7 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplacePluginService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplacePluginService.java @@ -5,8 +5,8 @@ import io.holoinsight.server.home.dal.model.MarketplacePlugin; import io.holoinsight.server.home.dal.model.dto.MarketplacePluginDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplaceProductService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplaceProductService.java index 6f1e36868..bafeea50e 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplaceProductService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MarketplaceProductService.java @@ -5,8 +5,8 @@ import io.holoinsight.server.home.dal.model.MarketplaceProduct; import io.holoinsight.server.home.dal.model.dto.MarketplaceProductDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MetaService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MetaService.java index 0ec3a09dd..4a258ea3b 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MetaService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/MetaService.java @@ -4,11 +4,10 @@ package io.holoinsight.server.home.biz.service; +import io.holoinsight.server.common.Debugger; import io.holoinsight.server.common.J; import io.holoinsight.server.common.dao.entity.Workspace; import io.holoinsight.server.common.service.WorkspaceService; -import io.holoinsight.server.home.common.util.Debugger; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.meta.facade.service.DataClientService; import lombok.Data; import lombok.extern.slf4j.Slf4j; @@ -122,7 +121,7 @@ public List getAppModelFromServerTable(String tenant, String serverTab } String app = map.get(meta_app).toString(); - if (StringUtil.isBlank(app) || "-".equalsIgnoreCase(app)) { + if (StringUtils.isBlank(app) || "-".equalsIgnoreCase(app)) { continue; } AppModel appModel = new AppModel(); diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/OpenmetricsScraperService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/OpenmetricsScraperService.java index 5f9ad6b54..97a477d67 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/OpenmetricsScraperService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/OpenmetricsScraperService.java @@ -5,8 +5,8 @@ import io.holoinsight.server.home.dal.model.OpenmetricsScraper; import io.holoinsight.server.home.dal.model.dto.OpenmetricsScraperDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import com.baomidou.mybatisplus.extension.service.IService; public interface OpenmetricsScraperService extends IService { diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java index c38ae6e08..6341a6c17 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/TenantInitService.java @@ -7,8 +7,8 @@ import io.holoinsight.server.common.dao.entity.MetricInfo; import io.holoinsight.server.common.dao.entity.dto.TenantOpsStorage; import io.holoinsight.server.home.biz.plugin.config.MetaLabel; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; import io.holoinsight.server.home.dal.model.dto.CloudMonitorRange; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationGeneratedDTO; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/agent/AgentLogTailService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/agent/AgentLogTailService.java index c109990b7..76b4b40c0 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/agent/AgentLogTailService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/agent/AgentLogTailService.java @@ -3,28 +3,26 @@ */ package io.holoinsight.server.home.biz.service.agent; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - import com.google.protobuf.ProtocolStringList; - import io.holoinsight.server.common.J; +import io.holoinsight.server.common.MonitorException; import io.holoinsight.server.common.RetryUtils; import io.holoinsight.server.common.UtilMisc; import io.holoinsight.server.common.grpc.FileNode; import io.holoinsight.server.home.biz.service.TenantInitService; import io.holoinsight.server.home.common.service.RegistryService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.meta.common.model.QueryExample; import io.holoinsight.server.meta.facade.service.DataClientService; import io.holoinsight.server.registry.grpc.prod.PreviewFileResponse; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** * @@ -115,19 +113,19 @@ private Map getDimByRequest(AgentParamRequest agentParamRequest, QueryExample queryExample = new QueryExample(); - if (StringUtil.isNotBlank(agentParamRequest.ip)) { + if (StringUtils.isNotBlank(agentParamRequest.ip)) { queryExample.getParams().put("ip", agentParamRequest.ip); } - if (StringUtil.isNotBlank(agentParamRequest.hostname)) { + if (StringUtils.isNotBlank(agentParamRequest.hostname)) { queryExample.getParams().put("hostname", agentParamRequest.hostname); } - if (StringUtil.isNotBlank(agentParamRequest.app)) { + if (StringUtils.isNotBlank(agentParamRequest.app)) { queryExample.getParams().put("app", agentParamRequest.app); } if (!CollectionUtils.isEmpty(agentParamRequest.label)) { for (Map.Entry entry : agentParamRequest.label.entrySet()) { - if (StringUtil.isBlank(entry.getValue())) + if (StringUtils.isBlank(entry.getValue())) continue; queryExample.getParams().put(entry.getKey(), entry.getValue()); } diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java index 0eb701b39..6b8ef5fc2 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/gpt/GptService.java @@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSON; import io.holoinsight.server.common.config.EnvironmentProperties; -import io.holoinsight.server.home.common.util.http.HttpProxy; -import io.holoinsight.server.home.common.util.http.XHttpRequest; -import io.holoinsight.server.home.common.util.http.XHttpResponse; +import io.holoinsight.server.home.common.http.HttpProxy; +import io.holoinsight.server.home.common.http.XHttpRequest; +import io.holoinsight.server.home.common.http.XHttpResponse; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/CustomPluginServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/CustomPluginServiceImpl.java index 63deaaf38..aeab644b4 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/CustomPluginServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/CustomPluginServiceImpl.java @@ -3,19 +3,18 @@ */ package io.holoinsight.server.home.biz.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.holoinsight.server.common.EventBusHolder; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.biz.service.CustomPluginService; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.common.util.EventBusHolder; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.home.dal.converter.CustomPluginConverter; import io.holoinsight.server.home.dal.mapper.CustomPluginMapper; import io.holoinsight.server.home.dal.model.CustomPlugin; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -126,11 +125,11 @@ public MonitorPageResult getListByPage( wrapper.le("gmt_modified", customPluginDTO.getGmtCreate()); } - if (StringUtil.isNotBlank(customPluginDTO.getCreator())) { + if (StringUtils.isNotBlank(customPluginDTO.getCreator())) { wrapper.eq("creator", customPluginDTO.getCreator().trim()); } - if (StringUtil.isNotBlank(customPluginDTO.getModifier())) { + if (StringUtils.isNotBlank(customPluginDTO.getModifier())) { wrapper.eq("modifier", customPluginDTO.getModifier().trim()); } @@ -138,7 +137,7 @@ public MonitorPageResult getListByPage( wrapper.eq("id", customPluginDTO.getId()); } - if (StringUtil.isNotBlank(customPluginDTO.getTenant())) { + if (StringUtils.isNotBlank(customPluginDTO.getTenant())) { wrapper.eq("tenant", customPluginDTO.getTenant().trim()); } @@ -146,7 +145,7 @@ public MonitorPageResult getListByPage( wrapper.eq("workspace", customPluginDTO.getWorkspace()); } - if (StringUtil.isNotBlank(customPluginDTO.getName())) { + if (StringUtils.isNotBlank(customPluginDTO.getName())) { wrapper.like("name", customPluginDTO.getName().trim()); } @@ -154,7 +153,7 @@ public MonitorPageResult getListByPage( wrapper.eq("period_type", customPluginDTO.getPeriodType().name()); } - if (StringUtil.isNotBlank(customPluginDTO.getPluginType())) { + if (StringUtils.isNotBlank(customPluginDTO.getPluginType())) { wrapper.eq("plugin_type", customPluginDTO.getPluginType().trim()); } @@ -186,7 +185,7 @@ public MonitorPageResult getListByPage( @Override public List getListByKeyword(String keyword, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { wrapper.eq("tenant", tenant); } @@ -219,7 +218,7 @@ private CustomPluginDTO doToDTO(CustomPlugin customPlugin) { && !CollectionUtils.isEmpty(customPluginDTO.getConf().collectMetrics)) { customPluginDTO.getConf().collectMetrics.forEach(collectMetric -> { String tableName = collectMetric.tableName + "_" + customPluginDTO.id; - if (StringUtil.isNotBlank(collectMetric.name)) { + if (StringUtils.isNotBlank(collectMetric.name)) { tableName = collectMetric.name; } collectMetric.targetTable = tenantInitService.getLogMonitorMetricTable(tableName); @@ -242,7 +241,7 @@ private List dosToDTOs(List customPlugins) { && !CollectionUtils.isEmpty(customPluginDTO.getConf().collectMetrics)) { customPluginDTO.getConf().collectMetrics.forEach(collectMetric -> { String tableName = collectMetric.tableName + "_" + customPluginDTO.id; - if (StringUtil.isNotBlank(collectMetric.name)) { + if (StringUtils.isNotBlank(collectMetric.name)) { tableName = collectMetric.name; } collectMetric.targetTable = tenantInitService.getLogMonitorMetricTable(tableName); diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DashboardServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DashboardServiceImpl.java index 5a97f1b95..444d72a96 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DashboardServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DashboardServiceImpl.java @@ -3,15 +3,14 @@ */ package io.holoinsight.server.home.biz.service.impl; -import io.holoinsight.server.home.biz.service.DashboardService; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.dal.mapper.DashboardMapper; -import io.holoinsight.server.home.dal.model.Dashboard; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.home.biz.service.DashboardService; +import io.holoinsight.server.home.dal.mapper.DashboardMapper; +import io.holoinsight.server.home.dal.model.Dashboard; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -54,10 +53,10 @@ public List findByIds(List ids) { @Override public List getListByKeyword(String keyword, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { wrapper.eq("tenant", tenant); } - if (StringUtil.isNotBlank(workspace)) { + if (StringUtils.isNotBlank(workspace)) { wrapper.eq("workspace", workspace); } wrapper.and(wa -> wa.like("id", keyword).or().like("title", keyword)); @@ -85,11 +84,11 @@ public MonitorPageResult getListByPage(MonitorPageRequest wrapper.le("gmt_modified", dashboard.getGmtCreate()); } - if (StringUtil.isNotBlank(dashboard.getCreator())) { + if (StringUtils.isNotBlank(dashboard.getCreator())) { wrapper.eq("creator", dashboard.getCreator().trim()); } - if (StringUtil.isNotBlank(dashboard.getModifier())) { + if (StringUtils.isNotBlank(dashboard.getModifier())) { wrapper.eq("modifier", dashboard.getModifier().trim()); } @@ -101,15 +100,15 @@ public MonitorPageResult getListByPage(MonitorPageRequest wrapper.eq("type", dashboard.getType()); } - if (StringUtil.isNotBlank(dashboard.getTenant())) { + if (StringUtils.isNotBlank(dashboard.getTenant())) { wrapper.eq("tenant", dashboard.getTenant().trim()); } - if (StringUtil.isNotBlank(dashboard.getWorkspace())) { + if (StringUtils.isNotBlank(dashboard.getWorkspace())) { wrapper.eq("workspace", dashboard.getWorkspace().trim()); } - if (StringUtil.isNotBlank(dashboard.getTitle())) { + if (StringUtils.isNotBlank(dashboard.getTitle())) { wrapper.like("title", dashboard.getTitle().trim()); } diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultEnvironmentServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultEnvironmentServiceImpl.java index f11b575be..1270baec1 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultEnvironmentServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultEnvironmentServiceImpl.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.biz.service.impl; import io.holoinsight.server.home.biz.service.EnvironmentService; -import io.holoinsight.server.home.common.model.TaskEnum; +import io.holoinsight.server.common.model.TaskEnum; /** * diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java index 3536e62d5..16197f71d 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/DefaultTenantInitServiceImpl.java @@ -9,8 +9,8 @@ import io.holoinsight.server.home.biz.common.GaeaConvertUtil; import io.holoinsight.server.home.biz.plugin.config.MetaLabel; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; import io.holoinsight.server.home.dal.model.dto.CloudMonitorRange; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationGeneratedDTO; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/FolderServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/FolderServiceImpl.java index 705a277e7..278f8fa63 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/FolderServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/FolderServiceImpl.java @@ -3,12 +3,12 @@ */ package io.holoinsight.server.home.biz.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import io.holoinsight.server.home.biz.service.FolderService; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.home.dal.mapper.FolderMapper; import io.holoinsight.server.home.dal.model.Folder; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.util.Date; @@ -25,10 +25,10 @@ public class FolderServiceImpl extends ServiceImpl impleme @Override public List getListByKeyword(String keyword, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { wrapper.eq("tenant", tenant); } - if (StringUtil.isNotBlank(workspace)) { + if (StringUtils.isNotBlank(workspace)) { wrapper.eq("workspace", workspace); } wrapper.and(wa -> wa.like("id", keyword).or().like("name", keyword)); @@ -41,7 +41,7 @@ public List getListByKeyword(String keyword, String tenant, String works public List getListByNameLike(String name, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("tenant", tenant); - if (StringUtil.isNotBlank(workspace)) { + if (StringUtils.isNotBlank(workspace)) { wrapper.eq("workspace", workspace); } wrapper.select().like("name", name); @@ -59,7 +59,7 @@ public List findByIds(List ids) { public Folder queryById(Long id, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("tenant", tenant); - if (StringUtil.isNotBlank(workspace)) { + if (StringUtils.isNotBlank(workspace)) { wrapper.eq("workspace", workspace); } wrapper.eq("id", id); diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationGeneratedServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationGeneratedServiceImpl.java index bec44add6..a85e80fd7 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationGeneratedServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationGeneratedServiceImpl.java @@ -3,15 +3,14 @@ */ package io.holoinsight.server.home.biz.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.holoinsight.server.common.EventBusHolder; import io.holoinsight.server.home.biz.service.IntegrationGeneratedService; -import io.holoinsight.server.home.common.util.EventBusHolder; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.home.dal.converter.IntegrationGeneratedConverter; import io.holoinsight.server.home.dal.mapper.IntegrationGeneratedMapper; import io.holoinsight.server.home.dal.model.IntegrationGenerated; import io.holoinsight.server.home.dal.model.dto.IntegrationGeneratedDTO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,7 +53,7 @@ public void update(IntegrationGeneratedDTO integrationGeneratedDTO) { public IntegrationGeneratedDTO queryById(Long id, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq("tenant", tenant); - if (StringUtil.isNotBlank(workspace)) { + if (StringUtils.isNotBlank(workspace)) { wrapper.eq("workspace", workspace); } wrapper.eq("id", id); @@ -86,7 +85,7 @@ public List queryByTenant(String tenant, String workspace) public List queryByName(String tenant, String workspace, String name) { Map map = new HashMap<>(); map.put("tenant", tenant); - if (StringUtil.isNotBlank(workspace)) { + if (StringUtils.isNotBlank(workspace)) { map.put("workspace", workspace); } map.put("deleted", 0); diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationPluginServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationPluginServiceImpl.java index 44f6d6849..95929f5a5 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationPluginServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationPluginServiceImpl.java @@ -8,13 +8,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import io.holoinsight.server.home.biz.plugin.PluginRepository; import io.holoinsight.server.home.biz.service.IntegrationPluginService; -import io.holoinsight.server.home.common.util.EventBusHolder; +import io.holoinsight.server.common.EventBusHolder; import io.holoinsight.server.home.dal.converter.IntegrationPluginConverter; import io.holoinsight.server.home.dal.mapper.IntegrationPluginMapper; import io.holoinsight.server.home.dal.model.IntegrationPlugin; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationProductServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationProductServiceImpl.java index db06ae40f..0d9da8842 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationProductServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/IntegrationProductServiceImpl.java @@ -3,18 +3,18 @@ */ package io.holoinsight.server.home.biz.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.holoinsight.server.common.EventBusHolder; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.biz.service.IntegrationProductService; -import io.holoinsight.server.home.common.util.EventBusHolder; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.home.dal.converter.IntegrationProductConverter; import io.holoinsight.server.home.dal.mapper.IntegrationProductMapper; import io.holoinsight.server.home.dal.model.IntegrationProduct; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -111,11 +111,11 @@ public MonitorPageResult getListByPage( wrapper.le("gmt_modified", integrationProductDTO.getGmtCreate()); } - if (StringUtil.isNotBlank(integrationProductDTO.getCreator())) { + if (StringUtils.isNotBlank(integrationProductDTO.getCreator())) { wrapper.eq("creator", integrationProductDTO.getCreator().trim()); } - if (StringUtil.isNotBlank(integrationProductDTO.getModifier())) { + if (StringUtils.isNotBlank(integrationProductDTO.getModifier())) { wrapper.eq("modifier", integrationProductDTO.getModifier().trim()); } @@ -123,7 +123,7 @@ public MonitorPageResult getListByPage( wrapper.eq("id", integrationProductDTO.getId()); } - if (StringUtil.isNotBlank(integrationProductDTO.getName())) { + if (StringUtils.isNotBlank(integrationProductDTO.getName())) { wrapper.like("name", integrationProductDTO.getName().trim()); } @@ -153,7 +153,7 @@ public MonitorPageResult getListByPage( @Override public List getListByKeyword(String keyword, String tenant) { QueryWrapper wrapper = new QueryWrapper<>(); - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { wrapper.eq("tenant", tenant); } wrapper.eq("status", 1); diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplacePluginServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplacePluginServiceImpl.java index a7fa6d670..5359e19db 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplacePluginServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplacePluginServiceImpl.java @@ -3,17 +3,16 @@ */ package io.holoinsight.server.home.biz.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.biz.service.MarketplacePluginService; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.home.dal.converter.MarketplacePluginConverter; import io.holoinsight.server.home.dal.mapper.MarketplacePluginMapper; import io.holoinsight.server.home.dal.model.MarketplacePlugin; import io.holoinsight.server.home.dal.model.dto.MarketplacePluginDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -113,11 +112,11 @@ public MonitorPageResult getListByPage( wrapper.le("gmt_modified", marketplacePluginDTO.getGmtCreate()); } - if (StringUtil.isNotBlank(marketplacePluginDTO.getCreator())) { + if (StringUtils.isNotBlank(marketplacePluginDTO.getCreator())) { wrapper.eq("creator", marketplacePluginDTO.getCreator().trim()); } - if (StringUtil.isNotBlank(marketplacePluginDTO.getModifier())) { + if (StringUtils.isNotBlank(marketplacePluginDTO.getModifier())) { wrapper.eq("modifier", marketplacePluginDTO.getModifier().trim()); } @@ -125,7 +124,7 @@ public MonitorPageResult getListByPage( wrapper.eq("id", marketplacePluginDTO.getId()); } - if (StringUtil.isNotBlank(marketplacePluginDTO.getName())) { + if (StringUtils.isNotBlank(marketplacePluginDTO.getName())) { wrapper.like("name", marketplacePluginDTO.getName().trim()); } @@ -166,7 +165,7 @@ public MonitorPageResult getListByPage( public List getListByKeyword(String keyword, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { wrapper.eq("tenant", tenant); } if (StringUtils.isNotBlank(workspace)) { @@ -184,7 +183,7 @@ public List getListByNameLike(String name, String tenant, String workspace) { QueryWrapper wrapper = new QueryWrapper<>(); wrapper.select().like("name", name); - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { wrapper.eq("tenant", tenant); } if (StringUtils.isNotBlank(workspace)) { diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplaceProductServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplaceProductServiceImpl.java index 50d538803..2a57572be 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplaceProductServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MarketplaceProductServiceImpl.java @@ -3,17 +3,17 @@ */ package io.holoinsight.server.home.biz.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.biz.service.MarketplaceProductService; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.home.dal.converter.MarketplaceProductConverter; import io.holoinsight.server.home.dal.mapper.MarketplaceProductMapper; import io.holoinsight.server.home.dal.model.MarketplaceProduct; import io.holoinsight.server.home.dal.model.dto.MarketplaceProductDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -94,11 +94,11 @@ public MonitorPageResult getListByPage( wrapper.le("gmt_modified", marketplaceProductDTO.getGmtCreate()); } - if (StringUtil.isNotBlank(marketplaceProductDTO.getCreator())) { + if (StringUtils.isNotBlank(marketplaceProductDTO.getCreator())) { wrapper.eq("creator", marketplaceProductDTO.getCreator().trim()); } - if (StringUtil.isNotBlank(marketplaceProductDTO.getModifier())) { + if (StringUtils.isNotBlank(marketplaceProductDTO.getModifier())) { wrapper.eq("modifier", marketplaceProductDTO.getModifier().trim()); } @@ -106,7 +106,7 @@ public MonitorPageResult getListByPage( wrapper.eq("id", marketplaceProductDTO.getId()); } - if (StringUtil.isNotBlank(marketplaceProductDTO.getName())) { + if (StringUtils.isNotBlank(marketplaceProductDTO.getName())) { wrapper.like("name", marketplaceProductDTO.getName().trim()); } @@ -137,7 +137,7 @@ public MonitorPageResult getListByPage( @Override public List getListByKeyword(String keyword, String tenant) { QueryWrapper wrapper = new QueryWrapper<>(); - if (StringUtil.isNotBlank(tenant)) { + if (StringUtils.isNotBlank(tenant)) { wrapper.eq("tenant", tenant); } wrapper.like("id", keyword).or().like("name", keyword); diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MetaTableServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MetaTableServiceImpl.java index f8af5c32c..f57e5960e 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MetaTableServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/MetaTableServiceImpl.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.biz.service.impl; import io.holoinsight.server.home.biz.service.MetaTableService; -import io.holoinsight.server.home.common.util.JpaUpdateUtil; +import io.holoinsight.server.common.JpaUpdateUtil; import io.holoinsight.server.home.dal.converter.MetaTableConverter; import io.holoinsight.server.home.dal.mapper.MetaTableMapper; import io.holoinsight.server.home.dal.model.MetaTable; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/OpenmetricsScraperServiceImpl.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/OpenmetricsScraperServiceImpl.java index e77e92d5a..319908d6a 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/OpenmetricsScraperServiceImpl.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/impl/OpenmetricsScraperServiceImpl.java @@ -3,33 +3,30 @@ */ package io.holoinsight.server.home.biz.service.impl; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.gson.reflect.TypeToken; - +import io.holoinsight.server.common.EventBusHolder; import io.holoinsight.server.common.J; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.biz.service.OpenmetricsScraperService; -import io.holoinsight.server.home.common.util.EventBusHolder; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.home.dal.converter.OpenmetricsScraperConverter; import io.holoinsight.server.home.dal.mapper.OpenmetricsScraperMapper; import io.holoinsight.server.home.dal.model.OpenmetricsScraper; import io.holoinsight.server.home.dal.model.dto.CloudMonitorRange; import io.holoinsight.server.home.dal.model.dto.OpenmetricsScraperDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; import io.holoinsight.server.registry.model.OpenmetricsScraperTask; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @Service public class OpenmetricsScraperServiceImpl extends @@ -135,11 +132,11 @@ public MonitorPageResult getListByPage( wrapper.le("gmt_modified", scraperDTO.getGmtCreate()); } - if (StringUtil.isNotBlank(scraperDTO.getCreator())) { + if (StringUtils.isNotBlank(scraperDTO.getCreator())) { wrapper.eq("creator", scraperDTO.getCreator().trim()); } - if (StringUtil.isNotBlank(scraperDTO.getModifier())) { + if (StringUtils.isNotBlank(scraperDTO.getModifier())) { wrapper.eq("modifier", scraperDTO.getModifier().trim()); } @@ -147,11 +144,11 @@ public MonitorPageResult getListByPage( wrapper.eq("id", scraperDTO.getId()); } - if (StringUtil.isNotBlank(scraperDTO.getTenant())) { + if (StringUtils.isNotBlank(scraperDTO.getTenant())) { wrapper.eq("tenant", scraperDTO.getTenant().trim()); } - if (StringUtil.isNotBlank(scraperDTO.getName())) { + if (StringUtils.isNotBlank(scraperDTO.getName())) { wrapper.like("name", scraperDTO.getName().trim()); } diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/openai/OpenAiService.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/openai/OpenAiService.java index 14fe3c686..3f2015b33 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/openai/OpenAiService.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/service/openai/OpenAiService.java @@ -13,9 +13,9 @@ import com.unfbx.chatgpt.interceptor.OpenAILogger; import com.unfbx.chatgpt.interceptor.OpenAiResponseInterceptor; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.mapper.IntegrationPluginMapper; import io.holoinsight.server.home.dal.model.IntegrationPlugin; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/MonitorULA.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/MonitorULA.java index bc617f6b4..ae592fcb6 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/MonitorULA.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/MonitorULA.java @@ -5,16 +5,16 @@ import io.holoinsight.server.home.biz.common.MetaDictUtil; import io.holoinsight.server.common.service.TenantService; -import io.holoinsight.server.home.common.util.scope.AuthTarget; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.IdentityType; -import io.holoinsight.server.home.common.util.scope.MonitorAuth; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorParams; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorTenant; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.scope.AuthTarget; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.IdentityType; +import io.holoinsight.server.common.scope.MonitorAuth; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorParams; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorTenant; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.common.dao.entity.dto.TenantDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULA.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULA.java index 63663c999..037695fb7 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULA.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULA.java @@ -3,12 +3,12 @@ */ package io.holoinsight.server.home.biz.ula; -import io.holoinsight.server.home.common.util.scope.IdentityType; -import io.holoinsight.server.home.common.util.scope.MonitorAuth; -import io.holoinsight.server.home.common.util.scope.MonitorParams; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorTenant; -import io.holoinsight.server.home.common.util.scope.MonitorUser; +import io.holoinsight.server.common.scope.IdentityType; +import io.holoinsight.server.common.scope.MonitorAuth; +import io.holoinsight.server.common.scope.MonitorParams; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorTenant; +import io.holoinsight.server.common.scope.MonitorUser; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULAFacade.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULAFacade.java index 64bf690c3..ac66a9713 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULAFacade.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/ULAFacade.java @@ -14,17 +14,17 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import io.holoinsight.server.home.biz.service.UserinfoService; -import io.holoinsight.server.home.common.util.scope.MonitorParams; -import io.holoinsight.server.home.facade.UserinfoDTO; +import io.holoinsight.server.common.service.UserinfoService; +import io.holoinsight.server.common.scope.MonitorParams; +import io.holoinsight.server.common.dao.entity.dto.UserinfoDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import io.holoinsight.server.home.biz.common.MetaDictUtil; -import io.holoinsight.server.home.common.util.scope.MonitorAuth; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; +import io.holoinsight.server.common.scope.MonitorAuth; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; import org.springframework.util.CollectionUtils; /** diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/UserCache.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/UserCache.java index b7c834ec1..241fd596a 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/UserCache.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/ula/UserCache.java @@ -4,14 +4,14 @@ package io.holoinsight.server.home.biz.ula; import io.holoinsight.server.common.MD5Hash; -import io.holoinsight.server.home.common.util.cache.local.CommonLocalCache; -import io.holoinsight.server.home.common.util.scope.MonitorUser; +import io.holoinsight.server.common.cache.local.CommonLocalCache; +import io.holoinsight.server.common.scope.MonitorUser; import io.holoinsight.server.common.J; import lombok.Data; import java.util.concurrent.TimeUnit; -import static io.holoinsight.server.home.common.util.cache.local.CacheConst.USER_CACHE_KEY; +import static io.holoinsight.server.common.cache.local.CacheConst.USER_CACHE_KEY; /** * diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/AbstractMonitorTask.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/AbstractMonitorTask.java index aa5b6bd38..a689ee9e5 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/AbstractMonitorTask.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/AbstractMonitorTask.java @@ -3,10 +3,10 @@ */ package io.holoinsight.server.home.task; -import io.holoinsight.server.home.common.model.TaskEnum; +import io.holoinsight.server.common.model.TaskEnum; import io.holoinsight.server.common.model.CLUSTER_ROLE_CONST; -import io.holoinsight.server.home.common.util.CommonThreadPool; -import io.holoinsight.server.home.dal.model.ClusterTask; +import io.holoinsight.server.common.CommonThreadPool; +import io.holoinsight.server.common.dao.entity.ClusterTask; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.List; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskDemo.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskDemo.java index a41addd35..4bc0bd03e 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskDemo.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskDemo.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.task; -import io.holoinsight.server.home.common.model.TaskEnum; +import io.holoinsight.server.common.model.TaskEnum; import org.springframework.stereotype.Service; import java.util.List; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskManager.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskManager.java index 205780425..a4ca45876 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskManager.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/MonitorTaskManager.java @@ -9,11 +9,11 @@ import io.holoinsight.server.common.config.ScheduleLoadTask; import io.holoinsight.server.home.biz.common.MetaDictUtil; import io.holoinsight.server.common.service.ClusterService; -import io.holoinsight.server.home.biz.service.ClusterTaskService; -import io.holoinsight.server.home.biz.service.impl.ClusterTaskServiceImpl; +import io.holoinsight.server.common.service.ClusterTaskService; +import io.holoinsight.server.common.service.impl.ClusterTaskServiceImpl; import io.holoinsight.server.common.model.CLUSTER_ROLE_CONST; -import io.holoinsight.server.home.common.util.Debugger; -import io.holoinsight.server.home.dal.model.ClusterTask; +import io.holoinsight.server.common.Debugger; +import io.holoinsight.server.common.dao.entity.ClusterTask; import io.holoinsight.server.common.dao.entity.dto.ClusterDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskFactoryHolder.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskFactoryHolder.java index 22a3545c0..aa7ddef2d 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskFactoryHolder.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskFactoryHolder.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.task; import com.google.common.collect.Maps; -import io.holoinsight.server.home.common.model.TaskEnum; +import io.holoinsight.server.common.model.TaskEnum; import org.apache.commons.lang3.StringUtils; import java.util.Map; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskHandler.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskHandler.java index c7ae18406..749ef683f 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskHandler.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TaskHandler.java @@ -3,8 +3,8 @@ */ package io.holoinsight.server.home.task; -import io.holoinsight.server.home.common.model.TaskEnum; -import io.holoinsight.server.home.common.model.TaskEnum.TaskType; +import io.holoinsight.server.common.model.TaskEnum; +import io.holoinsight.server.common.model.TaskEnum.TaskType; import org.apache.commons.lang3.StringUtils; import java.lang.annotation.ElementType; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantIntegrationGeneratedTask.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantIntegrationGeneratedTask.java index b7579c9de..2244998a2 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantIntegrationGeneratedTask.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantIntegrationGeneratedTask.java @@ -31,8 +31,8 @@ import io.holoinsight.server.home.biz.service.MetaService.AppModel; import io.holoinsight.server.home.biz.service.TenantInitService; import io.holoinsight.server.home.biz.service.TenantOpsService; -import io.holoinsight.server.home.common.model.TaskEnum; -import io.holoinsight.server.home.common.util.cache.local.CommonLocalCache; +import io.holoinsight.server.common.model.TaskEnum; +import io.holoinsight.server.common.cache.local.CommonLocalCache; import io.holoinsight.server.home.dal.converter.IntegrationGeneratedConverter; import io.holoinsight.server.home.dal.model.IntegrationGenerated; import io.holoinsight.server.home.dal.model.dto.CloudMonitorRange; @@ -51,8 +51,8 @@ import static io.holoinsight.server.home.biz.common.MetaDictKey.INTEGRATION_LOCAL_PRODUCT; import static io.holoinsight.server.home.biz.common.MetaDictType.INTEGRATION_CONFIG; -import static io.holoinsight.server.home.common.util.cache.local.CacheConst.APP_META_KEY; -import static io.holoinsight.server.home.common.util.cache.local.CacheConst.INTEGRATION_GENERATED_CACHE_KEY; +import static io.holoinsight.server.common.cache.local.CacheConst.APP_META_KEY; +import static io.holoinsight.server.common.cache.local.CacheConst.INTEGRATION_GENERATED_CACHE_KEY; /** * diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantMetricCrawlerTask.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantMetricCrawlerTask.java index 60bbf671b..a82ecac89 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantMetricCrawlerTask.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/TenantMetricCrawlerTask.java @@ -7,7 +7,7 @@ import io.holoinsight.server.common.dao.entity.MetricInfo; import io.holoinsight.server.common.service.MetricInfoService; import io.holoinsight.server.home.biz.service.IntegrationProductService; -import io.holoinsight.server.home.common.util.CommonThreadPool; +import io.holoinsight.server.common.CommonThreadPool; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; import io.holoinsight.server.home.task.crawler.TenantMetricCrawlerTaskJob; import io.holoinsight.server.home.task.crawler.TenantMetricCrawlerTaskJobArgs; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/DelayEventServiceImpl.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/DelayEventServiceImpl.java index 763de74ec..acefab132 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/DelayEventServiceImpl.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/DelayEventServiceImpl.java @@ -7,9 +7,9 @@ // import com.google.common.collect.HashMultimap; // import com.google.common.collect.Multimap; // import io.holoinsight.server.common.AddressUtil; -// import io.holoinsight.server.home.biz.service.TimedEventService; -// import io.holoinsight.server.home.common.util.MonitorException; -// import io.holoinsight.server.home.dal.model.TimedEvent; +// import io.holoinsight.server.common.service.TimedEventService; +// import io.holoinsight.server.common.MonitorException; +// import io.holoinsight.server.common.dao.entity.TimedEvent; // import io.holoinsight.server.home.task.eventengine.EventMetricsMonitorDaemon; // import io.holoinsight.server.home.task.eventengine.broker.EventBrokerGroupKeeper; // import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/TimedEventConverter.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/TimedEventConverter.java index 0e391934f..2c0eec40b 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/TimedEventConverter.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/eventengine/event/TimedEventConverter.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.task.eventengine.event; -import io.holoinsight.server.home.dal.model.TimedEvent; +import io.holoinsight.server.common.dao.entity.TimedEvent; import java.util.ArrayList; import java.util.List; diff --git a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/impl/TenantAppMetaSyncTask.java b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/impl/TenantAppMetaSyncTask.java index d6d69fdc0..6a3f63995 100644 --- a/server/home/home-task/src/main/java/io/holoinsight/server/home/task/impl/TenantAppMetaSyncTask.java +++ b/server/home/home-task/src/main/java/io/holoinsight/server/home/task/impl/TenantAppMetaSyncTask.java @@ -20,11 +20,10 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import io.holoinsight.server.home.common.util.Debugger; -import io.holoinsight.server.home.common.util.StringUtil; +import io.holoinsight.server.common.Debugger; import io.holoinsight.server.home.task.AbstractMonitorTask; import io.holoinsight.server.home.task.MonitorTaskJob; -import io.holoinsight.server.home.common.model.TaskEnum; +import io.holoinsight.server.common.model.TaskEnum; import io.holoinsight.server.home.task.TaskHandler; import io.holoinsight.server.meta.facade.service.DataClientService; import lombok.extern.slf4j.Slf4j; @@ -111,7 +110,7 @@ private void compare(String appTableName, List fromDbServers, List { - if (StringUtil.isBlank(appModel.getApp()) || "-".equalsIgnoreCase(appModel.getApp())) { + if (StringUtils.isBlank(appModel.getApp()) || "-".equalsIgnoreCase(appModel.getApp())) { return; } diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/AppInitListener.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/AppInitListener.java index 666cba5ce..5e009d980 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/AppInitListener.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/AppInitListener.java @@ -6,7 +6,7 @@ import io.holoinsight.server.common.config.ScheduleLoadTask; import io.holoinsight.server.home.alert.service.task.coordinator.AlertClusterService; import io.holoinsight.server.common.service.SuperCacheService; -import io.holoinsight.server.home.common.util.cache.local.LocalCacheManage; +import io.holoinsight.server.common.config.LocalCacheManage; import io.holoinsight.server.home.task.MonitorTaskManager; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/GrpcFacadeTemplate.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/GrpcFacadeTemplate.java deleted file mode 100644 index fd83ca967..000000000 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/GrpcFacadeTemplate.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.web.common; - -import io.holoinsight.server.home.proto.base.DataBaseResponse; -import io.holoinsight.server.common.AddressUtil; -import io.grpc.stub.StreamObserver; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.time.StopWatch; -import org.springframework.stereotype.Component; - -/** - * - * @author jsy1001de - * @version 1.0: GrpcFacadeTemplateImpl.java, v 0.1 2022年06月15日 3:00 下午 jinsong.yjs Exp $ - */ -@Component -@Slf4j -public class GrpcFacadeTemplate { - - public void manage(StreamObserver responseObserver, GrpcManageCallback callback, - DataBaseResponse.Builder builder) { - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - try { - // 检验参数 - callback.checkParameter(); - // 执行管理方法 - callback.doManage(); - - } catch (Throwable t) { - log.error(builder.getTraceId() + ", catch exception:" + t.getMessage(), t); - builder.setSuccess(false); - builder.setErrMsg(t.getMessage()); - } finally { - stopWatch.stop(); - DataBaseResponse build = builder.build(); - String trace = builder.getTraceId() + ", serverResult=[" + build.getSuccess() - + "], serverCost=[" + stopWatch.getTime() + "]"; - log.info(trace); - builder.setTraceId( - trace + ", targetIp=[" + AddressUtil.getLocalHostIPV4() + "], " + build.getErrMsg()); - responseObserver.onNext(build); - responseObserver.onCompleted(); - } - } -} diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/GrpcManageCallback.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/GrpcManageCallback.java deleted file mode 100644 index 70bd536be..000000000 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/GrpcManageCallback.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.web.common; - -/** - * - * @author jsy1001de - * @version 1.0: GrpcManageCallback.java, v 0.1 2022年06月15日 4:18 下午 jinsong.yjs Exp $ - */ -public interface GrpcManageCallback { - - void checkParameter(); - - void doManage(); - -} diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ParaCheckUtil.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ParaCheckUtil.java index 9d39ecd95..a1e448d01 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ParaCheckUtil.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ParaCheckUtil.java @@ -4,8 +4,8 @@ package io.holoinsight.server.home.web.common; import io.holoinsight.server.common.model.DataQueryRequest; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.util.CollectionUtils; @@ -32,12 +32,12 @@ public class ParaCheckUtil { private static final Pattern PATTERN_CLUSTER = Pattern.compile("^[a-z][a-z0-9\\-]{1,20}"); private static final Pattern PATTERN_APPLICATION = Pattern.compile("^[a-z]{1,20}"); - + private static Pattern PATTERN_CN_SQL = + Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\u3000-\\u303f\\uFF0C\\-_ ,|:\\.]*$"); private static Pattern PATTERN_SQL = - Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_ ,\\.]*$"); + Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_ ,|:\\.]*$"); private static Pattern PATTERN_STRICT_SQL = Pattern.compile("^[\\u00b7A-Za-z0-9\\u4e00-\\u9fa5\\-_,|\\.]*$"); - private static final Pattern PATTERN_AIG_NAME = Pattern.compile("^[a-z]{1,20}-[a-z][a-z0-9]{0,27}"); @@ -232,4 +232,37 @@ public static void checkSQlInjection(String param, String errorMsg) { } checkParaBoolean(commonStrictCheck(param), errorMsg); } + + public static boolean sqlNameCheck(String param) { + Matcher commonAllowed = PATTERN_SQL.matcher(param); + if (commonAllowed.find()) { + if (!unicodeCheck(param)) { + return false; + } + return true; + } + return false; + } + + public static boolean sqlCnNameCheck(String param) { + Matcher commonAllowed = PATTERN_CN_SQL.matcher(param); + if (commonAllowed.find()) { + if (!unicodeCheck(param)) { + return false; + } + return true; + } + return false; + } + + public static boolean sqlFieldCheck(String param) { + Matcher commonAllowed = PATTERN_STRICT_SQL.matcher(param); + if (commonAllowed.find()) { + if (!unicodeCheck(param)) { + return false; + } + return true; + } + return false; + } } diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ResponseUtil.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ResponseUtil.java index c77ba61e9..8cca61218 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ResponseUtil.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/ResponseUtil.java @@ -6,7 +6,7 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.common.JsonUtils; -import io.holoinsight.server.home.common.util.ResultCodeEnum; +import io.holoinsight.server.common.ResultCodeEnum; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/UserAuthScope.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/UserAuthScope.java index 7a8802062..7bad3268b 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/UserAuthScope.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/common/UserAuthScope.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.web.common; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.scope.PowerConstants; import lombok.AllArgsConstructor; import java.util.List; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/config/PropertiesListener.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/config/PropertiesListener.java index 669469a02..a42b583b5 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/config/PropertiesListener.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/config/PropertiesListener.java @@ -9,7 +9,7 @@ import org.springframework.core.annotation.Order; import org.springframework.core.env.ConfigurableEnvironment; -import io.holoinsight.server.home.common.util.CipherUtils; +import io.holoinsight.server.common.CipherUtils; import lombok.extern.slf4j.Slf4j; /** diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AgentFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AgentFacadeImpl.java index 0a13cb5da..87e214f48 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AgentFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AgentFacadeImpl.java @@ -7,16 +7,16 @@ import io.holoinsight.server.home.biz.common.MetaDictKey; import io.holoinsight.server.home.biz.common.MetaDictType; import io.holoinsight.server.home.biz.common.MetaDictUtil; -import io.holoinsight.server.home.biz.service.ApiKeyService; +import io.holoinsight.server.common.service.ApiKeyService; import io.holoinsight.server.home.biz.service.agent.AgentLogTailService; import io.holoinsight.server.home.biz.service.agent.AgentParamRequest; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.ApiKey; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.ApiKey; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmBlockFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmBlockFacadeImpl.java index dbfda7040..9d7da59af 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmBlockFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmBlockFacadeImpl.java @@ -5,19 +5,17 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.AlertBlockService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.ManageCallback; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.service.AlertBlockService; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.dto.AlarmBlockDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.web.common.ParaCheckUtil; +import io.holoinsight.server.common.dao.entity.dto.AlarmBlockDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.home.web.security.LevelAuthorizationAccess; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmDingDingRobotFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmDingDingRobotFacadeImpl.java index a501d5460..b94c458c4 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmDingDingRobotFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmDingDingRobotFacadeImpl.java @@ -5,19 +5,18 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.AlertDingDingRobotService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.service.AlertDingDingRobotService; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.dto.AlarmDingDingRobotDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.dao.entity.dto.AlarmDingDingRobotDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.home.web.security.LevelAuthorizationAccess; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmGroupFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmGroupFacadeImpl.java index cd34c1fce..0aa211f65 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmGroupFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmGroupFacadeImpl.java @@ -3,22 +3,22 @@ */ package io.holoinsight.server.home.web.controller; -import io.holoinsight.server.home.biz.service.AlertGroupService; -import io.holoinsight.server.home.biz.service.UserOpLogService; +import io.holoinsight.server.common.service.AlertGroupService; +import io.holoinsight.server.common.service.UserOpLogService; import io.holoinsight.server.home.biz.ula.ULAFacade; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.dto.AlarmGroupDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.dao.entity.dto.AlarmGroupDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.common.TokenUrls; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryDetailFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryDetailFacadeImpl.java index a53f85e53..6d2079239 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryDetailFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryDetailFacadeImpl.java @@ -6,16 +6,16 @@ import io.holoinsight.server.common.DateUtil; import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.AlarmHistoryDetailService; +import io.holoinsight.server.common.service.AlarmHistoryDetailService; import io.holoinsight.server.home.common.service.query.QueryResponse; import io.holoinsight.server.home.common.service.query.Result; -import io.holoinsight.server.home.common.util.ManageCallback; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.facade.AlarmHistoryDetailDTO; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDetailDTO; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryFacadeImpl.java index e5ec96a35..1f5ed1ae3 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmHistoryFacadeImpl.java @@ -4,13 +4,13 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.AlarmHistoryService; -import io.holoinsight.server.home.common.util.ManageCallback; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.facade.AlarmHistoryDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.service.AlarmHistoryService; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.home.web.security.LevelAuthorizationAccess; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmMetricFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmMetricFacadeImpl.java index 43d28b22c..4f0c079ca 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmMetricFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmMetricFacadeImpl.java @@ -7,13 +7,13 @@ import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.common.dao.entity.dto.MetricInfoDTO; import io.holoinsight.server.common.service.MetricInfoService; -import io.holoinsight.server.home.biz.service.AlarmMetricService; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.AlarmMetric; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.service.AlarmMetricService; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.AlarmMetric; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImpl.java index 848c6a277..b85588108 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImpl.java @@ -8,30 +8,30 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.home.biz.common.MetaDictUtil; -import io.holoinsight.server.home.biz.service.AlarmHistoryService; -import io.holoinsight.server.home.biz.service.AlertGroupService; -import io.holoinsight.server.home.biz.service.AlertRuleService; -import io.holoinsight.server.home.biz.service.AlertSubscribeService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.ManageCallback; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.converter.AlarmRuleConverter; +import io.holoinsight.server.common.service.AlarmHistoryService; +import io.holoinsight.server.common.service.AlertGroupService; +import io.holoinsight.server.common.service.AlertRuleService; +import io.holoinsight.server.common.service.AlertSubscribeService; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.converter.AlarmRuleConverter; import io.holoinsight.server.home.dal.mapper.CustomPluginMapper; -import io.holoinsight.server.home.dal.model.AlarmRule; -import io.holoinsight.server.home.dal.model.AlarmSubscribe; +import io.holoinsight.server.common.dao.entity.AlarmRule; +import io.holoinsight.server.common.dao.entity.AlarmSubscribe; import io.holoinsight.server.home.dal.model.CustomPlugin; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.dto.AlarmGroupDTO; -import io.holoinsight.server.home.dal.model.dto.AlarmSubscribeInfo; -import io.holoinsight.server.home.facade.AlarmHistoryDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; +import io.holoinsight.server.common.dao.entity.dto.AlarmGroupDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmSubscribeInfo; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.home.web.security.LevelAuthorizationAccess; import org.apache.commons.lang3.StringUtils; @@ -57,7 +57,7 @@ import java.util.Map; import java.util.stream.Collectors; -import static io.holoinsight.server.home.facade.AlarmRuleDTO.tryParseLink; +import static io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO.tryParseLink; /** * @author wangsiyuan diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmSubscribeFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmSubscribeFacadeImpl.java index 4a95712c7..30d899c00 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmSubscribeFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmSubscribeFacadeImpl.java @@ -4,23 +4,11 @@ package io.holoinsight.server.home.web.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.AlertSubscribeService; -import io.holoinsight.server.home.biz.ula.ULAFacade; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.ManageCallback; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.AlarmSubscribe; -import io.holoinsight.server.home.dal.model.dto.AlarmSubscribeDTO; -import io.holoinsight.server.home.dal.model.dto.AlarmSubscribeInfo; -import io.holoinsight.server.home.web.common.ParaCheckUtil; -import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.dao.entity.AlarmSubscribe; +import io.holoinsight.server.common.dao.entity.dto.AlarmSubscribeInfo; import io.holoinsight.server.home.web.security.ParameterSecurityService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -33,6 +21,18 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import io.holoinsight.server.common.JsonResult; +import io.holoinsight.server.common.service.AlertSubscribeService; +import io.holoinsight.server.home.biz.ula.ULAFacade; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.dto.AlarmSubscribeDTO; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.home.web.common.ParaCheckUtil; +import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import java.util.ArrayList; import java.util.List; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookFacadeImpl.java index a79e48ed3..575a167df 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookFacadeImpl.java @@ -24,23 +24,23 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.home.alert.service.AlertService; -import io.holoinsight.server.home.biz.service.AlertWebhookService; -import io.holoinsight.server.home.biz.service.UserOpLogService; +import io.holoinsight.server.common.service.AlertWebhookService; +import io.holoinsight.server.common.service.UserOpLogService; import io.holoinsight.server.home.common.service.query.WebhookResponse; -import io.holoinsight.server.home.common.util.MonitorException; +import io.holoinsight.server.common.MonitorException; import io.holoinsight.server.common.SSRFUtils; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.AlarmWebhook; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.AlarmWebhook; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.dto.AlarmWebhookDTO; -import io.holoinsight.server.home.dal.model.dto.AlarmWebhookTestDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.dao.entity.dto.AlarmWebhookDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmWebhookTestDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookTestCaseImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookTestCaseImpl.java index 53875bc84..13e30e6ab 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookTestCaseImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlarmWebhookTestCaseImpl.java @@ -7,7 +7,7 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.common.web.InternalWebApi; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertNotifyRecordController.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertNotifyRecordController.java index 5756b6cb6..13ff79f38 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertNotifyRecordController.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertNotifyRecordController.java @@ -4,15 +4,15 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.AlertNotifyRecordService; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.facade.AlertNotifyRecordDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.service.AlertNotifyRecordService; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.dto.AlertNotifyRecordDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertTemplateFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertTemplateFacadeImpl.java index c291d5a71..64e99172f 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertTemplateFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertTemplateFacadeImpl.java @@ -7,22 +7,22 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.converter.AlertTemplateConverter; -import io.holoinsight.server.home.dal.mapper.AlertTemplateMapper; -import io.holoinsight.server.home.dal.model.AlertTemplate; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.converter.AlertTemplateConverter; +import io.holoinsight.server.common.dao.mapper.AlertTemplateMapper; +import io.holoinsight.server.common.dao.entity.AlertTemplate; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.facade.AlertTemplateDTO; -import io.holoinsight.server.home.facade.AlertTemplateField; -import io.holoinsight.server.home.facade.NotificationTemplate; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.dao.entity.dto.AlertTemplateDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertTemplateField; +import io.holoinsight.server.common.dao.entity.dto.NotificationTemplate; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.home.web.security.LevelAuthorizationAccess; import lombok.extern.slf4j.Slf4j; @@ -44,7 +44,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.UUID; /** * alert template facade diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertmanagerWebhookImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertmanagerWebhookImpl.java index 07f5fc214..373fa53f4 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertmanagerWebhookImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/AlertmanagerWebhookImpl.java @@ -5,20 +5,20 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.AlertmanagerWebhookService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.converter.AlertmanagerWebhookConverter; -import io.holoinsight.server.home.dal.model.AlertmanagerWebhook; +import io.holoinsight.server.common.service.AlertmanagerWebhookService; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.converter.AlertmanagerWebhookConverter; +import io.holoinsight.server.common.dao.entity.AlertmanagerWebhook; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.dto.AlertmanagerWebhookDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.dao.entity.dto.AlertmanagerWebhookDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/ApiKeyFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/ApiKeyFacadeImpl.java index 60fa1173a..e111c995b 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/ApiKeyFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/ApiKeyFacadeImpl.java @@ -3,19 +3,19 @@ */ package io.holoinsight.server.home.web.controller; -import io.holoinsight.server.home.biz.service.ApiKeyService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.ApiKey; +import io.holoinsight.server.common.service.ApiKeyService; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.ApiKey; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.J; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/BaseFacade.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/BaseFacade.java index 1835288c3..9302ebc62 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/BaseFacade.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/BaseFacade.java @@ -4,9 +4,9 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.FacadeTemplate; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.FacadeTemplate; +import io.holoinsight.server.common.RequestContext; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.FastDateFormat; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/CustomPluginFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/CustomPluginFacadeImpl.java index b373c7e67..04df5f66a 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/CustomPluginFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/CustomPluginFacadeImpl.java @@ -7,27 +7,27 @@ import io.holoinsight.server.common.dao.entity.dto.MetricInfoDTO; import io.holoinsight.server.common.service.MetricInfoService; import io.holoinsight.server.home.biz.plugin.core.LogPluginUtil; -import io.holoinsight.server.home.biz.service.AlarmMetricService; +import io.holoinsight.server.common.service.AlarmMetricService; import io.holoinsight.server.home.biz.service.CustomPluginService; import io.holoinsight.server.home.biz.service.FolderService; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.AlarmMetric; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.AlarmMetric; import io.holoinsight.server.home.dal.model.Folder; import io.holoinsight.server.home.dal.model.OpType; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; import io.holoinsight.server.home.dal.model.dto.conf.CollectMetric; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.controller.model.LogSplitReq; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DashboardFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DashboardFacadeImpl.java index 3595bb19f..f12b5f105 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DashboardFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DashboardFacadeImpl.java @@ -5,22 +5,21 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.service.UserOpLogService; import io.holoinsight.server.home.biz.service.DashboardService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; import io.holoinsight.server.home.dal.model.Dashboard; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; import io.holoinsight.server.home.web.common.DashboardType; -import io.holoinsight.server.home.common.util.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.apache.commons.lang3.StringUtils; @@ -109,10 +108,10 @@ public void doManage() { if (null != mu) { update.setModifier(mu.getLoginName()); } - if (null != ms && !StringUtil.isBlank(ms.tenant)) { + if (null != ms && !StringUtils.isBlank(ms.tenant)) { update.setTenant(ms.tenant); } - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { update.setWorkspace(ms.workspace); } dashboardService.updateById(update); @@ -148,10 +147,10 @@ public void doManage() { request.setCreator(mu.getLoginName()); request.setModifier(mu.getLoginName()); } - if (null != ms && !StringUtil.isBlank(ms.tenant)) { + if (null != ms && !StringUtils.isBlank(ms.tenant)) { request.setTenant(ms.tenant); } - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { request.setWorkspace(ms.workspace); } request.setGmtModified(new Date()); diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DefaultTenantFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DefaultTenantFacadeImpl.java index 109018e9b..0a5bd8d2c 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DefaultTenantFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DefaultTenantFacadeImpl.java @@ -8,13 +8,13 @@ import io.holoinsight.server.common.dao.entity.TenantOps; import io.holoinsight.server.common.dao.entity.dto.TenantOpsDTO; import io.holoinsight.server.home.biz.service.TenantOpsService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.converter.TenantOpsConverter; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayMenuFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayMenuFacadeImpl.java index 17d0cfb23..c4186caac 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayMenuFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayMenuFacadeImpl.java @@ -6,16 +6,16 @@ import io.holoinsight.server.home.biz.common.MetaDictUtil; import io.holoinsight.server.home.biz.service.DisplayMenuService; import io.holoinsight.server.home.biz.service.IntegrationGeneratedService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.IntegrationGenerated; import io.holoinsight.server.home.dal.model.dto.DisplayMenuConfig; import io.holoinsight.server.home.dal.model.dto.DisplayMenuDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.JsonResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayTemplateFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayTemplateFacadeImpl.java index b8c2acf19..edf8d9fe9 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayTemplateFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/DisplayTemplateFacadeImpl.java @@ -4,12 +4,12 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.home.biz.service.DisplayTemplateService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.home.dal.model.dto.DisplayTemplateDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.JsonResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/FolderFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/FolderFacadeImpl.java index 9c17cdb5e..c1c2e38af 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/FolderFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/FolderFacadeImpl.java @@ -3,31 +3,31 @@ */ package io.holoinsight.server.home.web.controller; +import io.holoinsight.server.common.J; +import io.holoinsight.server.common.JsonResult; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.service.UserOpLogService; import io.holoinsight.server.home.biz.service.CustomPluginService; import io.holoinsight.server.home.biz.service.FolderService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; import io.holoinsight.server.home.dal.model.Folder; import io.holoinsight.server.home.dal.model.OpType; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; -import io.holoinsight.server.home.common.util.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.controller.model.FolderPath; import io.holoinsight.server.home.web.controller.model.FolderPaths; import io.holoinsight.server.home.web.controller.model.FolderRequest; import io.holoinsight.server.home.web.controller.model.FolderRequestCmd; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; -import io.holoinsight.server.common.J; -import io.holoinsight.server.common.JsonResult; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; @@ -104,10 +104,10 @@ public void doManage() { if (null != mu) { update.setModifier(mu.getLoginName()); } - if (null != ms && !StringUtil.isBlank(ms.tenant)) { + if (null != ms && !StringUtils.isBlank(ms.tenant)) { update.setTenant(ms.tenant); } - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { update.setWorkspace(ms.workspace); } update.setGmtModified(new Date()); @@ -145,11 +145,11 @@ public void doManage() { folder.setCreator(mu.getLoginName()); folder.setModifier(mu.getLoginName()); } - if (null != ms && !StringUtil.isBlank(ms.tenant)) { + if (null != ms && !StringUtils.isBlank(ms.tenant)) { folder.setTenant(ms.tenant); } - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { folder.setWorkspace(ms.workspace); } folder.setGmtCreate(new Date()); diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java index a634593a0..e1ee1e340 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/GPTFacadeImpl.java @@ -13,9 +13,9 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.home.biz.service.gpt.GptService; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.home.web.openai.FunctionRegistry; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/InitFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/InitFacadeImpl.java index 10ff43a47..33dac7acc 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/InitFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/InitFacadeImpl.java @@ -14,8 +14,8 @@ import javax.servlet.http.HttpServletResponse; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.springframework.beans.factory.annotation.Autowired; @@ -34,21 +34,21 @@ import io.holoinsight.server.common.dao.entity.dto.TenantOpsDTO; import io.holoinsight.server.common.dao.entity.dto.TenantOpsStorage; import io.holoinsight.server.common.dao.entity.dto.TenantOpsStorage.StorageMetric; -import io.holoinsight.server.home.biz.service.ApiKeyService; +import io.holoinsight.server.common.service.ApiKeyService; import io.holoinsight.server.home.biz.service.MetaTableService; import io.holoinsight.server.home.biz.service.TenantInitService; import io.holoinsight.server.home.biz.service.TenantOpsService; -import io.holoinsight.server.home.common.util.Debugger; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.ApiKey; +import io.holoinsight.server.common.Debugger; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.ApiKey; import io.holoinsight.server.home.dal.model.dto.MetaTableDTO; import io.holoinsight.server.home.dal.model.dto.MetaTableDTO.TableStatus; import io.holoinsight.server.home.dal.model.dto.meta.MetaTableCol; import io.holoinsight.server.home.dal.model.dto.meta.MetaTableConfig; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import lombok.extern.slf4j.Slf4j; /** diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationGeneratedFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationGeneratedFacadeImpl.java index 2fb1a9dd3..3568783d2 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationGeneratedFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationGeneratedFacadeImpl.java @@ -7,6 +7,11 @@ import com.google.gson.reflect.TypeToken; import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.home.biz.plugin.PluginRepository; import io.holoinsight.server.home.biz.plugin.config.LogPluginConfig; import io.holoinsight.server.home.biz.plugin.core.AbstractIntegrationPlugin; @@ -17,9 +22,8 @@ import io.holoinsight.server.home.biz.service.IntegrationPluginService; import io.holoinsight.server.home.biz.service.IntegrationProductService; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.*; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.MonitorException; import io.holoinsight.server.home.dal.model.IntegrationGenerated; import io.holoinsight.server.home.dal.model.OpType; import io.holoinsight.server.home.dal.model.dto.GaeaCollectConfigDTO.GaeaCollectRange; @@ -28,7 +32,7 @@ import io.holoinsight.server.home.dal.model.dto.IntegrationGeneratedDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.AllArgsConstructor; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationPluginFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationPluginFacadeImpl.java index ff7472a46..3b1533e2b 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationPluginFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationPluginFacadeImpl.java @@ -3,22 +3,21 @@ */ package io.holoinsight.server.home.web.controller; -import io.holoinsight.server.home.common.util.StringUtil; import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.service.UserOpLogService; import io.holoinsight.server.home.biz.service.IntegrationPluginService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; import io.holoinsight.server.home.dal.model.OpType; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; -import io.holoinsight.server.home.common.util.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.apache.commons.lang3.StringUtils; @@ -163,7 +162,7 @@ public void doManage() { integrationPluginDTO.setCreator(mu.getLoginName()); integrationPluginDTO.setModifier(mu.getLoginName()); } - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { integrationPluginDTO.setWorkspace(ms.workspace); } integrationPluginDTO.setStatus(true); @@ -223,7 +222,7 @@ public void doManage() { Map params = new HashMap<>(); params.put("tenant", MonitorCookieUtil.getTenantOrException()); params.put("product", name); - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { params.put("workspace", ms.workspace); } List integrationPluginDTOs = diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationProductFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationProductFacadeImpl.java index 3d5852b18..55d886d34 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationProductFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/IntegrationProductFacadeImpl.java @@ -4,20 +4,22 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.common.dao.entity.dto.MetricInfoDTO; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.common.service.MetricInfoService; import io.holoinsight.server.home.biz.service.IntegrationPluginService; import io.holoinsight.server.home.biz.service.IntegrationProductService; import io.holoinsight.server.home.common.service.QueryClientService; import io.holoinsight.server.home.common.service.query.QueryResponse; import io.holoinsight.server.home.common.service.query.Result; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.*; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; import io.holoinsight.server.home.dal.model.dto.IntegrationMetricDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationMetricsDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.JsonResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplacePluginFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplacePluginFacadeImpl.java index 314751bcc..830bc5b65 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplacePluginFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplacePluginFacadeImpl.java @@ -4,23 +4,23 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.home.biz.plugin.MarketplaceProductHandler; -import io.holoinsight.server.home.biz.service.AlertWebhookService; +import io.holoinsight.server.common.service.AlertWebhookService; import io.holoinsight.server.home.biz.service.MarketplacePluginService; import io.holoinsight.server.home.biz.service.MarketplaceProductService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.dto.AlarmWebhookDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmWebhookDTO; import io.holoinsight.server.home.dal.model.dto.MarketplacePluginDTO; import io.holoinsight.server.home.dal.model.dto.MarketplaceProductDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.J; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplaceProductFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplaceProductFacadeImpl.java index c8effa4b1..df3e0e6b7 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplaceProductFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MarketplaceProductFacadeImpl.java @@ -4,10 +4,10 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.home.biz.service.MarketplaceProductService; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.home.dal.model.dto.MarketplaceProductDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.JsonResult; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaFacadeImpl.java index de2790610..46e7ffcb4 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaFacadeImpl.java @@ -4,12 +4,12 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.JsonResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaTableFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaTableFacadeImpl.java index 427a74744..c52720315 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaTableFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetaTableFacadeImpl.java @@ -4,11 +4,11 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.home.biz.service.MetaTableService; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.home.dal.model.dto.MetaTableDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.JsonResult; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetricInfoFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetricInfoFacadeImpl.java index 19aa203dc..5fb570308 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetricInfoFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/MetricInfoFacadeImpl.java @@ -9,11 +9,13 @@ import io.holoinsight.server.common.service.MetricInfoService; import io.holoinsight.server.home.biz.plugin.MetricInfoCheckService; import io.holoinsight.server.home.biz.service.IntegrationProductService; -import io.holoinsight.server.home.common.util.ManageCallback; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; import io.holoinsight.server.home.task.MetricCrawlerConstant; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/OpenmetricsScraperFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/OpenmetricsScraperFacadeImpl.java index ea69f790c..988f658f9 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/OpenmetricsScraperFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/OpenmetricsScraperFacadeImpl.java @@ -6,17 +6,17 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.home.biz.service.OpenmetricsScraperService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.OpType; import io.holoinsight.server.home.dal.model.dto.OpenmetricsScraperDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java index 3c3bea20f..cca4266d6 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/QueryFacadeImpl.java @@ -4,15 +4,26 @@ package io.holoinsight.server.home.web.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.holoinsight.server.common.J; -import io.holoinsight.server.common.JsonResult; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Message; import com.google.protobuf.util.JsonFormat; +import io.holoinsight.server.common.J; +import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.common.LatchWork; +import io.holoinsight.server.common.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ResultCodeEnum; import io.holoinsight.server.common.UtilMisc; import io.holoinsight.server.common.dao.entity.MetricInfo; import io.holoinsight.server.common.dao.mapper.MetricInfoMapper; +import io.holoinsight.server.common.model.DataQueryRequest; +import io.holoinsight.server.common.model.DataQueryRequest.QueryDataSource; +import io.holoinsight.server.common.model.DataQueryRequest.QueryFilter; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.common.service.SuperCacheService; import io.holoinsight.server.common.threadpool.CommonThreadPools; import io.holoinsight.server.home.biz.common.MetaDictUtil; @@ -23,22 +34,10 @@ import io.holoinsight.server.home.common.service.query.QuerySchemaResponse; import io.holoinsight.server.home.common.service.query.Result; import io.holoinsight.server.home.common.service.query.ValueResult; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.common.util.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.common.PqlParser; import io.holoinsight.server.home.web.common.TokenUrls; import io.holoinsight.server.home.web.common.pql.PqlException; -import io.holoinsight.server.common.model.DataQueryRequest; -import io.holoinsight.server.common.model.DataQueryRequest.QueryDataSource; -import io.holoinsight.server.common.model.DataQueryRequest.QueryFilter; import io.holoinsight.server.home.web.controller.model.DelTagReq; import io.holoinsight.server.home.web.controller.model.PqlInstanceRequest; import io.holoinsight.server.home.web.controller.model.PqlParseRequest; @@ -610,13 +609,13 @@ public QueryProto.QueryRequest convertRequest(DataQueryRequest request, MonitorS MonitorUser mu) { QueryProto.QueryRequest.Builder builder = QueryProto.QueryRequest.newBuilder(); builder.setTenant(tenantInitService.getTsdbTenant(ms.getTenant())); - if (StringUtil.isNotBlank(request.getQuery())) { + if (StringUtils.isNotBlank(request.getQuery())) { builder.setQuery(request.getQuery()); } - if (StringUtil.isNotBlank(request.getDownsample())) { + if (StringUtils.isNotBlank(request.getDownsample())) { builder.setDownsample(request.getDownsample()); } - if (StringUtil.isNotBlank(request.getFillPolicy())) { + if (StringUtils.isNotBlank(request.getFillPolicy())) { builder.setFillPolicy(request.getFillPolicy()); } diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SearchFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SearchFacadeImpl.java index 2dd747db5..1b1016035 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SearchFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SearchFacadeImpl.java @@ -5,19 +5,19 @@ import io.holoinsight.server.common.dao.entity.dto.MetricInfoDTO; import io.holoinsight.server.common.service.MetricInfoService; -import io.holoinsight.server.home.biz.service.AlertRuleService; +import io.holoinsight.server.common.service.AlertRuleService; import io.holoinsight.server.home.biz.service.CustomPluginService; import io.holoinsight.server.home.biz.service.DashboardService; import io.holoinsight.server.home.biz.service.FolderService; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.common.util.CommonThreadPool; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.CommonThreadPool; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.Folder; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SysFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SysFacadeImpl.java index 451d76ee5..47d837c93 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SysFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/SysFacadeImpl.java @@ -7,9 +7,9 @@ import io.holoinsight.server.common.config.EnvironmentProperties; import io.holoinsight.server.home.biz.ula.ULAFacade; import io.holoinsight.server.home.biz.common.MetaDictUtil; -import io.holoinsight.server.home.common.util.GlobalFlag; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.GlobalFlag; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; import io.holoinsight.server.home.web.common.TokenUrls; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TokenQueryFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TokenQueryFacadeImpl.java index c4f4673ae..688464f62 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TokenQueryFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TokenQueryFacadeImpl.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.web.controller; import io.holoinsight.server.home.biz.access.MonitorAccessService; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.controller.model.TokenQueryRequest; import io.holoinsight.server.common.JsonResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceAgentFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceAgentFacadeImpl.java index aa1eb6e2f..d824266a4 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceAgentFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceAgentFacadeImpl.java @@ -8,21 +8,21 @@ import io.holoinsight.server.home.biz.common.MetaDictKey; import io.holoinsight.server.home.biz.common.MetaDictType; import io.holoinsight.server.home.biz.common.MetaDictUtil; -import io.holoinsight.server.home.biz.service.ApiKeyService; +import io.holoinsight.server.common.service.ApiKeyService; import io.holoinsight.server.home.biz.service.TenantInitService; import io.holoinsight.server.home.biz.service.TraceAgentConfPropService; import io.holoinsight.server.home.biz.service.TraceAgentConfigurationService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.ApiKey; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.ApiKey; import io.holoinsight.server.home.dal.model.TraceAgentConfProp; import io.holoinsight.server.home.dal.model.TraceAgentConfiguration; import io.holoinsight.server.common.AesUtil; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.config.TraceAuthEncryptConfiguration; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceQueryFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceQueryFacadeImpl.java index b620b12a0..e4870f016 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceQueryFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/TraceQueryFacadeImpl.java @@ -17,12 +17,12 @@ import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.home.biz.service.TenantInitService; import io.holoinsight.server.home.common.service.QueryClientService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.common.TokenUrls; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFacadeImpl.java index 40f19deca..c6c28150d 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFacadeImpl.java @@ -6,14 +6,14 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.home.biz.ula.ULAFacade; -import io.holoinsight.server.home.common.util.Debugger; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorAuth; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.Debugger; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorAuth; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFavoriteFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFavoriteFacadeImpl.java index 8c8fc09af..94dc43be6 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFavoriteFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserFavoriteFacadeImpl.java @@ -8,26 +8,25 @@ import io.holoinsight.server.home.biz.service.FolderService; import io.holoinsight.server.home.biz.service.IntegrationProductService; import io.holoinsight.server.home.biz.service.TenantInitService; -import io.holoinsight.server.home.biz.service.UserFavoriteService; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.service.UserFavoriteService; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.Dashboard; import io.holoinsight.server.home.dal.model.Folder; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.UserFavorite; +import io.holoinsight.server.common.dao.entity.UserFavorite; import io.holoinsight.server.home.dal.model.dto.CustomPluginDTO; import io.holoinsight.server.home.dal.model.dto.IntegrationProductDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.controller.model.FavRequest; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; @@ -191,10 +190,10 @@ public void doManage() { if (null != mu) { userFavorite.setUserLoginName(mu.getLoginName()); } - if (null != ms && !StringUtil.isBlank(ms.tenant)) { + if (null != ms && !StringUtils.isBlank(ms.tenant)) { userFavorite.setTenant(ms.tenant); } - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { userFavorite.setWorkspace(ms.workspace); } userFavorite.setGmtCreate(new Date()); @@ -282,7 +281,7 @@ public void doManage() { MonitorScope ms = RequestContext.getContext().ms; MonitorUser mu = RequestContext.getContext().mu; - if (StringUtil.isBlank(favRequest.getUserLoginName())) { + if (StringUtils.isBlank(favRequest.getUserLoginName())) { favRequest.setUserLoginName(mu.getLoginName()); } @@ -320,10 +319,10 @@ public void checkParameter() { @Override public void doManage() { MonitorScope ms = RequestContext.getContext().ms; - if (null != ms && !StringUtil.isBlank(ms.tenant)) { + if (null != ms && !StringUtils.isBlank(ms.tenant)) { userFavoriteRequest.getTarget().setTenant(ms.tenant); } - if (null != ms && !StringUtil.isBlank(ms.workspace)) { + if (null != ms && !StringUtils.isBlank(ms.workspace)) { userFavoriteRequest.getTarget().setWorkspace(ms.workspace); } if (StringUtils.isEmpty(userFavoriteRequest.getTarget().getUserLoginName())) { diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserOpLogFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserOpLogFacadeImpl.java index 2ae46fa76..3b97fc156 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserOpLogFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserOpLogFacadeImpl.java @@ -3,17 +3,17 @@ */ package io.holoinsight.server.home.web.controller; -import io.holoinsight.server.home.biz.service.UserOpLogService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.page.MonitorTimePageRequest; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.model.UserOpLog; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.service.UserOpLogService; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.MonitorTimePageRequest; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.UserOpLog; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import io.holoinsight.server.common.JsonResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoFacadeImpl.java index 5fb94cf99..eda83af44 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoFacadeImpl.java @@ -6,24 +6,24 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.biz.service.UserOpLogService; +import io.holoinsight.server.common.service.UserOpLogService; import io.holoinsight.server.home.biz.ula.ULAFacade; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.converter.UserinfoConverter; -import io.holoinsight.server.home.dal.mapper.UserinfoMapper; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.converter.UserinfoConverter; +import io.holoinsight.server.common.dao.mapper.UserinfoMapper; import io.holoinsight.server.home.dal.mapper.UserinfoVerificationMapper; import io.holoinsight.server.home.dal.model.OpType; -import io.holoinsight.server.home.dal.model.Userinfo; +import io.holoinsight.server.common.dao.entity.Userinfo; import io.holoinsight.server.home.dal.model.UserinfoVerification; -import io.holoinsight.server.home.facade.UserinfoDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.page.MonitorPageResult; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.dao.entity.dto.UserinfoDTO; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageResult; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoVerificationFacadeImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoVerificationFacadeImpl.java index a26c467e5..834a920d3 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoVerificationFacadeImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/controller/UserinfoVerificationFacadeImpl.java @@ -8,19 +8,19 @@ import io.holoinsight.server.common.JsonResult; import io.holoinsight.server.common.dao.entity.MetaDataDictValue; import io.holoinsight.server.common.dao.mapper.MetaDataDictValueMapper; -import io.holoinsight.server.home.biz.service.UserOpLogService; +import io.holoinsight.server.common.service.UserOpLogService; import io.holoinsight.server.home.biz.service.UserinfoVerificationService; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.mapper.UserinfoVerificationMapper; import io.holoinsight.server.home.dal.model.OpType; import io.holoinsight.server.home.dal.model.UserinfoVerification; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.common.util.ManageCallback; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.ManageCallback; import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.interceptor.MonitorScopeAuth; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step2IdentityFilter.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step2IdentityFilter.java index 9f979c44f..d5273a734 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step2IdentityFilter.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step2IdentityFilter.java @@ -3,18 +3,17 @@ */ package io.holoinsight.server.home.web.filter; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.IdentityType; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.home.biz.access.MonitorAccessService; import io.holoinsight.server.home.biz.common.MetaDictUtil; import io.holoinsight.server.home.biz.ula.ULAFacade; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.web.config.RestAuthUtil; -import io.holoinsight.server.home.biz.access.MonitorAccessService; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.common.util.scope.IdentityType; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorUser; import io.holoinsight.server.home.web.common.TokenUrlFactoryHolder; +import io.holoinsight.server.home.web.config.RestAuthUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -73,7 +72,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo public boolean identity(HttpServletRequest req, HttpServletResponse resp) throws IOException { // token 降级 String token = req.getHeader("apiToken"); - if (StringUtil.isNotBlank(token)) { + if (StringUtils.isNotBlank(token)) { return tokenCheck(token, req, resp); } @@ -110,7 +109,7 @@ public boolean userCheck(HttpServletRequest req, HttpServletResponse resp) throw if (userCookie != null && user != null) { // double check 校验用户cookies里面的tenant和 用户信息里面的cookies 是否一致 String tenantCookie = MonitorCookieUtil.getTenantCookie(req); - if (StringUtil.isNotBlank(user.getLoginTenant()) + if (StringUtils.isNotBlank(user.getLoginTenant()) && user.getLoginTenant().equalsIgnoreCase(tenantCookie) && (user.getIdentityType() != IdentityType.INNER)) { // cookie存在,用户存在 diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step3AuthFilter.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step3AuthFilter.java index 5a117d51e..f5434a006 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step3AuthFilter.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step3AuthFilter.java @@ -3,22 +3,21 @@ */ package io.holoinsight.server.home.web.filter; -import io.holoinsight.server.home.common.util.MonitorException; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.MonitorParams; -import io.holoinsight.server.home.web.config.RestAuthUtil; +import io.holoinsight.server.common.Debugger; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.biz.ula.ULAFacade; +import io.holoinsight.server.common.MonitorException; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.RequestContext.Context; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.IdentityType; +import io.holoinsight.server.common.scope.MonitorAuth; +import io.holoinsight.server.common.scope.MonitorCookieUtil; +import io.holoinsight.server.common.scope.MonitorParams; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; import io.holoinsight.server.home.biz.common.MetaDictUtil; -import io.holoinsight.server.home.common.util.Debugger; -import io.holoinsight.server.home.common.util.StringUtil; -import io.holoinsight.server.home.common.util.scope.IdentityType; -import io.holoinsight.server.home.common.util.scope.MonitorAuth; -import io.holoinsight.server.home.common.util.scope.MonitorCookieUtil; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.common.util.scope.RequestContext.Context; +import io.holoinsight.server.home.biz.ula.ULAFacade; +import io.holoinsight.server.home.web.config.RestAuthUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -85,7 +84,7 @@ public boolean auth(HttpServletRequest req, HttpServletResponse resp) throws Thr if (IdentityType.OUTTOKEN.equals(mu.getIdentityType()) || MetaDictUtil.getUlaClose()) { String token = req.getHeader("apiToken"); // 接口权限判定 - if (!ulaFacade.authFunc(req) && StringUtil.isBlank(token)) { + if (!ulaFacade.authFunc(req) && StringUtils.isBlank(token)) { log.warn("{} authFunc check failed", RequestContext.getTrace()); authFailedResponse(resp, HttpServletResponse.SC_FORBIDDEN, "权限不足,请联系账号管理员", ResultCodeEnum.AUTH_CHECK_ERROR); diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step4AccessLogFilter.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step4AccessLogFilter.java index ac5a78b73..7bd1782fe 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step4AccessLogFilter.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/filter/Step4AccessLogFilter.java @@ -3,8 +3,8 @@ */ package io.holoinsight.server.home.web.filter; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.web.common.ResponseUtil; import io.holoinsight.server.home.web.wrapper.CountServletResponseWrapper; import lombok.extern.slf4j.Slf4j; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/grpc/HelloServiceGrpcImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/grpc/HelloServiceGrpcImpl.java deleted file mode 100644 index db0b62ba8..000000000 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/grpc/HelloServiceGrpcImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -package io.holoinsight.server.home.web.grpc; - -import io.holoinsight.server.home.proto.hello.HelloRequest; -import io.holoinsight.server.home.proto.hello.HelloResponse; -import io.holoinsight.server.home.proto.hello.HelloServiceGrpc; -import lombok.extern.slf4j.Slf4j; -import net.devh.boot.grpc.server.service.GrpcService; - -/** - * - * @author jsy1001de - * @version 1.0: HelloServiceGrpcImpl.java, v 0.1 2022年06月13日 5:42 下午 jinsong.yjs Exp $ - */ -@GrpcService -@Slf4j -public class HelloServiceGrpcImpl extends HelloServiceGrpc.HelloServiceImplBase { - - public void hello(HelloRequest request, - io.grpc.stub.StreamObserver responseObserver) { - // System.out.println(request); - - String greeting = "Hi " + request.getName() + " you are " + request.getAge() + " years old" - + " your hoby is " + (request.getHobbiesList()) + " your tags " + request.getTagsMap(); - - HelloResponse response = HelloResponse.newBuilder().setGreeting(greeting).build(); - responseObserver.onNext(response); - responseObserver.onCompleted(); - - log.info("end add"); - } -} diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuth.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuth.java index d4d9f08bf..2dd94d547 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuth.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuth.java @@ -3,8 +3,8 @@ */ package io.holoinsight.server.home.web.interceptor; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.PowerConstants; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.PowerConstants; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuthInterceptor.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuthInterceptor.java index fd7693085..64e21aa44 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuthInterceptor.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/interceptor/MonitorScopeAuthInterceptor.java @@ -14,16 +14,16 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.JsonResult; -import io.holoinsight.server.home.common.util.ResultCodeEnum; -import io.holoinsight.server.home.common.util.scope.AuthTarget; -import io.holoinsight.server.home.common.util.scope.AuthTargetType; -import io.holoinsight.server.home.common.util.scope.IdentityType; -import io.holoinsight.server.home.common.util.scope.MonitorAuth; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.PowerConstants; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.common.util.scope.RequestContext.Context; +import io.holoinsight.server.common.ResultCodeEnum; +import io.holoinsight.server.common.scope.AuthTarget; +import io.holoinsight.server.common.scope.AuthTargetType; +import io.holoinsight.server.common.scope.IdentityType; +import io.holoinsight.server.common.scope.MonitorAuth; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.scope.PowerConstants; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.RequestContext.Context; import lombok.extern.slf4j.Slf4j; /** diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/AlarmRuleFcService.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/AlarmRuleFcService.java index ee79a9da4..75fa58152 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/AlarmRuleFcService.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/AlarmRuleFcService.java @@ -8,23 +8,23 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.dao.entity.MetricInfo; import io.holoinsight.server.common.dao.mapper.MetricInfoMapper; -import io.holoinsight.server.home.biz.service.AlertRuleService; +import io.holoinsight.server.common.service.AlertRuleService; import io.holoinsight.server.home.biz.service.openai.OpenAiService; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.model.openai.AlertRuleType; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.TimeFilter; -import io.holoinsight.server.home.facade.emuns.AlertLevel; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.emuns.TimeFilterEnum; -import io.holoinsight.server.home.facade.trigger.CompareConfig; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.TimeFilter; +import io.holoinsight.server.common.dao.emuns.AlertLevel; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.TimeFilterEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -121,10 +121,10 @@ private MetricInfo findMetricInfo(String requestId, String description) { private Map buildRule(List compareConfigs, String ruleDescribe, MetricInfo metricInfo) { - Rule alertRule = new Rule(); - alertRule.setBoolOperation(BoolOperationEnum.AND); - alertRule.setTriggers(buildTriggers(compareConfigs, ruleDescribe, metricInfo)); - return J.toMap(J.toJson(alertRule)); + AlarmRuleConf alertAlarmRuleConf = new AlarmRuleConf(); + alertAlarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alertAlarmRuleConf.setTriggers(buildTriggers(compareConfigs, ruleDescribe, metricInfo)); + return J.toMap(J.toJson(alertAlarmRuleConf)); } private String slidingWindowAggregator = "avg"; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/CustomPluginFcService.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/CustomPluginFcService.java index d00c9e7e0..288c8056d 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/CustomPluginFcService.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/openai/CustomPluginFcService.java @@ -7,8 +7,8 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.home.biz.service.CustomPluginService; import io.holoinsight.server.home.biz.service.openai.OpenAiService; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.RequestContext; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.RequestContext; import io.holoinsight.server.home.dal.mapper.CustomPluginMapper; import io.holoinsight.server.home.dal.model.CustomPlugin; import io.holoinsight.server.home.dal.model.dto.CloudMonitorRange; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/LevelAuthorizationCheck.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/LevelAuthorizationCheck.java index 0267bea12..cdc47a419 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/LevelAuthorizationCheck.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/LevelAuthorizationCheck.java @@ -3,7 +3,7 @@ */ package io.holoinsight.server.home.web.security; -import io.holoinsight.server.home.facade.utils.ParaCheckUtil; +import io.holoinsight.server.home.web.common.ParaCheckUtil; import org.aopalliance.intercept.MethodInvocation; import org.apache.commons.lang3.StringUtils; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityService.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityService.java index 8f2f818b9..f8ceefb4b 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityService.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityService.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.web.security; import io.holoinsight.server.common.model.DataQueryRequest; -import io.holoinsight.server.home.common.util.scope.MonitorUser; +import io.holoinsight.server.common.scope.MonitorUser; import java.util.List; import java.util.Map; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityServiceImpl.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityServiceImpl.java index ece042dc9..201d076d3 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityServiceImpl.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/ParameterSecurityServiceImpl.java @@ -4,7 +4,7 @@ package io.holoinsight.server.home.web.security; import io.holoinsight.server.common.model.DataQueryRequest; -import io.holoinsight.server.home.common.util.scope.MonitorUser; +import io.holoinsight.server.common.scope.MonitorUser; import org.apache.commons.lang3.StringUtils; import java.util.Collections; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AbstractQueryChecker.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AbstractQueryChecker.java index 65e169f28..93f5c262e 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AbstractQueryChecker.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AbstractQueryChecker.java @@ -5,7 +5,7 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.common.model.DataQueryRequest; -import io.holoinsight.server.home.facade.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; import io.holoinsight.server.home.web.security.ApiSecurityService; import io.holoinsight.server.home.web.security.LevelAuthorizationCheck; import io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmBlockFacadeImplChecker.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmBlockFacadeImplChecker.java index 54e7a6aff..8920b8dcf 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmBlockFacadeImplChecker.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmBlockFacadeImplChecker.java @@ -6,14 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.reflect.TypeToken; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.mapper.AlarmBlockMapper; -import io.holoinsight.server.home.dal.mapper.AlarmRuleMapper; -import io.holoinsight.server.home.dal.model.AlarmBlock; -import io.holoinsight.server.home.dal.model.AlarmRule; -import io.holoinsight.server.home.dal.model.dto.AlarmBlockDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.mapper.AlarmBlockMapper; +import io.holoinsight.server.common.dao.mapper.AlarmRuleMapper; +import io.holoinsight.server.common.dao.entity.AlarmBlock; +import io.holoinsight.server.common.dao.entity.AlarmRule; +import io.holoinsight.server.common.dao.entity.dto.AlarmBlockDTO; +import io.holoinsight.server.common.MonitorPageRequest; import io.holoinsight.server.home.web.security.LevelAuthorizationCheck; import io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult; import io.holoinsight.server.home.web.security.LevelAuthorizationMetaData; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmDingDingRobotFacadeImplChecker.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmDingDingRobotFacadeImplChecker.java index db207f9c3..2ab751207 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmDingDingRobotFacadeImplChecker.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmDingDingRobotFacadeImplChecker.java @@ -6,14 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.reflect.TypeToken; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.mapper.AlarmDingDingRobotMapper; -import io.holoinsight.server.home.dal.model.AlarmDingDingRobot; -import io.holoinsight.server.home.dal.model.dto.AlarmDingDingRobotDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.mapper.AlarmDingDingRobotMapper; +import io.holoinsight.server.common.dao.entity.AlarmDingDingRobot; +import io.holoinsight.server.common.dao.entity.dto.AlarmDingDingRobotDTO; +import io.holoinsight.server.common.MonitorPageRequest; import io.holoinsight.server.home.web.security.LevelAuthorizationCheck; import io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult; import io.holoinsight.server.home.web.security.LevelAuthorizationMetaData; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmHistoryFacadeImplChecker.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmHistoryFacadeImplChecker.java index 4128cbe9a..be5002b51 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmHistoryFacadeImplChecker.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmHistoryFacadeImplChecker.java @@ -6,12 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.reflect.TypeToken; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.mapper.AlarmHistoryMapper; -import io.holoinsight.server.home.dal.model.AlarmHistory; -import io.holoinsight.server.home.facade.AlarmHistoryDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.mapper.AlarmHistoryMapper; +import io.holoinsight.server.common.dao.entity.AlarmHistory; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDTO; +import io.holoinsight.server.common.MonitorPageRequest; import io.holoinsight.server.home.web.security.LevelAuthorizationCheck; import io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult; import io.holoinsight.server.home.web.security.LevelAuthorizationMetaData; diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmRuleLevelAuthorizationChecker.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmRuleLevelAuthorizationChecker.java index fb627310b..f1ace1553 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmRuleLevelAuthorizationChecker.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlarmRuleLevelAuthorizationChecker.java @@ -7,24 +7,25 @@ import com.google.common.reflect.TypeToken; import io.holoinsight.server.common.J; import io.holoinsight.server.common.dao.entity.MetricInfo; -import io.holoinsight.server.home.common.service.RequestContextAdapter; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.mapper.AlarmRuleMapper; -import io.holoinsight.server.home.dal.mapper.AlertTemplateMapper; -import io.holoinsight.server.home.dal.model.AlarmRule; -import io.holoinsight.server.home.dal.model.AlertTemplate; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.AlertRuleExtra; -import io.holoinsight.server.home.facade.AlertSilenceConfig; -import io.holoinsight.server.home.facade.NotificationConfig; -import io.holoinsight.server.home.facade.NotificationTemplate; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.TimeFilter; -import io.holoinsight.server.home.facade.emuns.TimeFilterEnum; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.trigger.CompareConfig; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.service.RequestContextAdapter; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.mapper.AlarmRuleMapper; +import io.holoinsight.server.common.dao.mapper.AlertTemplateMapper; +import io.holoinsight.server.common.dao.entity.AlarmRule; +import io.holoinsight.server.common.dao.entity.AlertTemplate; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.AlertRuleExtra; +import io.holoinsight.server.common.dao.entity.dto.AlertSilenceConfig; +import io.holoinsight.server.common.dao.entity.dto.NotificationConfig; +import io.holoinsight.server.common.dao.entity.dto.NotificationTemplate; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.TimeFilter; +import io.holoinsight.server.common.dao.emuns.TimeFilterEnum; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; +import io.holoinsight.server.home.web.common.ParaCheckUtil; import io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult; import io.holoinsight.server.home.web.security.LevelAuthorizationMetaData; import lombok.extern.slf4j.Slf4j; @@ -45,7 +46,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static io.holoinsight.server.home.facade.utils.ParaCheckUtil.sqlCnNameCheck; import static io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult.failCheckResult; import static io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult.successCheckResult; @@ -259,7 +259,7 @@ private LevelAuthorizationCheckResult checkAlarmRuleDTO(String methodName, } if (StringUtils.isNotEmpty(alarmRuleDTO.getRuleDescribe()) - && !sqlCnNameCheck(alarmRuleDTO.getRuleDescribe())) { + && !ParaCheckUtil.sqlCnNameCheck(alarmRuleDTO.getRuleDescribe())) { return failCheckResult( "invalid ruleDescribe %s, please use a-z A-Z 0-9 Chinese - _ , . : spaces ", alarmRuleDTO.getRuleDescribe()); @@ -275,7 +275,7 @@ private LevelAuthorizationCheckResult checkAlarmRuleDTO(String methodName, if (!CollectionUtils.isEmpty(alarmRuleDTO.getAlarmContent())) { for (String content : alarmRuleDTO.getAlarmContent()) { - if (!sqlCnNameCheck(content)) { + if (!ParaCheckUtil.sqlCnNameCheck(content)) { return failCheckResult("invalid content %s in alarmContent", content); } } @@ -350,11 +350,11 @@ private LevelAuthorizationCheckResult checkAlarmRuleDTO(String methodName, private LevelAuthorizationCheckResult checkRule(Map ruleMap, String tenant, String workspace) { - Rule rule = J.fromJson(J.toJson(ruleMap), Rule.class); - if (CollectionUtils.isEmpty(rule.getTriggers())) { + AlarmRuleConf alarmRuleConf = J.fromJson(J.toJson(ruleMap), AlarmRuleConf.class); + if (CollectionUtils.isEmpty(alarmRuleConf.getTriggers())) { return successCheckResult(); } - for (Trigger trigger : rule.getTriggers()) { + for (Trigger trigger : alarmRuleConf.getTriggers()) { if (!CollectionUtils.isEmpty(trigger.getDatasources())) { LevelAuthorizationCheckResult checkResult = checkDatasources(trigger.getDatasources(), tenant, workspace); @@ -373,7 +373,7 @@ private LevelAuthorizationCheckResult checkRule(Map ruleMap, Str } if (StringUtils.isNotEmpty(trigger.getTriggerContent()) - && !sqlCnNameCheck(trigger.getTriggerContent())) { + && !ParaCheckUtil.sqlCnNameCheck(trigger.getTriggerContent())) { return failCheckResult("fail to check triggerContent %s", trigger.getTriggerContent()); } @@ -475,7 +475,7 @@ private LevelAuthorizationCheckResult checkCompareConfigs(List co config.getTriggerLevel()); } if (StringUtils.isNotEmpty(config.getTriggerContent()) - && !sqlCnNameCheck(config.getTriggerContent())) { + && !ParaCheckUtil.sqlCnNameCheck(config.getTriggerContent())) { return failCheckResult("fail to check triggerContent in compareConfigs %s", config.getTriggerContent()); } diff --git a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlertTemplateFacadeImplChecker.java b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlertTemplateFacadeImplChecker.java index 779e2e8a4..359a88492 100644 --- a/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlertTemplateFacadeImplChecker.java +++ b/server/home/home-web/src/main/java/io/holoinsight/server/home/web/security/custom/AlertTemplateFacadeImplChecker.java @@ -6,13 +6,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.reflect.TypeToken; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.mapper.AlertTemplateMapper; -import io.holoinsight.server.home.dal.model.AlertTemplate; -import io.holoinsight.server.home.facade.AlertTemplateDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.mapper.AlertTemplateMapper; +import io.holoinsight.server.common.dao.entity.AlertTemplate; +import io.holoinsight.server.common.dao.entity.dto.AlertTemplateDTO; +import io.holoinsight.server.common.MonitorPageRequest; import io.holoinsight.server.home.web.security.LevelAuthorizationCheck; import io.holoinsight.server.home.web.security.LevelAuthorizationCheckResult; import io.holoinsight.server.home.web.security.LevelAuthorizationMetaData; diff --git a/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java b/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java index 97125242b..d74ce7af0 100644 --- a/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java +++ b/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java @@ -4,18 +4,18 @@ package io.holoinsight.server.home.web.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import io.holoinsight.server.home.biz.service.AlertGroupService; -import io.holoinsight.server.home.biz.service.AlertRuleService; -import io.holoinsight.server.home.biz.service.AlertSubscribeService; -import io.holoinsight.server.home.common.service.RequestContextAdapterImpl; -import io.holoinsight.server.home.common.util.scope.MonitorScope; -import io.holoinsight.server.home.common.util.scope.MonitorUser; -import io.holoinsight.server.home.common.util.scope.RequestContext; -import io.holoinsight.server.home.dal.converter.AlarmRuleConverterImpl; -import io.holoinsight.server.home.dal.model.AlarmRule; -import io.holoinsight.server.home.dal.model.dto.AlarmGroupDTO; -import io.holoinsight.server.home.dal.model.dto.AlarmSubscribeInfo; -import io.holoinsight.server.home.facade.AlarmRuleDTO; +import io.holoinsight.server.common.dao.converter.AlarmRuleConverterImpl; +import io.holoinsight.server.common.service.AlertGroupService; +import io.holoinsight.server.common.service.AlertRuleService; +import io.holoinsight.server.common.service.AlertSubscribeService; +import io.holoinsight.server.common.service.impl.RequestContextAdapterImpl; +import io.holoinsight.server.common.scope.MonitorScope; +import io.holoinsight.server.common.scope.MonitorUser; +import io.holoinsight.server.common.RequestContext; +import io.holoinsight.server.common.dao.entity.AlarmRule; +import io.holoinsight.server.common.dao.entity.dto.AlarmGroupDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmSubscribeInfo; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/query/query-dal/pom.xml b/server/query/query-dal/pom.xml deleted file mode 100644 index d9b2928ad..000000000 --- a/server/query/query-dal/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - server-parent - io.holoinsight.server - 1.0.0-SNAPSHOT - ../../server-parent/pom.xml - - 4.0.0 - - query-dal - - - - - com.baomidou - mybatis-plus-boot-starter - - - - \ No newline at end of file diff --git a/server/query/query-dal/src/main/java/io/holoinsight/server/query/dal/mapper/TenantOpsMapper.java b/server/query/query-dal/src/main/java/io/holoinsight/server/query/dal/mapper/TenantOpsMapper.java deleted file mode 100644 index 88c1e665a..000000000 --- a/server/query/query-dal/src/main/java/io/holoinsight/server/query/dal/mapper/TenantOpsMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// package io.holoinsight.server.query.dal.mapper; -// -// import io.holoinsight.server.query.dal.model.TenantOps; -// -// import org.springframework.stereotype.Repository; -// -// import com.baomidou.mybatisplus.core.mapper.BaseMapper; -// -/// ** -// * -// * @author xiangwanpeng -// * @version : TenantMapper.java, v 0.1 2022年04月29日 14:28 xiangwanpeng Exp $ -// */ -// @Repository -// public interface TenantOpsMapper extends BaseMapper { -// } diff --git a/server/query/query-dal/src/main/java/io/holoinsight/server/query/dal/model/TenantOps.java b/server/query/query-dal/src/main/java/io/holoinsight/server/query/dal/model/TenantOps.java deleted file mode 100644 index 3e5b8c726..000000000 --- a/server/query/query-dal/src/main/java/io/holoinsight/server/query/dal/model/TenantOps.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. - */ -// package io.holoinsight.server.query.dal.model; -// -// import com.baomidou.mybatisplus.annotation.IdType; -// import com.baomidou.mybatisplus.annotation.TableField; -// import com.baomidou.mybatisplus.annotation.TableId; -// import com.baomidou.mybatisplus.annotation.TableName; -// import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; -// import lombok.Data; -// import java.util.Map; -// -/// ** -// * -// * @author xiangwanpeng -// * @version : Tenant.java, v 0.1 2022年04月29日 14:09 xiangwanpeng Exp $ -// */ -// @Data -// @TableName(autoResultMap = true) -// public class TenantOps { -// @TableId(type = IdType.AUTO) -// public Long id; -// public String tenant; -// @TableField(typeHandler = JacksonTypeHandler.class) -// public Map storage; -// } diff --git a/server/query/query-service/pom.xml b/server/query/query-service/pom.xml index 2a9fd12fc..2e35ed8b1 100644 --- a/server/query/query-service/pom.xml +++ b/server/query/query-service/pom.xml @@ -13,11 +13,6 @@ query-service - - io.holoinsight.server - query-dal - ${project.version} - io.holoinsight.server extension-storage-ceresdbx diff --git a/server/server-parent/pom.xml b/server/server-parent/pom.xml index b708eefd6..c8fe3c78e 100644 --- a/server/server-parent/pom.xml +++ b/server/server-parent/pom.xml @@ -40,7 +40,6 @@ ../query/query-service ../query/query-bootstrap ../query/query-client - ../query/query-dal ../query/query-server ../query/query-boot ../query/query-grpc-gen @@ -58,8 +57,6 @@ ../home/home-alert ../home/home-dal ../home/home-common - ../home/home-facade - ../home/home-proto ../home/home-bootstrap ../home/home-boot ../home/home-service diff --git a/test/scenes/scene-default/data.sql b/test/scenes/scene-default/data.sql index 8e25a7857..e95953882 100644 --- a/test/scenes/scene-default/data.sql +++ b/test/scenes/scene-default/data.sql @@ -49,7 +49,7 @@ INSERT INTO `holoinsight`.`custom_plugin` (`id`, `tenant`, `workspace`, `parent_ INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (13, '2023-04-06 18:17:50', '2023-04-06 18:17:50', 'default', NULL, 'line_count_3', '{\"select\":{\"values\":[{\"as\":\"value\",\"agg\":\"count\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/file_not_exist.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[]},\"type\":\"none\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":0,\"groups\":[]},\"window\":{\"interval\":5000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"line_count_3\"}},\"executeRule\":{\"fixedRate\":0}}', 0, 1680776269865, '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_3', NULL, NULL); -- Create log monitor stat item -INSERT INTO `holoinsight`.`custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (4, 'default', NULL, 1, 'log monitor stat', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\": [{\"type\": \"path\", \"path\": \"/home/admin/logs/holoinsight-server/agent/stat.log\", \"agentLimitKB\": -1, \"charset\": \"utf-8\"}], \"blackFilters\": [], \"whiteFilters\": [{\"type\": \"LR\", \"rule\": {\"leftIndex\": 0, \"left\": \"ptype=[\", \"right\": \"]\", \"translate\": {}}, \"values\": [\"log_monitoring_stat\"]}], \"logParse\": {\"splitType\": \"LR\", \"maxKeySize\": -1, \"multiLine\": {\"multi\": false}}, \"collectRanges\": {\"table\": \"default_server\", \"condition\": [{\"app\": [\"holoinsight-server-example\"]}]}, \"splitCols\": [{\"name\": \"tenant\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"tenant=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"DIM\"}, {\"name\": \"c_key\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"t_c_key=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"DIM\"}, {\"name\": \"in_io_error\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_io_error=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_bytes\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_bytes=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_lines\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_lines=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_groups\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_groups=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_miss\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_miss=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_broken\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_broken=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_skip\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_skip=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_processed\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_processed=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_logparse\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_logparse=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_ignore\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_ignore=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_timeparse\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_timeparse=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_bwhere\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_bwhere=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_group\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_group=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_gkeys\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_gkeys=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_where\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_where=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_delay\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_delay=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"out_emit\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"out_emit=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"out_error\", \"rule\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"out_error=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}], \"collectMetrics\": [{\"tableName\": \"in_io_error\", \"targetTable\": \"in_io_error_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_io_error\", \"func\": \"sum\"}]}, {\"tableName\": \"in_bytes\", \"targetTable\": \"in_bytes_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_bytes\", \"func\": \"sum\"}]}, {\"tableName\": \"in_lines\", \"targetTable\": \"in_lines_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_lines\", \"func\": \"sum\"}]}, {\"tableName\": \"in_groups\", \"targetTable\": \"in_groups_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_groups\", \"func\": \"sum\"}]}, {\"tableName\": \"in_miss\", \"targetTable\": \"in_miss_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_miss\", \"func\": \"sum\"}]}, {\"tableName\": \"in_broken\", \"targetTable\": \"in_broken_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_broken\", \"func\": \"sum\"}]}, {\"tableName\": \"in_skip\", \"targetTable\": \"in_skip_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_skip\", \"func\": \"sum\"}]}, {\"tableName\": \"in_processed\", \"targetTable\": \"in_processed_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_processed\", \"func\": \"sum\"}]}, {\"tableName\": \"f_logparse\", \"targetTable\": \"f_logparse_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_logparse\", \"func\": \"sum\"}]}, {\"tableName\": \"f_ignore\", \"targetTable\": \"f_ignore_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_ignore\", \"func\": \"sum\"}]}, {\"tableName\": \"f_timeparse\", \"targetTable\": \"f_timeparse_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_timeparse\", \"func\": \"sum\"}]}, {\"tableName\": \"f_bwhere\", \"targetTable\": \"f_bwhere_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_bwhere\", \"func\": \"sum\"}]}, {\"tableName\": \"f_group\", \"targetTable\": \"f_group_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_group\", \"func\": \"sum\"}]}, {\"tableName\": \"f_gkeys\", \"targetTable\": \"f_gkeys_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_gkeys\", \"func\": \"sum\"}]}, {\"tableName\": \"f_where\", \"targetTable\": \"f_where_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_where\", \"func\": \"sum\"}]}, {\"tableName\": \"f_delay\", \"targetTable\": \"f_delay_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_delay\", \"func\": \"sum\"}]}, {\"tableName\": \"out_emit\", \"targetTable\": \"out_emit_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"out_emit\", \"func\": \"sum\"}]}, {\"tableName\": \"out_error\", \"targetTable\": \"out_error_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"out_error\", \"func\": \"sum\"}]}]}\n', '2023-04-09 20:38:14,390 tenant=[default] workspace=[default] born_time=[09 20:38:14] ptype=[log_monitor_stat] agent=[1a986276-61f5-4350-b403-c2810f0cf4a1] t_c_key=[t_up_4] t_c_version=[1680895620467] t_ip=[192.168.0.6] t_key=[t_up_4/dim2:f23c168fe4b03627754c52f632c547e2] f_bwhere=[0] f_delay=[0] f_gkeys=[0] f_group=[0] f_ignore=[0] f_logparse=[0] f_timeparse=[0] f_where=[0] in_broken=[0] in_bytes=[7459] in_groups=[14] in_io_error=[0] in_lines=[14] in_miss=[0] in_processed=[14] in_skip=[0] out_emit=[14] out_error=[0]\n', '2023-04-06 19:12:17', '2023-04-07 02:29:54', 'admin', 'admin'); +INSERT INTO `holoinsight`.`custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (4, 'default', NULL, 1, 'log monitor stat', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\": [{\"type\": \"path\", \"path\": \"/home/admin/logs/holoinsight-server/agent/stat.log\", \"agentLimitKB\": -1, \"charset\": \"utf-8\"}], \"blackFilters\": [], \"whiteFilters\": [{\"type\": \"LR\", \"alarmRuleConf\": {\"leftIndex\": 0, \"left\": \"ptype=[\", \"right\": \"]\", \"translate\": {}}, \"values\": [\"log_monitoring_stat\"]}], \"logParse\": {\"splitType\": \"LR\", \"maxKeySize\": -1, \"multiLine\": {\"multi\": false}}, \"collectRanges\": {\"table\": \"default_server\", \"condition\": [{\"app\": [\"holoinsight-server-example\"]}]}, \"splitCols\": [{\"name\": \"tenant\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"tenant=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"DIM\"}, {\"name\": \"c_key\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"t_c_key=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"DIM\"}, {\"name\": \"in_io_error\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_io_error=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_bytes\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_bytes=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_lines\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_lines=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_groups\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_groups=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_miss\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_miss=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_broken\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_broken=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_skip\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_skip=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"in_processed\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"in_processed=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_logparse\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_logparse=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_ignore\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_ignore=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_timeparse\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_timeparse=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_bwhere\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_bwhere=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_group\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_group=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_gkeys\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_gkeys=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_where\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_where=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"f_delay\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"f_delay=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"out_emit\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"out_emit=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}, {\"name\": \"out_error\", \"alarmRuleConf\": {\"nullable\": false, \"leftIndex\": 0, \"left\": \"out_error=[\", \"right\": \"]\", \"translate\": {}}, \"colType\": \"VALUE\"}], \"collectMetrics\": [{\"tableName\": \"in_io_error\", \"targetTable\": \"in_io_error_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_io_error\", \"func\": \"sum\"}]}, {\"tableName\": \"in_bytes\", \"targetTable\": \"in_bytes_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_bytes\", \"func\": \"sum\"}]}, {\"tableName\": \"in_lines\", \"targetTable\": \"in_lines_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_lines\", \"func\": \"sum\"}]}, {\"tableName\": \"in_groups\", \"targetTable\": \"in_groups_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_groups\", \"func\": \"sum\"}]}, {\"tableName\": \"in_miss\", \"targetTable\": \"in_miss_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_miss\", \"func\": \"sum\"}]}, {\"tableName\": \"in_broken\", \"targetTable\": \"in_broken_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_broken\", \"func\": \"sum\"}]}, {\"tableName\": \"in_skip\", \"targetTable\": \"in_skip_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_skip\", \"func\": \"sum\"}]}, {\"tableName\": \"in_processed\", \"targetTable\": \"in_processed_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"in_processed\", \"func\": \"sum\"}]}, {\"tableName\": \"f_logparse\", \"targetTable\": \"f_logparse_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_logparse\", \"func\": \"sum\"}]}, {\"tableName\": \"f_ignore\", \"targetTable\": \"f_ignore_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_ignore\", \"func\": \"sum\"}]}, {\"tableName\": \"f_timeparse\", \"targetTable\": \"f_timeparse_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_timeparse\", \"func\": \"sum\"}]}, {\"tableName\": \"f_bwhere\", \"targetTable\": \"f_bwhere_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_bwhere\", \"func\": \"sum\"}]}, {\"tableName\": \"f_group\", \"targetTable\": \"f_group_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_group\", \"func\": \"sum\"}]}, {\"tableName\": \"f_gkeys\", \"targetTable\": \"f_gkeys_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_gkeys\", \"func\": \"sum\"}]}, {\"tableName\": \"f_where\", \"targetTable\": \"f_where_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_where\", \"func\": \"sum\"}]}, {\"tableName\": \"f_delay\", \"targetTable\": \"f_delay_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"f_delay\", \"func\": \"sum\"}]}, {\"tableName\": \"out_emit\", \"targetTable\": \"out_emit_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"out_emit\", \"func\": \"sum\"}]}, {\"tableName\": \"out_error\", \"targetTable\": \"out_error_4\", \"metricType\": \"select\", \"tags\": [\"tenant\", \"c_key\"], \"metrics\": [{\"name\": \"out_error\", \"func\": \"sum\"}]}]}\n', '2023-04-09 20:38:14,390 tenant=[default] workspace=[default] born_time=[09 20:38:14] ptype=[log_monitor_stat] agent=[1a986276-61f5-4350-b403-c2810f0cf4a1] t_c_key=[t_up_4] t_c_version=[1680895620467] t_ip=[192.168.0.6] t_key=[t_up_4/dim2:f23c168fe4b03627754c52f632c547e2] f_bwhere=[0] f_delay=[0] f_gkeys=[0] f_group=[0] f_ignore=[0] f_logparse=[0] f_timeparse=[0] f_where=[0] in_broken=[0] in_bytes=[7459] in_groups=[14] in_io_error=[0] in_lines=[14] in_miss=[0] in_processed=[14] in_skip=[0] out_emit=[14] out_error=[0]\n', '2023-04-06 19:12:17', '2023-04-07 02:29:54', 'admin', 'admin'); INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (33, '2023-04-09 20:21:46', '2023-04-09 20:21:46', 'default', NULL, 'in_bytes_4', '{\"select\":{\"values\":[{\"as\":\"in_bytes\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"in_bytes=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}},\"agg\":\"sum\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/agent/stat.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[{\"in\":{\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\"}},\"values\":[\"log_monitor_stat\"]}}]},\"type\":\"none\"},\"time\":{\"type\":\"auto\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"tenant\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"tenant=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}},{\"name\":\"c_key\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"in_bytes_4\"}},\"executeRule\":{\"fixedRate\":0}}', 0, 1681042905536, '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_4', NULL, NULL); INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (35, '2023-04-09 20:21:46', '2023-04-09 20:21:46', 'default', NULL, 'in_lines_4', '{\"select\":{\"values\":[{\"as\":\"in_lines\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"in_lines=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}},\"agg\":\"sum\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/agent/stat.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[{\"in\":{\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\"}},\"values\":[\"log_monitor_stat\"]}}]},\"type\":\"none\"},\"time\":{\"type\":\"auto\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"tenant\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"tenant=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}},{\"name\":\"c_key\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"in_lines_4\"}},\"executeRule\":{\"fixedRate\":0}}', 0, 1681042905550, '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_4', NULL, NULL); INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (36, '2023-04-09 20:21:46', '2023-04-09 20:21:46', 'default', NULL, 'in_miss_4', '{\"select\":{\"values\":[{\"as\":\"in_miss\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"in_miss=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}},\"agg\":\"sum\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/agent/stat.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[{\"in\":{\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\"}},\"values\":[\"log_monitor_stat\"]}}]},\"type\":\"none\"},\"time\":{\"type\":\"auto\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"tenant\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"tenant=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}},{\"name\":\"c_key\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"in_miss_4\"}},\"executeRule\":{\"fixedRate\":0}}', 0, 1681042905554, '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_4', NULL, NULL); @@ -70,7 +70,7 @@ INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modifi INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (52, '2023-04-09 20:26:19', '2023-04-09 20:26:19', 'default', NULL, 'in_broken_4', '{\"select\":{\"values\":[{\"as\":\"in_broken\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"in_broken=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}},\"agg\":\"sum\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/agent/stat.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[{\"in\":{\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\"}},\"values\":[\"log_monitor_stat\"]}}]},\"type\":\"none\"},\"time\":{\"type\":\"auto\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"tenant\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"tenant=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}},{\"name\":\"c_key\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"in_broken_4\"}},\"executeRule\":{\"fixedRate\":0}}', 0, 1681043178650, '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_4', NULL, NULL); -- Create log monitor up item -INSERT INTO `holoinsight`.`custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (6, 'default', NULL, 1, 'log monitor up', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\":[{\"type\":\"path\",\"path\":\"/home/admin/logs/holoinsight-server/agent/up.log\",\"agentLimitKB\":-1,\"charset\":\"utf-8\"}],\"blackFilters\":[],\"whiteFilters\":[{\"type\":\"LR\",\"rule\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\",\"translate\":{}},\"values\":[\"log_monitor_up\"]}],\"logParse\":{\"splitType\":\"LR\",\"maxKeySize\":-1,\"multiLine\":{\"multi\":false}},\"collectRanges\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]},\"splitCols\":[{\"name\":\"c_key\",\"rule\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"DIM\"},{\"name\":\"tenant\",\"rule\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"tenant=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"DIM\"},{\"name\":\"ok\",\"rule\":{\"nullable\":false,\"leftIndex\":0,\"left\":\" ok=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"VALUE\"},{\"name\":\"up\",\"rule\":{\"nullable\":false,\"leftIndex\":0,\"left\":\"up=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"VALUE\"}],\"collectMetrics\":[{\"tableName\":\"ok\",\"metricType\":\"select\",\"tags\":[\"c_key\"],\"metrics\":[{\"name\":\"ok\",\"func\":\"sum\"}]},{\"tableName\":\"up\",\"metricType\":\"select\",\"tags\":[\"c_key\"],\"metrics\":[{\"name\":\"up\",\"func\":\"sum\"}]}]}', '2023-04-09 20:03:36,402 tenant=[default] workspace=[default] born_time=[09 20:03:36] event_time=[09 20:03:35] ptype=[log_monitor_up] agent=[1a986276-61f5-4350-b403-c2810f0cf4a1] t_c_key=[line_count2_2] t_c_version=[1680776155870] t_ip=[192.168.0.6] t_key=[line_count2_2/dim2:f23c168fe4b03627754c52f632c547e2] ok=[1] t_up=[1]', '2023-04-09 20:06:03', '2023-04-09 20:06:03', 'admin', 'admin'); +INSERT INTO `holoinsight`.`custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (6, 'default', NULL, 1, 'log monitor up', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\":[{\"type\":\"path\",\"path\":\"/home/admin/logs/holoinsight-server/agent/up.log\",\"agentLimitKB\":-1,\"charset\":\"utf-8\"}],\"blackFilters\":[],\"whiteFilters\":[{\"type\":\"LR\",\"alarmRuleConf\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\",\"translate\":{}},\"values\":[\"log_monitor_up\"]}],\"logParse\":{\"splitType\":\"LR\",\"maxKeySize\":-1,\"multiLine\":{\"multi\":false}},\"collectRanges\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]},\"splitCols\":[{\"name\":\"c_key\",\"alarmRuleConf\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"DIM\"},{\"name\":\"tenant\",\"alarmRuleConf\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"tenant=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"DIM\"},{\"name\":\"ok\",\"alarmRuleConf\":{\"nullable\":false,\"leftIndex\":0,\"left\":\" ok=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"VALUE\"},{\"name\":\"up\",\"alarmRuleConf\":{\"nullable\":false,\"leftIndex\":0,\"left\":\"up=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"VALUE\"}],\"collectMetrics\":[{\"tableName\":\"ok\",\"metricType\":\"select\",\"tags\":[\"c_key\"],\"metrics\":[{\"name\":\"ok\",\"func\":\"sum\"}]},{\"tableName\":\"up\",\"metricType\":\"select\",\"tags\":[\"c_key\"],\"metrics\":[{\"name\":\"up\",\"func\":\"sum\"}]}]}', '2023-04-09 20:03:36,402 tenant=[default] workspace=[default] born_time=[09 20:03:36] event_time=[09 20:03:35] ptype=[log_monitor_up] agent=[1a986276-61f5-4350-b403-c2810f0cf4a1] t_c_key=[line_count2_2] t_c_version=[1680776155870] t_ip=[192.168.0.6] t_key=[line_count2_2/dim2:f23c168fe4b03627754c52f632c547e2] ok=[1] t_up=[1]', '2023-04-09 20:06:03', '2023-04-09 20:06:03', 'admin', 'admin'); INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (53, '2023-04-09 20:26:19', '2023-04-09 20:26:19', 'default', NULL, 'ok_6', '{\"select\":{\"values\":[{\"as\":\"in_skip\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"ok=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}},\"agg\":\"sum\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/agent/up.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[{\"in\":{\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\"}},\"values\":[\"log_monitor_up\"]}}]},\"type\":\"none\"},\"time\":{\"type\":\"auto\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"c_key\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"ok_6\"}},\"executeRule\":{\"fixedRate\":0}}', 0, 1681043178648, '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_6', NULL, NULL); INSERT INTO `holoinsight`.`gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (54, '2023-04-09 20:26:19', '2023-04-09 20:26:19', 'default', NULL, 'up_6', '{\"select\":{\"values\":[{\"as\":\"in_broken\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"up=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}},\"agg\":\"sum\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/agent/up.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[{\"in\":{\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"ptype=[\",\"right\":\"]\"}},\"values\":[\"log_monitor_up\"]}}]},\"type\":\"none\"},\"time\":{\"type\":\"auto\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"c_key\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"t_c_key=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"up_6\"}},\"executeRule\":{\"fixedRate\":0}}', 0, 1681043178650, '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_6', NULL, NULL); @@ -81,10 +81,10 @@ INSERT INTO `dashboard` (`gmt_create`, `gmt_modified`, `title`, `conf`, `creator INSERT INTO `dashboard` (`gmt_create`, `gmt_modified`, `title`, `conf`, `creator`, `modifier`, `tenant`, `workspace`, `type`) VALUES ('2023-04-19 14:38:16', '2023-04-19 14:38:16', 'GPU', '{\"title\":\"GPU\",\"version\":\"0.0.0\",\"variables\":[],\"groupType\":\"collapse\",\"panels\":[{\"title\":\"GPU util\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":0,\"y\":0,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_util\",\"dsId\":\"system_gpu_util\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_util\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_util\",\"value\":\"system_gpu_util\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_util\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\"}],\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"*\",\"opValue\":100,\"unit\":\"%\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_util\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}],\"id\":\"panel-3d6a-8231-b605\"},{\"title\":\"GPU clocks (­MHz)\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":6,\"y\":0,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_clocks_current_sm\",\"dsId\":\"system_gpu_clocks_current_sm\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_clocks_current_sm\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_clocks_current_sm\",\"value\":\"system_gpu_clocks_current_sm\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_clocks_current_sm\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\"}],\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1,\"unit\":\"default\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_clocks_current_sm\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}],\"id\":\"panel-35be-8b79-8b4a\"},{\"title\":\"GPU temperature (­°C)\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":12,\"y\":0,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_temperature\",\"dsId\":\"system_gpu_temperature\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_temperature\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_temperature\",\"value\":\"system_gpu_temperature\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_temperature\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\"}],\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1,\"unit\":\"default\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_temperature\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}],\"id\":\"panel-18a8-bcae-a83f\"},{\"title\":\"Power (W)\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":18,\"y\":0,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_power_draw\",\"dsId\":\"system_gpu_power_draw\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_power_draw\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_power_draw\",\"value\":\"system_gpu_power_draw\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_power_draw\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\",\"aggregator\":\"none\"}],\"id\":\"panel-a23f-6816-d19b\",\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1,\"unit\":\"default\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_power_draw\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}]},{\"title\":\"Mem util\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":0,\"y\":6,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_mem_util\",\"dsId\":\"system_gpu_mem_util\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_mem_util\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_mem_util\",\"value\":\"system_gpu_mem_util\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_mem_util\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\"}],\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1,\"unit\":\"default\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_mem_util\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}],\"id\":\"panel-01a1-4f6d-caf1\"},{\"title\":\"Mem free\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":6,\"y\":6,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_mem_free\",\"dsId\":\"system_gpu_mem_free\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_mem_free\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_mem_free\",\"value\":\"system_gpu_mem_free\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_mem_free\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\"}],\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1048576,\"unit\":\"MB\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_mem_free\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}],\"id\":\"panel-3d8d-9fa0-0bae\"},{\"title\":\"Mem used\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":12,\"y\":6,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_mem_used\",\"dsId\":\"system_gpu_mem_used\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_mem_used\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_mem_used\",\"value\":\"system_gpu_mem_used\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_mem_used\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\"}],\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1048576,\"unit\":\"MB\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_mem_used\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}],\"id\":\"panel-2d12-8b81-89f9\"},{\"title\":\"Mem total\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":18,\"y\":6,\"w\":6,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_mem_total\",\"dsId\":\"system_gpu_mem_total\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_mem_total\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"},{\"label\":\"index\",\"value\":\"index\"}],\"metrics\":[{\"label\":\"system_gpu_mem_total\",\"value\":\"system_gpu_mem_total\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{__name__}}{{app}}/{{hostname}}/{{ip}}/{{index}}\",\"dims\":[],\"groupbyName\":[\"app\",\"hostname\",\"ip\",\"index\"],\"metrics\":[\"system_gpu_mem_total\"],\"uuid\":\"target-c87e-59a7-0c8d\",\"refId\":\"A\"}],\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1048576,\"unit\":\"MB\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_mem_total\",\"refId\":\"a\",\"targetUuid\":\"target-c87e-59a7-0c8d\",\"type\":\"ds\"}],\"id\":\"panel-3f8c-127a-9ad2\"},{\"title\":\"GPU count by app\",\"type\":\"line_chart_panel\",\"showTimeInfo\":true,\"grid\":{\"x\":0,\"y\":12,\"w\":12,\"h\":6},\"targets\":[{\"text\":\"云监控-system_gpu_count\",\"dsId\":\"system_gpu_count\",\"source\":{\"pluginType\":\"CLOUD_MONITOR\",\"dsId\":\"system_gpu_count\",\"tables\":{\"labels\":[{\"label\":\"app\",\"value\":\"app\"},{\"label\":\"hostname\",\"value\":\"hostname\"},{\"label\":\"ip\",\"value\":\"ip\"}],\"metrics\":[{\"label\":\"system_gpu_count\",\"value\":\"system_gpu_count\"}],\"multi\":true}},\"type\":\"CLOUD_MONITOR\",\"legend\":\"{{app}}\",\"dims\":[\"app\"],\"groupbyName\":[\"app\"],\"metrics\":[\"system_gpu_count\"],\"uuid\":\"target-f358-34bc-d97d\",\"refId\":\"A\"}],\"id\":\"panel-6f56-468b-f9e1\",\"options\":{\"xAxis\":{\"label\":{\"formatter\":\"HH:mm\"},\"visible\":true},\"yAxis\":{\"label\":{\"formatter\":{\"op\":\"/\",\"opValue\":1,\"unit\":\"default\"}},\"visible\":true,\"min\":0},\"lineStyle\":{\"size\":2},\"line\":{\"connectNulls\":false},\"point\":{\"visible\":false,\"size\":4},\"area\":{\"visible\":false,\"opacity\":0.03},\"tooltip\":{\"visible\":true,\"mode\":\"share\",\"order\":\"desc\"},\"legend\":{\"visible\":true,\"asTable\":false,\"position\":\"bottom\",\"values\":{\"min\":false,\"max\":false,\"avg\":false,\"current\":false,\"total\":false}},\"stack\":false},\"extraConfig\":{\"modals\":[],\"links\":[]},\"metricList\":[{\"name\":\"system_gpu_count\",\"refId\":\"a\",\"targetUuid\":\"target-f358-34bc-d97d\",\"type\":\"ds\"}]}],\"activeTab\":-2,\"id\":\"2\"}', 'admin', 'admin', 'default', NULL, 'magi'); -- Create Multiline log monitoring example -INSERT INTO `custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (7, 'default', NULL, '1', 'Multiline with filter', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\":[{\"type\":\"path\",\"path\":\"/home/admin/logs/holoinsight-server/test/multiline.log\",\"agentLimitKB\":-1,\"charset\":\"utf-8\"}],\"blackFilters\":[],\"whiteFilters\":[{\"type\":\"CONTAINS\",\"rule\":{\"leftIndex\":0,\"left\":\"\",\"right\":\"\",\"translate\":{}},\"values\":[\"index_not_found_exception\"]}],\"logParse\":{\"splitType\":\"LR\",\"maxKeySize\":-1,\"multiLine\":{\"multi\":true,\"lineType\":\"logHead\",\"logRegexp\":\"^[0-9]{4}-\"}},\"collectRanges\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]},\"splitCols\":[{\"name\":\"thread\",\"rule\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"thread=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"DIM\"}],\"collectMetrics\":[{\"tableName\":\"multiline_count\",\"metricType\":\"count\",\"tags\":[\"thread\"],\"metrics\":[{\"name\":\"value\",\"func\":\"count\"}]}]}', '2023-04-24 12:05:16 ERROR thread=[thread-1] i.h.s.a.r.s.CacheUpdateTimer - Other exception.', '2023-04-24 12:06:33', '2023-04-24 12:06:33', 'admin', 'admin'); +INSERT INTO `custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (7, 'default', NULL, '1', 'Multiline with filter', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\":[{\"type\":\"path\",\"path\":\"/home/admin/logs/holoinsight-server/test/multiline.log\",\"agentLimitKB\":-1,\"charset\":\"utf-8\"}],\"blackFilters\":[],\"whiteFilters\":[{\"type\":\"CONTAINS\",\"alarmRuleConf\":{\"leftIndex\":0,\"left\":\"\",\"right\":\"\",\"translate\":{}},\"values\":[\"index_not_found_exception\"]}],\"logParse\":{\"splitType\":\"LR\",\"maxKeySize\":-1,\"multiLine\":{\"multi\":true,\"lineType\":\"logHead\",\"logRegexp\":\"^[0-9]{4}-\"}},\"collectRanges\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]},\"splitCols\":[{\"name\":\"thread\",\"alarmRuleConf\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"thread=[\",\"right\":\"]\",\"translate\":{\"exprs\":[]},\"defaultValue\":\"\"},\"colType\":\"DIM\"}],\"collectMetrics\":[{\"tableName\":\"multiline_count\",\"metricType\":\"count\",\"tags\":[\"thread\"],\"metrics\":[{\"name\":\"value\",\"func\":\"count\"}]}]}', '2023-04-24 12:05:16 ERROR thread=[thread-1] i.h.s.a.r.s.CacheUpdateTimer - Other exception.', '2023-04-24 12:06:33', '2023-04-24 12:06:33', 'admin', 'admin'); INSERT INTO `gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (NULL, '2023-04-24 12:06:34', '2023-04-24 12:06:34', 'default', NULL, 'multiline_count_7', '{\"select\":{\"values\":[{\"as\":\"value\",\"agg\":\"count\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/test/multiline.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[{\"containsAny\":{\"elect\":{\"type\":\"line\"},\"values\":[\"index_not_found_exception\"]}}]},\"type\":\"none\",\"multiline\":{\"where\":{\"not\":{\"regexp\":{\"elect\":{\"type\":\"line\"},\"expression\":\"^[0-9]{4}-\"}}},\"enabled\":true,\"what\":\"previous\"}},\"time\":{\"type\":\"auto\"},\"multiline\":{\"where\":{\"not\":{\"regexp\":{\"elect\":{\"type\":\"line\"},\"expression\":\"^[0-9]{4}-\"}}},\"enabled\":true,\"what\":\"previous\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"thread\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"thread=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"multiline_count_7\"}},\"executeRule\":{\"fixedRate\":0}}', '0', '1682309193857', '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_7', NULL, NULL); -INSERT INTO `custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (8, 'default', NULL, '1', 'Multiline without filter', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\":[{\"type\":\"path\",\"path\":\"/home/admin/logs/holoinsight-server/test/multiline.log\",\"agentLimitKB\":-1,\"charset\":\"utf-8\"}],\"blackFilters\":[],\"whiteFilters\":[],\"logParse\":{\"splitType\":\"LR\",\"maxKeySize\":-1,\"multiLine\":{\"multi\":true,\"lineType\":\"logHead\",\"logRegexp\":\"^[0-9]{4}-\"}},\"collectRanges\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]},\"splitCols\":[{\"name\":\"thread\",\"rule\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"thread=[\",\"right\":\"]\",\"translate\":{}},\"colType\":\"DIM\"}],\"collectMetrics\":[{\"tableName\":\"multiline_count\",\"metricType\":\"count\",\"tags\":[\"thread\"],\"metrics\":[{\"name\":\"value\",\"func\":\"count\"}]}]}', '2023-04-24 12:05:16 ERROR thread=[thread-1] i.h.s.a.r.s.CacheUpdateTimer - Other exception.', '2023-04-24 12:06:40', '2023-04-24 12:07:00', 'admin', 'admin'); +INSERT INTO `custom_plugin` (`id`, `tenant`, `workspace`, `parent_folder_id`, `name`, `plugin_type`, `status`, `period_type`, `conf`, `sample_log`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES (8, 'default', NULL, '1', 'Multiline without filter', 'custom', 'ONLINE', 'MINUTE', '{\"logPaths\":[{\"type\":\"path\",\"path\":\"/home/admin/logs/holoinsight-server/test/multiline.log\",\"agentLimitKB\":-1,\"charset\":\"utf-8\"}],\"blackFilters\":[],\"whiteFilters\":[],\"logParse\":{\"splitType\":\"LR\",\"maxKeySize\":-1,\"multiLine\":{\"multi\":true,\"lineType\":\"logHead\",\"logRegexp\":\"^[0-9]{4}-\"}},\"collectRanges\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]},\"splitCols\":[{\"name\":\"thread\",\"alarmRuleConf\":{\"nullable\":true,\"leftIndex\":0,\"left\":\"thread=[\",\"right\":\"]\",\"translate\":{}},\"colType\":\"DIM\"}],\"collectMetrics\":[{\"tableName\":\"multiline_count\",\"metricType\":\"count\",\"tags\":[\"thread\"],\"metrics\":[{\"name\":\"value\",\"func\":\"count\"}]}]}', '2023-04-24 12:05:16 ERROR thread=[thread-1] i.h.s.a.r.s.CacheUpdateTimer - Other exception.', '2023-04-24 12:06:40', '2023-04-24 12:07:00', 'admin', 'admin'); INSERT INTO `gaea_collect_config` (`id`, `gmt_create`, `gmt_modified`, `tenant`, `workspace`, `table_name`, `json`, `deleted`, `version`, `collect_range`, `executor_selector`, `ref_id`, `biz_tenant`, `type`) VALUES (NULL, '2023-04-24 12:07:00', '2023-04-24 12:07:00', 'default', NULL, 'multiline_count_8', '{\"select\":{\"values\":[{\"as\":\"value\",\"agg\":\"count\"}]},\"from\":{\"type\":\"log\",\"log\":{\"path\":[{\"type\":\"path\",\"pattern\":\"/home/admin/logs/holoinsight-server/test/multiline.log\"}],\"charset\":\"utf-8\",\"parse\":{\"where\":{\"and\":[]},\"type\":\"none\",\"multiline\":{\"where\":{\"not\":{\"regexp\":{\"elect\":{\"type\":\"line\"},\"expression\":\"^[0-9]{4}-\"}}},\"enabled\":true,\"what\":\"previous\"}},\"time\":{\"type\":\"auto\"},\"multiline\":{\"where\":{\"not\":{\"regexp\":{\"elect\":{\"type\":\"line\"},\"expression\":\"^[0-9]{4}-\"}}},\"enabled\":true,\"what\":\"previous\"}}},\"where\":{\"and\":[]},\"groupBy\":{\"maxKeys\":-1,\"groups\":[{\"name\":\"thread\",\"elect\":{\"type\":\"leftRight\",\"leftRight\":{\"leftIndex\":0,\"left\":\"thread=[\",\"right\":\"]\"},\"transform\":{\"transforms\":[]}}}]},\"window\":{\"interval\":60000},\"output\":{\"type\":\"gateway\",\"gateway\":{\"metricName\":\"multiline_count_8\"}},\"executeRule\":{\"fixedRate\":0}}', '0', '1682309220145', '{\"type\":\"cloudmonitor\",\"cloudmonitor\":{\"table\":\"default_server\",\"condition\":[{\"app\":[\"holoinsight-server-example\"]}]}}', '{\"sidecar\":{},\"type\":\"sidecar\"}', 'custom_8', NULL, NULL); INSERT INTO integration_product (`name`,`profile`,`overview`,`configuration`,`metrics`,`status`,`type`,`form`,`template`,`gmt_create`,`gmt_modified`,`creator`,`modifier`,`version`) VALUES('PortCheck','Port detection Metrics','
  • This component is the ip:port of the target machine that detects whether the TCP connection is accessible. 、
  • Detection involves "detection source" and "detection target".
  • Our current "detection source" is the daemonset (using ordinary pod network mode, not host network mode) of the physical machine where the "detection target" (generally a container) is located, so the detection is always limited to the range of "the same physical machine", which does not necessarily mean that the "detection target" can be accessed by the "outside".

  • Note: even if the ip:port port is enabled, if the router or firewall is improperly configured, probe Source and probe Target cannot be connected, and the probe result is affected.

','{\"useInApp\":true,\"canCustom\":true}\n','{"subMetrics":{"REQ_STATUS":[{"name":"dialcheck_up","unit":"default","desc":"dialcheck_up metric","format":"number","aggregator":"sum"},{"name":"dialcheck_cost","unit":"default","desc":"keys metric","format":"number","aggregator":"sum"}]}}',1,'io.holoinsight.plugin.PortCheckPlugin','{"formType":"multiple","formList":[{"type":"input","name":"端口","value":"port","validate":[],"required":true},{"type":"radio","name":"应用范围","value":"metaLabel","validate":[],"required":true,"optionValues":[{"name":"全部应用","value":"allApp"},{"name":"部分应用","value":"partApp"}]},{"type":"selectRange","name":"采集范围","value":"range","validate":[],"required":false}],"filters":[]}','{"title":"端口监控","version":"0.0.0","variables":[{"name":"app","type":"select","options":{"values":"${appNameList}"}}],"groupType":"collapse","panels":[{"title":"UP","type":"line_chart_panel","showTimeInfo":true,"grid":{"x":0,"y":0,"w":12,"h":6},"targets":[{"text":"云监控-portcheck_up","dsId":"portcheck_up","source":{"pluginType":"CLOUD_MONITOR","dsId":"portcheck_up","tables":{"labels":[{"label":"hostname","value":"hostname"},{"label":"port","value":"port"},{"label":"zone","value":"zone"},{"label":"ip","value":"ip"},{"label":"namespace","value":"namespace"},{"label":"app","value":"app"}],"metrics":[{"label":"portcheck_up","value":"portcheck_up"}],"multi":true}},"metrics":["portcheck_up"],"aggregator":"avg","dims":["app","hostname","ip"],"groupbyName":["app","hostname","ip"],"legend":"{{app}}/{{hostname}}/{{ip}}","filters":[{"dimKey":"app","filterType":"literal_or","values":["${app}"]}],"uuid":"target-e8c4-fa3f-d72a","refId":"A"}],"id":"panel-0fb3-8ffa-bae4","options":{"xAxis":{"label":{"formatter":"HH:mm"},"visible":true},"yAxis":{"label":{"formatter":{"op":"/","opValue":1,"unit":"default"}},"visible":true},"lineStyle":{"size":2},"line":{"connectNulls":false},"point":{"visible":false,"size":4},"area":{"visible":false,"opacity":0.03},"tooltip":{"visible":true,"mode":"share","order":"desc"},"legend":{"visible":true,"asTable":false,"position":"bottom"},"annotationLine":{"visible":false,"annotationNumber":20,"text":{"annotationTextContent":"警戒值","annotationTextFontSize":14,"annotationTextColor":"#8c8c8c","annotationPosition":"start"},"line":{"annotationLineWidth":1,"annotationLineDash":3,"annotationLineColor":"#ff4d4f"}},"stack":false},"extraConfig":{"modals":[],"links":[]},"metricList":[{"name":"portcheck_up","refId":"a","targetUuid":"target-e8c4-fa3f-d72a","type":"ds"}]},{"title":"DOWN","type":"line_chart_panel","showTimeInfo":true,"grid":{"x":12,"y":0,"w":12,"h":6},"targets":[{"text":"云监控-portcheck_down","dsId":"portcheck_down","source":{"pluginType":"CLOUD_MONITOR","dsId":"portcheck_down","tables":{"labels":[{"label":"hostname","value":"hostname"},{"label":"port","value":"port"},{"label":"zone","value":"zone"},{"label":"ip","value":"ip"},{"label":"namespace","value":"namespace"},{"label":"app","value":"app"}],"metrics":[{"label":"portcheck_down","value":"portcheck_down"}],"multi":true}},"metrics":["portcheck_down"],"aggregator":"avg","dims":["app","hostname","ip"],"groupbyName":["app","hostname","ip"],"legend":"{{app}}/{{hostname}}/{{ip}}","filters":[{"dimKey":"app","filterType":"literal_or","values":["${app}"]}],"uuid":"target-e8c4-fa3f-d72a","refId":"A"}],"options":{"xAxis":{"label":{"formatter":"HH:mm"},"visible":true},"yAxis":{"label":{"formatter":{"op":"/","opValue":1,"unit":"default"}},"visible":true},"lineStyle":{"size":2},"line":{"connectNulls":false},"point":{"visible":false,"size":4},"area":{"visible":false,"opacity":0.03},"tooltip":{"visible":true,"mode":"share","order":"desc"},"legend":{"visible":true,"asTable":false,"position":"bottom"},"annotationLine":{"visible":false,"annotationNumber":20,"text":{"annotationTextContent":"警戒值","annotationTextFontSize":14,"annotationTextColor":"#8c8c8c","annotationPosition":"start"},"line":{"annotationLineWidth":1,"annotationLineDash":3,"annotationLineColor":"#ff4d4f"}},"stack":false},"extraConfig":{"modals":[],"links":[]},"metricList":[{"name":"portcheck_down","refId":"a","targetUuid":"target-e8c4-fa3f-d72a","type":"ds"}],"id":"panel-fd29-0f24-b436"},{"title":"COST","type":"line_chart_panel","showTimeInfo":true,"grid":{"x":0,"y":6,"w":24,"h":6},"targets":[{"text":"云监控-portcheck_cost","dsId":"portcheck_cost","source":{"pluginType":"CLOUD_MONITOR","dsId":"portcheck_cost","tables":{"labels":[{"label":"hostname","value":"hostname"},{"label":"port","value":"port"},{"label":"zone","value":"zone"},{"label":"ip","value":"ip"},{"label":"namespace","value":"namespace"},{"label":"app","value":"app"}],"metrics":[{"label":"portcheck_cost","value":"portcheck_cost"}],"multi":true}},"metrics":["portcheck_cost"],"aggregator":"avg","dims":["app","hostname","ip"],"groupbyName":["app","hostname","ip"],"legend":"{{app}}/{{hostname}}/{{ip}}","filters":[{"dimKey":"app","filterType":"literal_or","values":["${app}"]}],"uuid":"target-e8c4-fa3f-d72a","refId":"A"}],"options":{"xAxis":{"label":{"formatter":"HH:mm"},"visible":true},"yAxis":{"label":{"formatter":{"op":"/","opValue":1,"unit":"default"}},"visible":true},"lineStyle":{"size":2},"line":{"connectNulls":false},"point":{"visible":false,"size":4},"area":{"visible":false,"opacity":0.03},"tooltip":{"visible":true,"mode":"share","order":"desc"},"legend":{"visible":true,"asTable":false,"position":"bottom"},"annotationLine":{"visible":false,"annotationNumber":20,"text":{"annotationTextContent":"警戒值","annotationTextFontSize":14,"annotationTextColor":"#8c8c8c","annotationPosition":"start"},"line":{"annotationLineWidth":1,"annotationLineDash":3,"annotationLineColor":"#ff4d4f"}},"stack":false},"extraConfig":{"modals":[],"links":[]},"metricList":[{"name":"portcheck_cost","refId":"a","targetUuid":"target-e8c4-fa3f-d72a","type":"ds"}],"id":"panel-0492-75ac-2684"}],"activeTab":-2,"id":"18"}','2022-11-22 14:52:32','2022-11-23 11:42:18','admin','admin','1'); diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmBlockFacadeIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmBlockFacadeIT.java index add094a21..069170d91 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmBlockFacadeIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmBlockFacadeIT.java @@ -4,8 +4,8 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.dto.AlarmBlockDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.dto.AlarmBlockDTO; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.hamcrest.CustomMatcher; import org.hamcrest.core.Every; @@ -13,7 +13,6 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; -import java.util.Date; import java.util.Map; import java.util.Stack; import java.util.function.Supplier; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmMetricFacadeIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmMetricFacadeIT.java index 0d0f894da..d8d53c7f4 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmMetricFacadeIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmMetricFacadeIT.java @@ -14,18 +14,18 @@ import cn.hutool.json.JSONObject; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.TimeFilter; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.emuns.TimeFilterEnum; -import io.holoinsight.server.home.facade.trigger.CompareConfig; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Filter; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.TimeFilter; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.TimeFilterEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import io.restassured.response.Response; public class AlarmMetricFacadeIT extends BaseIT { @@ -81,10 +81,10 @@ public void test_query_alarm_metric() { } private Map buildRule() { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildTrigger())); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildTrigger())); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildTrigger() { diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmSubscribeFacadeIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmSubscribeFacadeIT.java index d5edf9e40..5935784ab 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmSubscribeFacadeIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlarmSubscribeFacadeIT.java @@ -4,8 +4,8 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.dto.AlarmSubscribeDTO; -import io.holoinsight.server.home.dal.model.dto.AlarmSubscribeInfo; +import io.holoinsight.server.common.dao.entity.dto.AlarmSubscribeDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmSubscribeInfo; import io.restassured.response.Response; import org.json.JSONArray; import org.json.JSONObject; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertCalculateIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertCalculateIT.java index ee8390d86..c225d4efc 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertCalculateIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertCalculateIT.java @@ -4,20 +4,20 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.facade.AlarmHistoryDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.TimeFilter; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.emuns.TimeFilterEnum; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.trigger.CompareConfig; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.TimeFilter; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.emuns.TimeFilterEnum; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.Matchers; import org.json.JSONObject; @@ -229,10 +229,10 @@ public void test_rule_calculate() { private Map buildPeriodAbsRule() { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildPeriodAbsTrigger())); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildPeriodAbsTrigger())); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildPeriodAbsTrigger() { @@ -251,10 +251,10 @@ private Trigger buildPeriodAbsTrigger() { } private Map buildPeriodRateRule() { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildPeriodRateTrigger())); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildPeriodRateTrigger())); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildPeriodRateTrigger() { @@ -273,10 +273,10 @@ private Trigger buildPeriodRateTrigger() { } private Map buildPeriodValueRule() { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildPeriodValueTrigger())); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildPeriodValueTrigger())); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildPeriodValueTrigger() { @@ -295,10 +295,10 @@ private Trigger buildPeriodValueTrigger() { } private Map buildCurrentRule() { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildCurrentTrigger())); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildCurrentTrigger())); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildCurrentTrigger() { diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertDingDingRobotIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertDingDingRobotIT.java index d0f8d3f71..ae86c14bc 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertDingDingRobotIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertDingDingRobotIT.java @@ -5,8 +5,8 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.dto.AlarmDingDingRobotDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.dto.AlarmDingDingRobotDTO; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.CustomMatcher; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertGroupIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertGroupIT.java index c503703af..d06196de9 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertGroupIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertGroupIT.java @@ -4,7 +4,7 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.dto.AlarmGroupDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmGroupDTO; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.Matchers; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertLogAnalysisIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertLogAnalysisIT.java index 25b601e99..1f1829a52 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertLogAnalysisIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertLogAnalysisIT.java @@ -4,27 +4,17 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.facade.AlarmHistoryDetailDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.trigger.Trigger; -import org.apache.commons.lang3.RandomStringUtils; -import org.hamcrest.CustomMatcher; -import org.hamcrest.Matchers; -import org.hamcrest.core.Every; -import org.json.JSONObject; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import org.junit.jupiter.api.Test; -import java.time.Duration; import java.util.Collections; import java.util.Map; import static io.holoinsight.server.test.it.AlertCalculateIT.buildCompareConfig; import static io.holoinsight.server.test.it.AlertCalculateIT.buildDataSource; -import static io.holoinsight.server.test.it.AlertCalculateIT.buildTimeFilter; /** * @author masaimu @@ -110,10 +100,10 @@ public void test_log_analysis_rule() { } private Map buildLogAnalysisRule(String metricName) { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildLogAnalysisTrigger(metricName))); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildLogAnalysisTrigger(metricName))); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildLogAnalysisTrigger(String metricName) { diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertManagerWebhookIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertManagerWebhookIT.java index a090bb00c..41a386c39 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertManagerWebhookIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertManagerWebhookIT.java @@ -4,8 +4,8 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.AlertmanagerWebhook; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.AlertmanagerWebhook; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.CustomMatcher; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertRuleIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertRuleIT.java index c5410d569..0f9905804 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertRuleIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertRuleIT.java @@ -4,22 +4,22 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.facade.AlarmHistoryDTO; -import io.holoinsight.server.home.facade.AlarmHistoryDetailDTO; -import io.holoinsight.server.home.facade.AlarmRuleDTO; -import io.holoinsight.server.home.facade.Rule; -import io.holoinsight.server.home.facade.TimeFilter; -import io.holoinsight.server.home.facade.emuns.BoolOperationEnum; -import io.holoinsight.server.home.facade.emuns.CompareOperationEnum; -import io.holoinsight.server.home.facade.emuns.FunctionEnum; -import io.holoinsight.server.home.facade.emuns.PeriodType; -import io.holoinsight.server.home.facade.emuns.TimeFilterEnum; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; -import io.holoinsight.server.home.facade.trigger.CompareConfig; -import io.holoinsight.server.home.facade.trigger.CompareParam; -import io.holoinsight.server.home.facade.trigger.DataSource; -import io.holoinsight.server.home.facade.trigger.Filter; -import io.holoinsight.server.home.facade.trigger.Trigger; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmHistoryDetailDTO; +import io.holoinsight.server.common.dao.entity.dto.AlarmRuleDTO; +import io.holoinsight.server.common.dao.entity.dto.alarm.AlarmRuleConf; +import io.holoinsight.server.common.dao.entity.dto.alarm.TimeFilter; +import io.holoinsight.server.common.dao.emuns.BoolOperationEnum; +import io.holoinsight.server.common.dao.emuns.CompareOperationEnum; +import io.holoinsight.server.common.dao.emuns.FunctionEnum; +import io.holoinsight.server.common.dao.emuns.PeriodType; +import io.holoinsight.server.common.dao.emuns.TimeFilterEnum; +import io.holoinsight.server.common.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareConfig; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.CompareParam; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.DataSource; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Filter; +import io.holoinsight.server.common.dao.entity.dto.alarm.trigger.Trigger; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.CustomMatcher; @@ -359,10 +359,10 @@ private AlarmRuleDTO buildAlarmRule(String ruleName) { } private Map buildRuleWithMultiTriggerContent() { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildTriggerWithMultiTriggerContent())); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildTriggerWithMultiTriggerContent())); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildTriggerWithMultiTriggerContent() { @@ -392,10 +392,10 @@ private List buildCompareConfigWithMultiTriggerContent() { } private Map buildRule() { - Rule rule = new Rule(); - rule.setBoolOperation(BoolOperationEnum.AND); - rule.setTriggers(Collections.singletonList(buildTrigger())); - return J.toMap(J.toJson(rule)); + AlarmRuleConf alarmRuleConf = new AlarmRuleConf(); + alarmRuleConf.setBoolOperation(BoolOperationEnum.AND); + alarmRuleConf.setTriggers(Collections.singletonList(buildTrigger())); + return J.toMap(J.toJson(alarmRuleConf)); } private Trigger buildTrigger() { diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertWebhookIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertWebhookIT.java index dac5918c4..90e3af181 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertWebhookIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/AlertWebhookIT.java @@ -5,8 +5,8 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.dto.AlarmWebhookDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.dto.AlarmWebhookDTO; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.CustomMatcher; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/ApiKeyFacadeIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/ApiKeyFacadeIT.java index 0398fcb6a..087b58c73 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/ApiKeyFacadeIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/ApiKeyFacadeIT.java @@ -4,7 +4,7 @@ package io.holoinsight.server.test.it; import io.holoinsight.server.common.J; -import io.holoinsight.server.home.dal.model.ApiKey; +import io.holoinsight.server.common.dao.entity.ApiKey; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.json.JSONObject; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/CustomPluginFacadeIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/CustomPluginFacadeIT.java index 924810a1d..cbd090e5b 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/CustomPluginFacadeIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/CustomPluginFacadeIT.java @@ -9,7 +9,7 @@ import io.holoinsight.server.home.dal.model.dto.CustomPluginStatus; import io.holoinsight.server.home.dal.model.dto.conf.CustomPluginConf; import io.holoinsight.server.home.dal.model.dto.conf.LogParse; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.CustomMatcher; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/DashboardIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/DashboardIT.java index d43fc6b72..2e3da31d6 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/DashboardIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/DashboardIT.java @@ -6,7 +6,7 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.home.dal.model.Dashboard; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.CustomMatcher; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/OpenMetricsScraperIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/OpenMetricsScraperIT.java index 79ce1668d..0e5348c9a 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/OpenMetricsScraperIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/OpenMetricsScraperIT.java @@ -8,7 +8,7 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.home.dal.model.dto.CloudMonitorRange; import io.holoinsight.server.home.dal.model.dto.OpenmetricsScraperDTO; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.json.JSONObject; diff --git a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/UserFavoriteFacadeIT.java b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/UserFavoriteFacadeIT.java index 257386bbd..f38a5cf6c 100644 --- a/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/UserFavoriteFacadeIT.java +++ b/test/server-e2e-test/src/main/java/io/holoinsight/server/test/it/UserFavoriteFacadeIT.java @@ -5,8 +5,8 @@ import io.holoinsight.server.common.J; import io.holoinsight.server.home.dal.model.Folder; -import io.holoinsight.server.home.dal.model.UserFavorite; -import io.holoinsight.server.home.facade.page.MonitorPageRequest; +import io.holoinsight.server.common.dao.entity.UserFavorite; +import io.holoinsight.server.common.MonitorPageRequest; import io.restassured.response.Response; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.CustomMatcher;