mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 10:52:33 +08:00
friend
This commit is contained in:
parent
7834c038a9
commit
dbeeb6d2b1
@ -16,6 +16,7 @@ package friend
|
||||
|
||||
import (
|
||||
"context"
|
||||
tx2 "github.com/openimsdk/open-im-server/v3/pkg/common/db/tx"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/sdkws"
|
||||
|
||||
@ -32,7 +33,6 @@ import (
|
||||
pbfriend "github.com/OpenIMSDK/protocol/friend"
|
||||
registry "github.com/OpenIMSDK/tools/discoveryregistry"
|
||||
"github.com/OpenIMSDK/tools/errs"
|
||||
"github.com/OpenIMSDK/tools/tx"
|
||||
"github.com/OpenIMSDK/tools/utils"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/cache"
|
||||
@ -89,14 +89,17 @@ func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
||||
&msgRpcClient,
|
||||
notification.WithRpcFunc(userRpcClient.GetUsersInfo),
|
||||
)
|
||||
|
||||
tx, err := tx2.NewAuto(context.Background(), mongo.GetClient())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Register Friend server with refactored MongoDB and Redis integrations
|
||||
pbfriend.RegisterFriendServer(server, &friendServer{
|
||||
friendDatabase: controller.NewFriendDatabase(
|
||||
friendMongoDB,
|
||||
friendRequestMongoDB,
|
||||
cache.NewFriendCacheRedis(rdb, friendMongoDB, cache.GetDefaultOpt()),
|
||||
tx.NewMongo(mongo.GetClient()),
|
||||
tx,
|
||||
),
|
||||
blackDatabase: controller.NewBlackDatabase(
|
||||
blackMongoDB,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user