alarm_msg.go 816 B

123456789101112131415161718192021222324252627
  1. package alarm_msg
  2. var (
  3. AlarmMsgUrl = "http://47.102.213.75:8606/api/alarm/send"
  4. )
  5. // projectName-项目名称
  6. // runMode-运行模式
  7. // msgBody-消息内容
  8. // level:消息基本,1:提示消息,2:警告消息,3:严重错误信息,默认为1 提示消息
  9. func SendAlarmMsg(msgBody string, level int) {
  10. //if global.CONFIG.Serve.RunMode != "release" {
  11. // return
  12. //}
  13. //params := make(map[string]interface{})
  14. //params["ProjectName"] = utils.APPNAME
  15. //params["RunMode"] = "release" //global.CONFIG.Serve.RunMode
  16. //params["MsgBody"] = msgBody
  17. //params["Level"] = level
  18. //param, err := json.Marshal(params)
  19. //if err != nil {
  20. // global.LOG.Critical("SendAlarmMsg json.Marshal Err:" + err.Error())
  21. // return
  22. //}
  23. //r, e := http.Post(AlarmMsgUrl, string(param))
  24. //fmt.Println("SendAlarmMsg", string(r), e)
  25. }