From 65da542d9bbefecbfe6cbd495340d387a4a7d52a Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 28 Mar 2019 16:18:27 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A4=84=E7=90=86CorpAsyncSendSimple?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=B6=85=E9=95=BF=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxutils/msg/msg.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/business/jxutils/msg/msg.go b/business/jxutils/msg/msg.go index 38aa46c63..23d8dc4a2 100644 --- a/business/jxutils/msg/msg.go +++ b/business/jxutils/msg/msg.go @@ -3,6 +3,7 @@ package msg import ( "fmt" + "git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/jx-callback/business/auth2" "git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding" "git.rosy.net.cn/jx-callback/globals" @@ -17,6 +18,9 @@ func SendUserMessage(userID, title, content string) (err error) { for _, auth := range authList { if auth.Type == dingding.AuthTypeStaff { findOneMethod = true + if len(content) > dingdingapi.MaxWorkMsgLen { + content = content[:dingdingapi.MaxWorkMsgLen-4] + "..." + } err = api.DingDingAPI.CorpAsyncSendSimple(auth.AuthID, content) break }