From 15fcb56f209f9313bb721636b599a1d52d65e202 Mon Sep 17 00:00:00 2001 From: MSI-NB Date: Tue, 24 Oct 2023 01:38:34 -0400 Subject: [PATCH 1/2] feat: DingTalk Adapter --- api/api_bind.go | 1 + api/conn.go | 30 +++ dice/im_session.go | 13 ++ dice/platform_adapter_dingtalk.go | 255 +++++++++++++++++++++++ dice/platform_adapter_dingtalk_helper.go | 38 ++++ go.mod | 4 +- go.sum | 10 + main.go | 2 + 8 files changed, 352 insertions(+), 1 deletion(-) create mode 100644 dice/platform_adapter_dingtalk.go create mode 100644 dice/platform_adapter_dingtalk_helper.go diff --git a/api/api_bind.go b/api/api_bind.go index aad9b4a8..ca46e1b5 100644 --- a/api/api_bind.go +++ b/api/api_bind.go @@ -342,6 +342,7 @@ func Bind(e *echo.Echo, _myDice *dice.DiceManager) { e.POST(prefix+"/im_connections/addTelegram", ImConnectionsAddTelegram) e.POST(prefix+"/im_connections/addMinecraft", ImConnectionsAddMinecraft) e.POST(prefix+"/im_connections/addDodo", ImConnectionsAddDodo) + e.POST(prefix+"/im_connections/addDingtalk", ImConnectionsAddDingTalk) e.POST(prefix+"/im_connections/addWalleQ", ImConnectionsAddWalleQ) e.POST(prefix+"/im_connections/addGocqSeparate", ImConnectionsAddGocqSeparate) e.POST(prefix+"/im_connections/addRed", ImConnectionsAddRed) diff --git a/api/conn.go b/api/conn.go index 9dfc655c..a6a328b0 100644 --- a/api/conn.go +++ b/api/conn.go @@ -184,6 +184,10 @@ func ImConnectionsDel(c echo.Context) error { i.Adapter.SetEnable(false) myDice.ImSession.EndPoints = append(myDice.ImSession.EndPoints[:index], myDice.ImSession.EndPoints[index+1:]...) return c.JSON(http.StatusOK, i) + case "DINGTALK": + i.Adapter.SetEnable(false) + myDice.ImSession.EndPoints = append(myDice.ImSession.EndPoints[:index], myDice.ImSession.EndPoints[index+1:]...) + return c.JSON(http.StatusOK, i) } } } @@ -518,6 +522,32 @@ func ImConnectionsAddDodo(c echo.Context) error { return c.String(430, "") } +func ImConnectionsAddDingTalk(c echo.Context) error { + if !doAuth(c) { + return c.JSON(http.StatusForbidden, nil) + } + + v := struct { + ClientID string `yaml:"clientID" json:"clientID"` + Token string `yaml:"token" json:"token"` + Nickname string `yaml:"nickname" json:"nickname"` + RobotCode string `yaml:"robotCode" json:"robotCode"` + }{} + err := c.Bind(&v) + if err == nil { + conn := dice.NewDingTalkConnItem(v.ClientID, v.Token, v.Nickname, v.RobotCode) + conn.Session = myDice.ImSession + pa := conn.Adapter.(*dice.PlatformAdapterDingTalk) + pa.Session = myDice.ImSession + myDice.ImSession.EndPoints = append(myDice.ImSession.EndPoints, conn) + myDice.LastUpdatedTime = time.Now().Unix() + myDice.Save(false) + go dice.ServeDingTalk(myDice, conn) + return c.JSON(200, conn) + } + return c.String(430, "") +} + func ImConnectionsAdd(c echo.Context) error { if !doAuth(c) { return c.JSON(http.StatusForbidden, nil) diff --git a/dice/im_session.go b/dice/im_session.go index 03531000..1cab4a50 100644 --- a/dice/im_session.go +++ b/dice/im_session.go @@ -335,6 +335,15 @@ func (ep *EndPointInfo) UnmarshalYAML(value *yaml.Node) error { return err } ep.Adapter = val.Adapter + case "DINGTALK": + var val struct { + Adapter *PlatformAdapterDingTalk `yaml:"adapter"` + } + err = value.Decode(&val) + if err != nil { + return err + } + ep.Adapter = val.Adapter } return err } @@ -1233,6 +1242,10 @@ func (ep *EndPointInfo) AdapterSetup() { pa := ep.Adapter.(*PlatformAdapterDodo) pa.Session = ep.Session pa.EndPoint = ep + case "DINGTALK": + pa := ep.Adapter.(*PlatformAdapterDingTalk) + pa.Session = ep.Session + pa.EndPoint = ep } } diff --git a/dice/platform_adapter_dingtalk.go b/dice/platform_adapter_dingtalk.go new file mode 100644 index 00000000..c75fb327 --- /dev/null +++ b/dice/platform_adapter_dingtalk.go @@ -0,0 +1,255 @@ +package dice + +import ( + "fmt" + dingtalk "github.com/Szzrain/DingTalk-go" + "github.com/open-dingtalk/dingtalk-stream-sdk-go/chatbot" + "strings" + "time" +) + +type PlatformAdapterDingTalk struct { + Session *IMSession `yaml:"-" json:"-"` + ClientID string `yaml:"clientID" json:"clientID"` + Token string `yaml:"token" json:"token"` + RobotCode string `yaml:"robotCode" json:"robotCode"` + CoolAppCode string `yaml:"coolAppCode" json:"coolAppCode"` + EndPoint *EndPointInfo `yaml:"-" json:"-"` + IntentSession *dingtalk.Session `yaml:"-" json:"-"` +} + +func (pa *PlatformAdapterDingTalk) DoRelogin() bool { + err := pa.IntentSession.Close() + if err != nil { + pa.Session.Parent.Logger.Error("Dingtalk 断开连接失败: ", err) + return false + } + pa.Session.Parent.Logger.Infof("正在启用DingTalk服务……") + if pa.IntentSession == nil { + pa.Serve() + return false + } + err = pa.IntentSession.Open() + if err != nil { + pa.Session.Parent.Logger.Errorf("与DingTalk服务进行连接时出错:%s", err.Error()) + pa.EndPoint.State = 3 + pa.EndPoint.Enable = false + return false + } + return true +} + +func (pa *PlatformAdapterDingTalk) SetEnable(enable bool) { + if enable { + pa.Session.Parent.Logger.Infof("正在启用DingTalk服务……") + if pa.IntentSession == nil { + pa.Serve() + return + } + err := pa.IntentSession.Open() + if err != nil { + pa.Session.Parent.Logger.Errorf("与DingTalk服务进行连接时出错:%s", err.Error()) + pa.EndPoint.State = 3 + pa.EndPoint.Enable = false + return + } + } else { + err := pa.IntentSession.Close() + if err != nil { + pa.Session.Parent.Logger.Error("Dingtalk 断开连接失败: ", err) + return + } + pa.EndPoint.State = 0 + pa.EndPoint.Enable = false + } +} + +func (pa *PlatformAdapterDingTalk) QuitGroup(ctx *MsgContext, id string) { + pa.SendToGroup(ctx, id, "不支持此功能, 请手动移除机器人", "") +} + +func (pa *PlatformAdapterDingTalk) SendToPerson(ctx *MsgContext, uid string, text string, flag string) { + msg := dingtalk.MessageSampleText{Content: text} + rawUserID := ExtractDingTalkUserID(uid) + _, err := pa.IntentSession.MessagePrivateSend(rawUserID, pa.RobotCode, &msg) + if err != nil { + pa.Session.Parent.Logger.Error("Dingtalk SendToPerson Error: ", err) + return + } + pa.Session.OnMessageSend(ctx, &Message{ + Platform: "DINGTALK", + MessageType: "private", + Message: text, + Sender: SenderBase{ + UserID: pa.EndPoint.UserID, + Nickname: pa.EndPoint.Nickname, + }, + }, flag) +} + +func (pa *PlatformAdapterDingTalk) SendToGroup(ctx *MsgContext, uid string, text string, flag string) { + msg := dingtalk.MessageSampleText{Content: text} + rawGroupID := ExtractDingTalkGroupID(uid) + _, err := pa.IntentSession.MessageGroupSend(rawGroupID, pa.RobotCode, pa.CoolAppCode, &msg) + if err != nil { + pa.Session.Parent.Logger.Error("Dingtalk SendToGroup Error: ", err) + return + } + pa.Session.OnMessageSend(ctx, &Message{ + Platform: "DINGTALK", + MessageType: "group", + Message: text, + GroupID: uid, + Sender: SenderBase{ + UserID: pa.EndPoint.UserID, + Nickname: pa.EndPoint.Nickname, + }, + }, flag) +} + +func (pa *PlatformAdapterDingTalk) SetGroupCardName(groupID string, userID string, name string) { +} + +func (pa *PlatformAdapterDingTalk) SendFileToPerson(ctx *MsgContext, uid string, path string, flag string) { + dice := pa.Session.Parent + fileElement, err := dice.FilepathToFileElement(path) + if err == nil { + pa.SendToPerson(ctx, uid, fmt.Sprintf("[尝试发送文件: %s,但不支持]", fileElement.File), flag) + } else { + pa.SendToPerson(ctx, uid, fmt.Sprintf("[尝试发送文件出错: %s]", err.Error()), flag) + } +} + +func (pa *PlatformAdapterDingTalk) SendFileToGroup(ctx *MsgContext, uid string, path string, flag string) { + dice := pa.Session.Parent + fileElement, err := dice.FilepathToFileElement(path) + if err == nil { + pa.SendToGroup(ctx, uid, fmt.Sprintf("[尝试发送文件: %s,但不支持]", fileElement.File), flag) + } else { + pa.SendToGroup(ctx, uid, fmt.Sprintf("[尝试发送文件出错: %s]", err.Error()), flag) + } +} + +func (pa *PlatformAdapterDingTalk) MemberBan(groupID string, userID string, duration int64) { +} + +func (pa *PlatformAdapterDingTalk) MemberKick(groupID string, userID string) { +} + +func (pa *PlatformAdapterDingTalk) GetGroupInfoAsync(groupID string) { + +} + +func (pa *PlatformAdapterDingTalk) OnChatReceive(_ *dingtalk.Session, data *chatbot.BotCallbackDataModel) { + //palogger := pa.Session.Parent.Logger + pa.EndPoint.UserID = FormatDiceIDDingTalk(data.ChatbotUserId) + if pa.Session.ServiceAtNew[FormatDiceIDDingTalkGroup(data.ConversationId)] != nil { + pa.Session.ServiceAtNew[FormatDiceIDDingTalkGroup(data.ConversationId)].GroupName = data.ConversationTitle + } + //palogger.Info("Dingtalk OnChatReceive: ", data.Text.Content, " Sender: ", data.SenderId, " CorpId: ", data.SenderCorpId, " Conversation Type: ", data.ConversationType) + msg := pa.toStdMessage(data) + pa.Session.Execute(pa.EndPoint, msg, false) +} + +func (pa *PlatformAdapterDingTalk) OnGroupJoined(_ *dingtalk.Session, data *dingtalk.GroupJoinedEvent) { + palogger := pa.Session.Parent.Logger + msg := &Message{ + Platform: "DINGTALK", + RawID: data.EventId, + GroupID: FormatDiceIDDingTalkGroup(data.OpenConversationId), + Sender: SenderBase{ + UserID: FormatDiceIDDingTalk(data.Operator), + }, + } + palogger.Info("Dingtalk OnGroupJoined: ", data) + pa.CoolAppCode = data.CoolAppCode + pa.RobotCode = data.RobotCode + d := pa.Session.Parent + d.LastUpdatedTime = time.Now().Unix() + d.Save(false) + logger := pa.Session.Parent.Logger + ep := pa.EndPoint + ctx := &MsgContext{MessageType: "group", EndPoint: ep, Session: pa.Session, Dice: pa.Session.Parent} + gi := SetBotOnAtGroup(ctx, msg.GroupID) + gi.InviteUserID = msg.Sender.UserID + gi.EnteredTime = time.Now().Unix() + ctx.Player = &GroupPlayerInfo{} + logger.Infof("发送入群致辞,群: <%s>(%d)", "%未知群名%", data.OpenConversationId) + text := DiceFormatTmpl(ctx, "核心:骰子进群") + for _, i := range strings.Split(text, "###SPLIT###") { + pa.SendToGroup(ctx, msg.GroupID, strings.TrimSpace(i), "") + } + if ctx.Session.ServiceAtNew[msg.GroupID] != nil { + for _, i := range ctx.Session.ServiceAtNew[msg.GroupID].ActivatedExtList { + if i.OnGroupJoined != nil { + i.callWithJsCheck(ctx.Dice, func() { + i.OnGroupJoined(ctx, msg) + }) + } + } + } +} + +func (pa *PlatformAdapterDingTalk) toStdMessage(data *chatbot.BotCallbackDataModel) *Message { + msg := &Message{ + Platform: "DINGTALK", + RawID: data.MsgId, + Message: data.Text.Content, + Sender: SenderBase{ + Nickname: data.SenderNick, + UserID: FormatDiceIDDingTalk(data.SenderStaffId), + }, + Time: time.Now().Unix(), + } + if data.IsAdmin { + msg.Sender.GroupRole = "admin" + } + if data.ConversationType == "2" { + msg.GroupID = FormatDiceIDDingTalkGroup(data.ConversationId) + msg.MessageType = "group" + } else { + msg.MessageType = "private" + } + return msg +} + +func (pa *PlatformAdapterDingTalk) Serve() int { + logger := pa.Session.Parent.Logger + logger.Info("Dingtalk Serve") + pa.IntentSession = dingtalk.New(pa.ClientID, pa.Token) + pa.IntentSession.AddEventHandler(pa.OnChatReceive) + pa.IntentSession.AddEventHandler(pa.OnGroupJoined) + err := pa.IntentSession.Open() + if err != nil { + return 1 + } + logger.Info("Dingtalk 连接成功") + pa.EndPoint.State = 1 + pa.EndPoint.Enable = true + d := pa.Session.Parent + d.LastUpdatedTime = time.Now().Unix() + d.Save(false) + return 0 +} + +func FormatDiceIDDingTalk(diceDingTalk string) string { + return fmt.Sprintf("DINGTALK:%s", diceDingTalk) +} + +func FormatDiceIDDingTalkGroup(diceDingTalk string) string { + return fmt.Sprintf("DINGTALK-Group:%s", diceDingTalk) +} + +func ExtractDingTalkUserID(id string) string { + if strings.HasPrefix(id, "DINGTALK:") { + return id[len("DINGTALK:"):] + } + return id +} + +func ExtractDingTalkGroupID(id string) string { + if strings.HasPrefix(id, "DINGTALK-Group:") { + return id[len("DINGTALK-Group:"):] + } + return id +} diff --git a/dice/platform_adapter_dingtalk_helper.go b/dice/platform_adapter_dingtalk_helper.go new file mode 100644 index 00000000..a93a68c4 --- /dev/null +++ b/dice/platform_adapter_dingtalk_helper.go @@ -0,0 +1,38 @@ +package dice + +import ( + "github.com/google/uuid" + "time" +) + +func NewDingTalkConnItem(clientID string, token string, nickname string, robotCode string) *EndPointInfo { + conn := new(EndPointInfo) + conn.ID = uuid.New().String() + conn.Platform = "DINGTALK" + conn.Nickname = nickname + conn.ProtocolType = "" + conn.Enable = false + conn.RelWorkDir = "extra/dingtalk-" + conn.ID + conn.Adapter = &PlatformAdapterDingTalk{ + EndPoint: conn, + ClientID: clientID, + Token: token, + RobotCode: robotCode, + } + return conn +} + +func ServeDingTalk(d *Dice, ep *EndPointInfo) { + defer CrashLog() + if ep.Platform == "DINGTALK" { + conn := ep.Adapter.(*PlatformAdapterDingTalk) + d.Logger.Infof("Dingtalk 尝试连接") + if conn.Serve() != 0 { + d.Logger.Errorf("连接Dingtalk 失败") + ep.State = 3 + ep.Enable = false + d.LastUpdatedTime = time.Now().Unix() + d.Save(false) + } + } +} diff --git a/go.mod b/go.mod index 831fb151..a2c2d8e9 100644 --- a/go.mod +++ b/go.mod @@ -48,6 +48,7 @@ require ( require ( github.com/BurntSushi/toml v1.3.2 + github.com/Szzrain/DingTalk-go v0.0.8-alpha github.com/fyrchik/go-shlex v0.0.0-20210215145004-cd7f49bfd959 github.com/glebarez/go-sqlite v1.21.2 github.com/go-creed/sat v1.0.3 @@ -60,8 +61,10 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/mozillazg/go-pinyin v0.20.0 github.com/natefinch/lumberjack v2.0.0+incompatible + github.com/open-dingtalk/dingtalk-stream-sdk-go v0.6.0 github.com/pelletier/go-toml/v2 v2.1.0 github.com/pkg/errors v0.9.1 + github.com/samber/lo v1.38.1 github.com/schollz/progressbar/v3 v3.13.1 github.com/sealdice/dicescript v0.0.0-20230917100026-46a8c8b410d3 github.com/tdewolff/minify/v2 v2.12.9 @@ -135,7 +138,6 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/sacOO7/go-logger v0.0.0-20180719173527-9ac9add5a50d // indirect - github.com/samber/lo v1.38.1 // indirect github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af // indirect github.com/tdewolff/parse/v2 v2.6.8 // indirect github.com/tidwall/btree v1.4.2 // indirect diff --git a/go.sum b/go.sum index db7bc107..e445f373 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,14 @@ github.com/RoaringBitmap/roaring v0.9.4 h1:ckvZSX5gwCRaJYBNe7syNawCU5oruY9gQmjXl github.com/RoaringBitmap/roaring v0.9.4/go.mod h1:icnadbWcNyfEHlYdr+tDlOTih1Bf/h+rzPpv4sbomAA= github.com/ShiraazMoollatjie/goluhn v0.0.0-20211017190329-0d86158c056a h1:NPnGVqpua4c1iEFVdxnBJA9viP5bo2Zp2jfflbcjdto= github.com/ShiraazMoollatjie/goluhn v0.0.0-20211017190329-0d86158c056a/go.mod h1:5LI6VqIHoGmWsR0EJLbct5bBrtM/0pTonaAyGKmFk9U= +github.com/Szzrain/DingTalk-go v0.0.5-alpha h1:OFGYTTVbZUVko0iw29sLbWhTg8qwstHuBSUVVkz6wJs= +github.com/Szzrain/DingTalk-go v0.0.5-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= +github.com/Szzrain/DingTalk-go v0.0.6-alpha h1:PLt9HInHqstJdPOjzcCxwAhdlzfQQhLb8QhDg8NAPzo= +github.com/Szzrain/DingTalk-go v0.0.6-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= +github.com/Szzrain/DingTalk-go v0.0.7-alpha h1:7lN2cwtwUQbiSJoX/vihwEcpUu+w2+fCNjI1kr97CkA= +github.com/Szzrain/DingTalk-go v0.0.7-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= +github.com/Szzrain/DingTalk-go v0.0.8-alpha h1:mSR/ORDDjtndoR12WrEdd3hdxxXXm9VMQ/r75NJkkkE= +github.com/Szzrain/DingTalk-go v0.0.8-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0 h1:BVts5dexXf4i+JX8tXlKT0aKoi38JwTXSe+3WUneX0k= @@ -267,6 +275,8 @@ github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/open-dingtalk/dingtalk-stream-sdk-go v0.6.0 h1:bkdN7LQb+JKOj29cfvAW/HZXHoTerZQY4CwgNrM3OoI= +github.com/open-dingtalk/dingtalk-stream-sdk-go v0.6.0/go.mod h1:ln3IqPYYocZbYvl9TAOrG/cxGR9xcn4pnZRLdCTEGEU= github.com/otiai10/copy v1.12.0 h1:cLMgSQnXBs1eehF0Wy/FAGsgDTDmAqFR7rQylBb1nDY= github.com/otiai10/copy v1.12.0/go.mod h1:rSaLseMUsZFFbsFGc7wCJnnkTAvdc5L6VWxPE4308Ww= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= diff --git a/main.go b/main.go index a46778d5..f75d4c93 100644 --- a/main.go +++ b/main.go @@ -483,6 +483,8 @@ func diceServe(d *dice.Dice) { dice.ServeMinecraft(d, conn) case "DODO": dice.ServeDodo(d, conn) + case "DINGTALK": + dice.ServeDingTalk(d, conn) } }(_conn) } else { From 0e0d1c07f702cce14a8a088e1b20da4b761aa9f9 Mon Sep 17 00:00:00 2001 From: MSI-NB Date: Tue, 24 Oct 2023 02:39:44 -0400 Subject: [PATCH 2/2] chore: make lint happy --- dice/platform_adapter_dingtalk.go | 7 +++---- dice/platform_adapter_dingtalk_helper.go | 3 ++- go.sum | 6 ------ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/dice/platform_adapter_dingtalk.go b/dice/platform_adapter_dingtalk.go index c75fb327..6110417d 100644 --- a/dice/platform_adapter_dingtalk.go +++ b/dice/platform_adapter_dingtalk.go @@ -2,10 +2,11 @@ package dice import ( "fmt" - dingtalk "github.com/Szzrain/DingTalk-go" - "github.com/open-dingtalk/dingtalk-stream-sdk-go/chatbot" "strings" "time" + + dingtalk "github.com/Szzrain/DingTalk-go" + "github.com/open-dingtalk/dingtalk-stream-sdk-go/chatbot" ) type PlatformAdapterDingTalk struct { @@ -141,12 +142,10 @@ func (pa *PlatformAdapterDingTalk) GetGroupInfoAsync(groupID string) { } func (pa *PlatformAdapterDingTalk) OnChatReceive(_ *dingtalk.Session, data *chatbot.BotCallbackDataModel) { - //palogger := pa.Session.Parent.Logger pa.EndPoint.UserID = FormatDiceIDDingTalk(data.ChatbotUserId) if pa.Session.ServiceAtNew[FormatDiceIDDingTalkGroup(data.ConversationId)] != nil { pa.Session.ServiceAtNew[FormatDiceIDDingTalkGroup(data.ConversationId)].GroupName = data.ConversationTitle } - //palogger.Info("Dingtalk OnChatReceive: ", data.Text.Content, " Sender: ", data.SenderId, " CorpId: ", data.SenderCorpId, " Conversation Type: ", data.ConversationType) msg := pa.toStdMessage(data) pa.Session.Execute(pa.EndPoint, msg, false) } diff --git a/dice/platform_adapter_dingtalk_helper.go b/dice/platform_adapter_dingtalk_helper.go index a93a68c4..f7eab00b 100644 --- a/dice/platform_adapter_dingtalk_helper.go +++ b/dice/platform_adapter_dingtalk_helper.go @@ -1,8 +1,9 @@ package dice import ( - "github.com/google/uuid" "time" + + "github.com/google/uuid" ) func NewDingTalkConnItem(clientID string, token string, nickname string, robotCode string) *EndPointInfo { diff --git a/go.sum b/go.sum index e445f373..57f3fe3e 100644 --- a/go.sum +++ b/go.sum @@ -5,12 +5,6 @@ github.com/RoaringBitmap/roaring v0.9.4 h1:ckvZSX5gwCRaJYBNe7syNawCU5oruY9gQmjXl github.com/RoaringBitmap/roaring v0.9.4/go.mod h1:icnadbWcNyfEHlYdr+tDlOTih1Bf/h+rzPpv4sbomAA= github.com/ShiraazMoollatjie/goluhn v0.0.0-20211017190329-0d86158c056a h1:NPnGVqpua4c1iEFVdxnBJA9viP5bo2Zp2jfflbcjdto= github.com/ShiraazMoollatjie/goluhn v0.0.0-20211017190329-0d86158c056a/go.mod h1:5LI6VqIHoGmWsR0EJLbct5bBrtM/0pTonaAyGKmFk9U= -github.com/Szzrain/DingTalk-go v0.0.5-alpha h1:OFGYTTVbZUVko0iw29sLbWhTg8qwstHuBSUVVkz6wJs= -github.com/Szzrain/DingTalk-go v0.0.5-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= -github.com/Szzrain/DingTalk-go v0.0.6-alpha h1:PLt9HInHqstJdPOjzcCxwAhdlzfQQhLb8QhDg8NAPzo= -github.com/Szzrain/DingTalk-go v0.0.6-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= -github.com/Szzrain/DingTalk-go v0.0.7-alpha h1:7lN2cwtwUQbiSJoX/vihwEcpUu+w2+fCNjI1kr97CkA= -github.com/Szzrain/DingTalk-go v0.0.7-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= github.com/Szzrain/DingTalk-go v0.0.8-alpha h1:mSR/ORDDjtndoR12WrEdd3hdxxXXm9VMQ/r75NJkkkE= github.com/Szzrain/DingTalk-go v0.0.8-alpha/go.mod h1:j2+BnL67DfiCu6E1rhJDHy4up2drtGXJOrRohIHg5uo= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=