mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-26 02:50:24 +08:00
refactor: 消息模块重构,infra包路径简写等
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package sender
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
@@ -40,7 +41,7 @@ type dingBotMsgResp struct {
|
||||
// DingBotSender 钉钉机器人消息发送
|
||||
type DingBotSender struct{}
|
||||
|
||||
func (d DingBotSender) Send(channel *msgx.Channel, msg *msgx.Msg) error {
|
||||
func (d DingBotSender) Send(ctx context.Context, channel *msgx.Channel, msg *msgx.Msg) error {
|
||||
// https://open.dingtalk.com/document/robots/custom-robot-access#title-72m-8ag-pqw
|
||||
msgReq := dingBotMsgReq{}
|
||||
|
||||
@@ -73,7 +74,7 @@ func (d DingBotSender) Send(channel *msgx.Channel, msg *msgx.Msg) error {
|
||||
}
|
||||
|
||||
timestamp := time.Now().UnixMilli()
|
||||
sign, err := d.sign(channel.GetExtraString("secret"), timestamp)
|
||||
sign, err := d.sign(channel.Extra.GetStr("secret"), timestamp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user