Commit 71eb3f70 by fudahua

feat: 删除文件

parent 539b6e82
......@@ -5,9 +5,16 @@ import com.ctrip.framework.apollo.ConfigService;
import com.gic.commons.util.DingtalkMessageUtil;
import com.gic.commons.util.TraceIdUtil;
import com.gic.dubbo.entity.ProviderLocalTag;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class DingWarningUtil {
private static Logger logger = LoggerFactory.getLogger(DingWarningUtil.class);
private static final String dingdingurl="https://oapi.dingtalk.com/robot/send?access_token=1d6a0756fcfe5f215e3ed37d7e60960635d0009f71b476f3b402e7671fc2a8ca";
......@@ -16,11 +23,21 @@ public class DingWarningUtil {
public static void sendCountWarning(String msg) {
Config appConfig = ConfigService.getAppConfig();
String url = appConfig.getProperty("ding.url", dingdingurl);
String mobile = appConfig.getProperty("ding.mobile", null);
ProviderLocalTag localTag = ProviderLocalTag.tag.get();
String traceId = localTag.traceId;
try {
msg=msg+": "+traceId;
DingtalkMessageUtil.sendAlertMessage(msg,url);
List<String> mobiles=new ArrayList<>();
if (StringUtils.isNotBlank(mobile)) {
String[] split = mobile.split(",");
mobiles= Arrays.stream(split).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(mobiles)) {
DingtalkMessageUtil.sendAlertMessage(msg, url);
}else{
DingtalkMessageUtil.sendAlertMessage(msg, url,mobiles);
}
}catch (Exception e) {
logger.info("异常:{}",e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment