mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-05-12 14:05:19 +08:00
fix: postgres导出调整等
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type MsgType int8
|
||||
@@ -71,7 +70,7 @@ type MsgSender interface {
|
||||
Send(ctx context.Context, channel *Channel, msg *Msg) error
|
||||
}
|
||||
|
||||
var messageSenders sync.Map
|
||||
var messageSenders *collx.SM[ChannelType, MsgSender] = collx.NewSM[ChannelType, MsgSender]()
|
||||
|
||||
// RegisterMsgSender 注册消息发送器
|
||||
func RegisterMsgSender(channel ChannelType, sender MsgSender) {
|
||||
@@ -84,5 +83,5 @@ func GetMsgSender(channel ChannelType) (MsgSender, error) {
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unsupported message channel %s", channel)
|
||||
}
|
||||
return sender.(MsgSender), nil
|
||||
return sender, nil
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"mayfly-go/internal/msg/msgx"
|
||||
"mayfly-go/pkg/i18n"
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
"mayfly-go/pkg/utils/stringx"
|
||||
"mayfly-go/pkg/ws"
|
||||
|
||||
@@ -27,7 +28,7 @@ func (e WsSender) Send(ctx context.Context, channel *msgx.Channel, msg *msgx.Msg
|
||||
}
|
||||
}
|
||||
|
||||
jsonMsg := msg.TmplExtra
|
||||
jsonMsg := collx.CopyM(msg.TmplExtra)
|
||||
jsonMsg["msg"] = content
|
||||
jsonMsg["title"] = msg.Title
|
||||
jsonMsg["params"] = msg.Params
|
||||
|
||||
Reference in New Issue
Block a user