当前位置:网站首页>Nail alarm tool
Nail alarm tool
2022-07-27 23:38:00 【Wind chime peak】
Build a group , Members of the group can add robots , The group administrator can modify all robots in the Group . Robots have corresponding Webhook, Send a message to this address , It can be displayed in the Group . The security setting direction information contains custom keywords 、 Add signature verification information to the address 、 Limit sent IP There are three ways of address segment .
ding:
url: Corresponding to Webhook Address
atMobiles:
Function name : @ List of mobile phone numbers of personnel , commas , You can see in the business cards of members in the Group , No +86-
@Slf4j
@Configuration
public class DingDingAlarmUtil {
@Value("${ding.url}")
private String url;
@Value("${spring.profiles.active}")
private String pretext;
private static DingTalkClient client;
private static String staticPretext;
@PostConstruct
public void init() {
client = new DefaultDingTalkClient(url);
staticPretext = String.format("[%s]", pretext);
}
public static void alarm(String content, String atMobiles) {
try {
OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text();
String time = TimeUtil.formatDateTime(LocalDateTime.now(), TimeUtil.TimeFormat.LONG_DATE_PATTERN_LINE);
// Content
text.setContent(staticPretext + time + "[ERROR]" + content);
OapiRobotSendRequest request = new OapiRobotSendRequest();
// Format
request.setMsgtype("text");
request.setText(text);
OapiRobotSendRequest.At at = new OapiRobotSendRequest.At();
String[] atMobileArray = atMobiles.replace(" ", "").split(",");
List<String> atMobileList = new ArrayList<>(Arrays.asList(atMobileArray));
// @ List of mobile phone numbers of personnel
at.setAtMobiles(atMobileList);
request.setAt(at);
client.execute(request);
} catch (Exception e) {
log.error("alarm error:", e);
}
}
}
边栏推荐
- Sudden, wechat important notice
- 消息队列常见的几种使用场景介绍
- Can Siemens PLC collect analog data of multiple slave stations in real time and wirelessly?
- [image defogging] image defogging based on dark channel and non-mean filtering with matlab code
- 我年薪100万,全身上下没有超过100块的衣服:存钱,是最顶级的自律
- What is the difference between concurrency and parallelism?
- 加速IGBT国产化!比亚迪半导体将独立上市,市值或达300亿元!
- Application of user portrait in precise push of wechat official account of scientific journals
- 7.6万人停工!东芝宣布关闭日本所有工厂
- The print version of imeta | international standard ISSN is officially confirmed, and the application for dual ISSN is completed
猜你喜欢

The wechat installation package has expanded 575 times in 11 years, and the up owner: "98% of the documents are garbage"; Apple App store was exposed to a large number of pornographic apps; Four techn

JUC工具包学习

Interviewer: let's talk about the specific process of network data transmission

【JS 逆向百例】某公共资源交易网,公告 URL 参数逆向分析

Nature review: preferential effects in the formation of microbial communities

Lua基础语法学习

西门子PLC能否实时无线采集多处从站模拟量数据?

Flink怎么使用Savepoint

详解分布式系统的幂等

See how Gan controls the image generation style step by step? Explain the evolution process of stylegan in detail
随机推荐
【信号处理】基于高阶统计量特征的通信系统中微弱信号检测附matlab代码
【 图像去雾】基于暗通道和非均值滤波实现图像去雾附matlab代码
用3dmax做折扇的思路方法与步骤
记录一下使用R语言中关于formatC的错误
[stonedb fault diagnosis] database instance crash
My annual salary is 1million, and I don't have clothes more than 100 yuan all over my body: saving money is the top self-discipline
The wechat installation package has expanded 575 times in 11 years, and the up owner: "98% of the documents are garbage"; Apple App store was exposed to a large number of pornographic apps; Four techn
Implicit indicators for evaluating the advantages and disadvantages of automated testing
Which one is better to request to merge -- three skills of interface request merging, and the performance directly explodes the table
Lua基础语法学习
Blood spitting finishing nanny level series tutorial - playing Fiddler bag capturing tutorial (5) - detailed explanation of fiddler monitoring panel
【ELM分类】基于核极限学习机和极限学习机实现UCI数据集分类附matlab代码
Software test function test full set of common interview questions [function test] interview summary 4-2
Ideas, methods and steps of making folding fans with 3DMAX
如何快捷地查看H.265视频播放器EasyPlayer的API属性及其使用方法?
[image defogging] image defogging based on dark channel and non-mean filtering with matlab code
Current situation and future of Nb IOT industry: cross the threshold of 100million shipments and rush to 5g connection!
proteus仿真arduino中调用DHT11/22温湿度传感器
怎么使用xshell免费版
股价暴涨180.46%!国产大硅片龙头沪硅产业上市:近4年净利累计不足6000万