- 处理CorpAsyncSendSimple内容超长的情况
This commit is contained in:
@@ -3,6 +3,7 @@ package msg
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding"
|
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
@@ -17,6 +18,9 @@ func SendUserMessage(userID, title, content string) (err error) {
|
|||||||
for _, auth := range authList {
|
for _, auth := range authList {
|
||||||
if auth.Type == dingding.AuthTypeStaff {
|
if auth.Type == dingding.AuthTypeStaff {
|
||||||
findOneMethod = true
|
findOneMethod = true
|
||||||
|
if len(content) > dingdingapi.MaxWorkMsgLen {
|
||||||
|
content = content[:dingdingapi.MaxWorkMsgLen-4] + "..."
|
||||||
|
}
|
||||||
err = api.DingDingAPI.CorpAsyncSendSimple(auth.AuthID, content)
|
err = api.DingDingAPI.CorpAsyncSendSimple(auth.AuthID, content)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user