|
@@ -2,6 +2,7 @@ package com.persagy.apm.energyalarmstarter.alarmengine.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.persagy.apm.energyalarmstarter.alarmdata.feign.AlarmUrlParam;
|
|
|
+import com.persagy.apm.energyalarmstarter.alarmdata.mq.model.DmpMessage;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
@@ -70,6 +71,26 @@ public class BaseService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 从数据中台消息中获取AlarmUrlParam
|
|
|
+ *
|
|
|
+ * @param msg 数据中台消息
|
|
|
+ * @return AlarmUrlParam
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021/11/19 10:15 下午
|
|
|
+ */
|
|
|
+ public AlarmUrlParam getAlarmUrlParam(DmpMessage msg) throws Exception {
|
|
|
+ String projectId = StringUtils.isBlank(msg.getProjectId())? "0": msg.getProjectId();
|
|
|
+
|
|
|
+
|
|
|
+ return new AlarmUrlParam(
|
|
|
+ msg.getUserId(),
|
|
|
+ msg.getGroupCode(),
|
|
|
+ projectId,
|
|
|
+ msg.getAppId()
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* @description: 获取request中的body
|
|
|
* @param: obj
|
|
|
* @return: com.alibaba.fastjson.JSONObject
|