diff --git a/app/mix/service/xxljob_tasks.go b/app/mix/service/xxljob_tasks.go index acc173cc..94427118 100644 --- a/app/mix/service/xxljob_tasks.go +++ b/app/mix/service/xxljob_tasks.go @@ -290,7 +290,7 @@ func (s *CronService) SendContactCustomerServicesOfLastMinute(ctx context.Contex return err.Error() } - err = dingtalk.SendMsgToAll(msg) + err = dingtalk.SendMsg(msg) if err != nil { return err.Error() } diff --git a/library/dingtalk/client.go b/library/dingtalk/client.go index de1bf304..a98fa1d6 100644 --- a/library/dingtalk/client.go +++ b/library/dingtalk/client.go @@ -18,6 +18,16 @@ func NewDingTalkCilent(cfg *configcenter.DingTalkRobotConfig) *dingtalk.Client { return client } +func SendMsg(message string) error { + msg := dingtalk.NewTextMessage().SetContent(message) + _, _, err := defaultDingTalkClient.Send(msg) + if err != nil { + logger.Error("SendMsgToAll fail, err: %v", err) + return err + } + return nil +} + func SendMsgToAll(message string) error { msg := dingtalk.NewTextMessage().SetContent(message).SetAt(nil, true) _, _, err := defaultDingTalkClient.Send(msg)