- 门店状态报警格式调整,使用markdown语法

This commit is contained in:
gazebo
2019-07-17 09:22:30 +08:00
parent 13409e141f
commit b50c505336
4 changed files with 28 additions and 16 deletions

View File

@@ -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
}