by Robin at 20240302

This commit is contained in:
Leufolium 2024-03-02 08:29:20 +08:00
parent b41aad7e4e
commit b2b29d7466
2 changed files with 11 additions and 1 deletions

View File

@ -290,7 +290,7 @@ func (s *CronService) SendContactCustomerServicesOfLastMinute(ctx context.Contex
return err.Error() return err.Error()
} }
err = dingtalk.SendMsgToAll(msg) err = dingtalk.SendMsg(msg)
if err != nil { if err != nil {
return err.Error() return err.Error()
} }

View File

@ -18,6 +18,16 @@ func NewDingTalkCilent(cfg *configcenter.DingTalkRobotConfig) *dingtalk.Client {
return 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 { func SendMsgToAll(message string) error {
msg := dingtalk.NewTextMessage().SetContent(message).SetAt(nil, true) msg := dingtalk.NewTextMessage().SetContent(message).SetAt(nil, true)
_, _, err := defaultDingTalkClient.Send(msg) _, _, err := defaultDingTalkClient.Send(msg)