diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 6ca75ced4..c5d443085 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -57,15 +57,15 @@ func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) e pbGroup.RegisterGroupServer(server, &groupServer{ GroupDatabase: database, User: userRPCClient, - Notification: notification.NewGroupNotificationSender(database, &msgRpcClient, &userRpcClient, func(ctx context.Context, userIDs []string) ([]notification.CommonUser, error) { + Notification: notification.NewGroupNotificationSender(database, &msgRPCClient, &userRPCClient, func(ctx context.Context, userIDs []string) ([]notification.CommonUser, error) { users, err := userRPCClient.GetUsersInfo(ctx, userIDs) if err != nil { return nil, err } return utils.Slice(users, func(e *sdkws.UserInfo) notification.CommonUser { return e }), nil }), - conversationRpcClient: conversationRPCClient, - msgRpcClient: msgRPCClient, + conversationRPCClient: conversationRPCClient, + msgRPCClient: msgRPCClient, }) return nil } diff --git a/internal/tools/msg.go b/internal/tools/msg.go index 7247d32eb..aafeb4c92 100644 --- a/internal/tools/msg.go +++ b/internal/tools/msg.go @@ -70,7 +70,7 @@ func InitMsgTool() (*MsgTool, error) { groupDatabase := controller.InitGroupDatabase(db, rdb, mongo.GetDatabase()) conversationDatabase := controller.NewConversationDatabase(relation.NewConversationGorm(db), cache.NewConversationRedis(rdb, cache.GetDefaultOpt(), relation.NewConversationGorm(db)), tx.NewGorm(db)) msgRpcClient := rpcclient.NewMessageRpcClient(discov) - msgNotificationSender := notification.NewMsgNotificationSender(rpcclient.WithRpcClient(&msgRpcClient)) + msgNotificationSender := notification.NewMsgNotificationSender(rpcclient.WithRPCClient(&msgRpcClient)) msgTool := NewMsgTool(msgDatabase, userDatabase, groupDatabase, conversationDatabase, msgNotificationSender) return msgTool, nil }