当前位置:网站首页>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);
}
}
}
边栏推荐
- 史上最简明的 Tcpdump 入门指南,看这一篇就够了
- JUC工具包学习
- 【软考软件评测师】2014综合知识历年真题
- Learn more about xxE injection
- Normality of confidence interval
- Bi Shi - University Logistics Management System Based on SSM
- 360 was selected into the panorama of China's security industry, and isc2022 talked about the direction of security services in 63 fields
- 76000 people shut down! Toshiba announced the closure of all factories in Japan
- 如何快捷地查看H.265视频播放器EasyPlayer的API属性及其使用方法?
- The print version of imeta | international standard ISSN is officially confirmed, and the application for dual ISSN is completed
猜你喜欢

MapReduce(三)

Implicit indicators for evaluating the advantages and disadvantages of automated testing

如何快捷地查看H.265视频播放器EasyPlayer的API属性及其使用方法?

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

Www 2019 | Han: heterograph attention network

After returning to mixlab for three days, "creative team" cured my spiritual internal friction

Interviewer: let's talk about the specific process of network data transmission
Software test function test full set of common interview questions [function test] interview summary 4-2
![[image detection] realize the detection of nostrils and pupil circles based on combined separation filter matlab source code](/img/6a/92ace81b798810299a2fec0ce6ae70.png)
[image detection] realize the detection of nostrils and pupil circles based on combined separation filter matlab source code
![[signal denoising] signal denoising based on Kalman filter with matlab code](/img/9e/9e569c83dc3106570cf7571056867f.png)
[signal denoising] signal denoising based on Kalman filter with matlab code
随机推荐
钉钉报警工具
The total investment is 60billion! Foxconn semiconductor high-end package test project officially settled in Qingdao
【信号处理】基于高阶统计量特征的通信系统中微弱信号检测附matlab代码
Application skills of AWS dynamodb
【ELM分类】基于核极限学习机和极限学习机实现UCI数据集分类附matlab代码
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
Calling dht11/22 temperature and humidity sensor in Proteus simulation Arduino
XML 外部实体 (XXE) 漏洞及其修复方法
进程同步的方式有哪些?
Reinforcement learning - pytorch realizes advantage actor critical (A2C)
初步了解Panda3D音频和高级交互组件
Accelerate IGBT localization! BYD semiconductor will be listed independently, with a market value of 30billion yuan!
Blender plug-in of 2022
C#委托用法--控制台项目,通过委托实现事件
TSMC 3nm detail exposure: transistor density as high as 250million /mm ², Greatly improved performance and energy efficiency
置信区间之正态
MySQL之数据查询(WHERE)
[signal processing] weak signal detection in communication system based on the characteristics of high-order statistics with matlab code
Exercise --- BFS
RPA流程自动化机器人是什么技术?如何实现办公自动化?