稳定版。没重构之前。稳定的限流。

This commit is contained in:
Leo
2025-03-04 14:29:48 +08:00
parent 72b7a125e0
commit 645b025172
16 changed files with 182 additions and 130 deletions

View File

@@ -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); // 复用原有通知方法
}
}