- 门店状态报警格式调整,使用markdown语法
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
func SendUserMessage(userID, title, content string) (err error) {
|
||||
func SendUserMessage(msgType, userID, title, content string) (err error) {
|
||||
globals.SugarLogger.Debugf("SendUserMessage userID:%s, title:%s, content:%s", userID, title, content)
|
||||
authList, err := auth2.GetUserBindAuthInfo(userID)
|
||||
findOneMethod := false
|
||||
@@ -25,7 +25,11 @@ func SendUserMessage(userID, title, content string) (err error) {
|
||||
content = content[:dingdingapi.MaxWorkContentLen-4] + "..."
|
||||
}
|
||||
if globals.IsProductEnv() {
|
||||
err = api.DingDingAPI.CorpAsyncSendSimple(auth.AuthID, content)
|
||||
if msgType == dingdingapi.MsgTyeText {
|
||||
err = api.DingDingAPI.CorpAsyncSendSimple(auth.AuthID, content)
|
||||
} else if msgType == dingdingapi.MsgTypeMarkdown {
|
||||
err = api.DingDingAPI.CorpAsyncSendMarkdown([]string{auth.AuthID}, nil, false, title, content)
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/msg"
|
||||
@@ -352,7 +353,7 @@ func (t *BaseTask) run(taskHandler func()) {
|
||||
content = fmt.Sprintf("%s执行失败,%s", taskDesc, t.Err.Error())
|
||||
}
|
||||
}
|
||||
msg.SendUserMessage(authInfo.UserID, "异步任务完成", content)
|
||||
msg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "异步任务完成", content)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user