|
|
@ -2,10 +2,6 @@ package friend
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/common/check"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/common/convert"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/internal/common/notification"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
|
|
@ -15,6 +11,9 @@ import (
|
|
|
|
registry "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
|
|
|
registry "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
|
|
|
pbfriend "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/friend"
|
|
|
|
pbfriend "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/friend"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/check"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/convert"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -47,6 +46,7 @@ func Start(client registry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
|
|
|
|
|
|
|
|
|
|
|
// ok
|
|
|
|
// ok
|
|
|
|
func (s *friendServer) ApplyToAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriendReq) (resp *pbfriend.ApplyToAddFriendResp, err error) {
|
|
|
|
func (s *friendServer) ApplyToAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriendReq) (resp *pbfriend.ApplyToAddFriendResp, err error) {
|
|
|
|
|
|
|
|
resp = &pbfriend.ApplyToAddFriendResp{}
|
|
|
|
if err := tokenverify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
|
|
|
if err := tokenverify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -70,7 +70,7 @@ func (s *friendServer) ApplyToAddFriend(ctx context.Context, req *pbfriend.Apply
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s.notification.FriendApplicationAddNotification(ctx, req)
|
|
|
|
s.notification.FriendApplicationAddNotification(ctx, req)
|
|
|
|
return &pbfriend.ApplyToAddFriendResp{}, nil
|
|
|
|
return resp, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ok
|
|
|
|
// ok
|
|
|
|