diff --git a/handler/tool.go b/handler/tool.go index f132126..677a3e3 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -77,7 +77,8 @@ func SetDeviceStatusV2(c *gin.Context) { // 继续处理请求 //是否是暂停之后第一次上线,如果是则发送邮件通知 device_status := worker.GetRedis("monitor_" + req.ID) - if device_status == "2" { + isExist := worker.IsContainKey("monitor_" + req.ID) + if device_status == "2" || !isExist { //发送邮件通知 title := "设备上线" content := "设备上线\n设备:" + req.ID + "\t状态:" + req.Status + "\t时间:" + time.Now().String()