fix: changing naming irregularities under pkg and internal packages, #520

pull/536/head
BanTanger 2 years ago
parent 843611759b
commit 5a0400b88f

@ -57,15 +57,15 @@ func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) e
pbGroup.RegisterGroupServer(server, &groupServer{ pbGroup.RegisterGroupServer(server, &groupServer{
GroupDatabase: database, GroupDatabase: database,
User: userRPCClient, 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) users, err := userRPCClient.GetUsersInfo(ctx, userIDs)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return utils.Slice(users, func(e *sdkws.UserInfo) notification.CommonUser { return e }), nil return utils.Slice(users, func(e *sdkws.UserInfo) notification.CommonUser { return e }), nil
}), }),
conversationRpcClient: conversationRPCClient, conversationRPCClient: conversationRPCClient,
msgRpcClient: msgRPCClient, msgRPCClient: msgRPCClient,
}) })
return nil return nil
} }

@ -70,7 +70,7 @@ func InitMsgTool() (*MsgTool, error) {
groupDatabase := controller.InitGroupDatabase(db, rdb, mongo.GetDatabase()) groupDatabase := controller.InitGroupDatabase(db, rdb, mongo.GetDatabase())
conversationDatabase := controller.NewConversationDatabase(relation.NewConversationGorm(db), cache.NewConversationRedis(rdb, cache.GetDefaultOpt(), relation.NewConversationGorm(db)), tx.NewGorm(db)) conversationDatabase := controller.NewConversationDatabase(relation.NewConversationGorm(db), cache.NewConversationRedis(rdb, cache.GetDefaultOpt(), relation.NewConversationGorm(db)), tx.NewGorm(db))
msgRpcClient := rpcclient.NewMessageRpcClient(discov) msgRpcClient := rpcclient.NewMessageRpcClient(discov)
msgNotificationSender := notification.NewMsgNotificationSender(rpcclient.WithRpcClient(&msgRpcClient)) msgNotificationSender := notification.NewMsgNotificationSender(rpcclient.WithRPCClient(&msgRpcClient))
msgTool := NewMsgTool(msgDatabase, userDatabase, groupDatabase, conversationDatabase, msgNotificationSender) msgTool := NewMsgTool(msgDatabase, userDatabase, groupDatabase, conversationDatabase, msgNotificationSender)
return msgTool, nil return msgTool, nil
} }

Loading…
Cancel
Save