refactor: all module update.

This commit is contained in:
Gordon 2024-04-10 11:49:51 +08:00
parent b477577747
commit 9b9c48222b
2 changed files with 5 additions and 3 deletions

View File

@ -144,6 +144,8 @@ type Notification struct {
GroupMemberMuted NotificationConfig `mapstructure:"groupMemberMuted"` GroupMemberMuted NotificationConfig `mapstructure:"groupMemberMuted"`
GroupMemberCancelMuted NotificationConfig `mapstructure:"groupMemberCancelMuted"` GroupMemberCancelMuted NotificationConfig `mapstructure:"groupMemberCancelMuted"`
GroupMemberInfoSet NotificationConfig `mapstructure:"groupMemberInfoSet"` GroupMemberInfoSet NotificationConfig `mapstructure:"groupMemberInfoSet"`
GroupMemberSetToAdmin NotificationConfig `yaml:"groupMemberSetToAdmin"`
GroupMemberSetToOrdinary NotificationConfig `yaml:"groupMemberSetToOrdinaryUser"`
GroupInfoSetAnnouncement NotificationConfig `mapstructure:"groupInfoSetAnnouncement"` GroupInfoSetAnnouncement NotificationConfig `mapstructure:"groupInfoSetAnnouncement"`
GroupInfoSetName NotificationConfig `mapstructure:"groupInfoSetName"` GroupInfoSetName NotificationConfig `mapstructure:"groupInfoSetName"`
FriendApplicationAdded NotificationConfig `mapstructure:"friendApplicationAdded"` FriendApplicationAdded NotificationConfig `mapstructure:"friendApplicationAdded"`

View File

@ -34,8 +34,8 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
func newContentTypeConf(conf *config.Notification) map[int32]config.NotificationConf { func newContentTypeConf(conf *config.Notification) map[int32]config.NotificationConfig {
return map[int32]config.NotificationConf{ return map[int32]config.NotificationConfig{
// group // group
constant.GroupCreatedNotification: conf.GroupCreated, constant.GroupCreatedNotification: conf.GroupCreated,
constant.GroupInfoSetNotification: conf.GroupInfoSet, constant.GroupInfoSetNotification: conf.GroupInfoSet,
@ -213,7 +213,7 @@ func (m *MessageRpcClient) GetConversationMaxSeq(ctx context.Context, conversati
} }
type NotificationSender struct { type NotificationSender struct {
contentTypeConf map[int32]config.NotificationConf contentTypeConf map[int32]config.NotificationConfig
sessionTypeConf map[int32]int32 sessionTypeConf map[int32]int32
sendMsg func(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error) sendMsg func(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)
getUserInfo func(ctx context.Context, userID string) (*sdkws.UserInfo, error) getUserInfo func(ctx context.Context, userID string) (*sdkws.UserInfo, error)