稳定版。没重构之前。稳定的限流。
This commit is contained in:
@@ -2,7 +2,6 @@ package cn.van.business.util;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -33,7 +32,7 @@ public class WxtsUtil {
|
||||
content = common + content + "<br><br>";
|
||||
paramMap.put("text", content);
|
||||
HttpResponse execute = HttpRequest.post(url).header("vanToken", TOKEN).header("source", "XZJ_UBUNTU").body(JSON.toJSONString(paramMap)).execute();
|
||||
logger.info("企业微信推送结果:{}", execute);
|
||||
//logger.info("企业微信推送结果:{}", execute);
|
||||
} catch (Exception e) {
|
||||
logger.error("企业微信推送失败:{}", e.getMessage());
|
||||
}
|
||||
@@ -41,4 +40,13 @@ public class WxtsUtil {
|
||||
}
|
||||
|
||||
|
||||
// 添加分级告警方法
|
||||
public void sendCriticalAlert(String title, String content) {
|
||||
String formattedMsg = String.format("[CRITICAL] %s\n%s", title, content);
|
||||
// 这里调用实际的通知渠道,例如:
|
||||
// - 发送邮件
|
||||
// - 调用企业微信机器人
|
||||
// - 触发短信通知
|
||||
sendNotify(formattedMsg); // 复用原有通知方法
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user