split notificationSender

This commit is contained in:
wangchuxiao
2023-05-29 17:42:55 +08:00
parent 02b4c012ad
commit 232abf46a4
5 changed files with 106 additions and 59 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ package notification
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
@@ -13,7 +14,7 @@ import (
)
type FriendNotificationSender struct {
*rpcclient.MsgClient
*rpcclient.NotificationSender
// 找不到报错
getUsersInfo func(ctx context.Context, userIDs []string) ([]rpcclient.CommonUser, error)
// db controller
@@ -62,7 +63,7 @@ func WithRpcFunc(fn func(ctx context.Context, userIDs []string) ([]*sdkws.UserIn
func NewFriendNotificationSender(client discoveryregistry.SvcDiscoveryRegistry, opts ...friendNotificationSenderOptions) *FriendNotificationSender {
f := &FriendNotificationSender{
MsgClient: rpcclient.NewMsgClient(client),
NotificationSender: rpcclient.NewNotificationSender(rpcclient.WithDiscov(client)),
}
for _, opt := range opts {
opt(f)