添加设备监控,第一次上线邮件提醒
This commit is contained in:
parent
288f5a0db6
commit
92afee454c
|
|
@ -77,7 +77,8 @@ func SetDeviceStatusV2(c *gin.Context) {
|
||||||
// 继续处理请求
|
// 继续处理请求
|
||||||
//是否是暂停之后第一次上线,如果是则发送邮件通知
|
//是否是暂停之后第一次上线,如果是则发送邮件通知
|
||||||
device_status := worker.GetRedis("monitor_" + req.ID)
|
device_status := worker.GetRedis("monitor_" + req.ID)
|
||||||
if device_status == "2" {
|
isExist := worker.IsContainKey("monitor_" + req.ID)
|
||||||
|
if device_status == "2" || !isExist {
|
||||||
//发送邮件通知
|
//发送邮件通知
|
||||||
title := "设备上线"
|
title := "设备上线"
|
||||||
content := "设备上线\n设备:" + req.ID + "\t状态:" + req.Status + "\t时间:" + time.Now().String()
|
content := "设备上线\n设备:" + req.ID + "\t状态:" + req.Status + "\t时间:" + time.Now().String()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue