package alarm_msg import ( "encoding/json" "eta_gn/eta_report/utils" "github.com/rdlucklib/rdluck_tools/http" ) func SendAlarmMsg(msgBody string, level int) { if utils.AlarmMsgUrl == "" { return } params := make(map[string]interface{}) params["ProjectName"] = utils.APPNAME params["RunMode"] = utils.RunMode params["MsgBody"] = msgBody params["Level"] = level param, err := json.Marshal(params) if err != nil { utils.FileLog.Info("SendAlarmMsg json.Marshal Err:" + err.Error()) return } http.Post(utils.AlarmMsgUrl, string(param)) }