mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-11 20:45:57 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
This commit is contained in:
@@ -11,8 +11,8 @@ import (
|
||||
"context"
|
||||
)
|
||||
|
||||
func (s *friendServer) GetBlacks(ctx context.Context, req *pbFriend.GetBlacksReq) (*pbFriend.GetBlacksResp, error) {
|
||||
resp := &pbFriend.GetBlacksResp{}
|
||||
func (s *friendServer) GetPaginationBlacks(ctx context.Context, req *pbFriend.GetPaginationBlacksReq) (resp *pbFriend.GetPaginationBlacksResp, err error) {
|
||||
resp = &pbFriend.GetPaginationBlacksResp{}
|
||||
if err := check.Access(ctx, req.UserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -24,7 +24,6 @@ func (s *friendServer) GetBlacks(ctx context.Context, req *pbFriend.GetBlacksReq
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp.Total = int32(total)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import (
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
pbFriend "Open_IM/pkg/proto/friend"
|
||||
sdkws "Open_IM/pkg/proto/sdk_ws"
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
@@ -128,22 +127,22 @@ func (s *friendServer) Run() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq) (*pbFriend.AddFriendResp, error) {
|
||||
resp := &pbFriend.AddFriendResp{}
|
||||
// ok
|
||||
func (s *friendServer) ApplyToAddFriend(ctx context.Context, req *pbFriend.ApplyToAddFriendReq) (resp *pbFriend.ApplyToAddFriendResp, err error) {
|
||||
resp = &pbFriend.ApplyToAddFriendResp{}
|
||||
if err := token_verify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := callbackBeforeAddFriendV1(ctx, req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
//检查toUserID fromUserID是否存在
|
||||
if req.ToUserID == req.FromUserID {
|
||||
return nil, constant.ErrCanNotAddYourself.Wrap()
|
||||
}
|
||||
if _, err := check.GetUsersInfo(ctx, req.ToUserID, req.FromUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
//from是否在to的好友列表里面
|
||||
err, in1, in2 := s.FriendInterface.CheckIn(ctx, req.FromUserID, req.ToUserID)
|
||||
in1, in2, err := s.FriendInterface.CheckIn(ctx, req.FromUserID, req.ToUserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -153,34 +152,36 @@ func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq
|
||||
if err = s.FriendInterface.AddFriendRequest(ctx, req.FromUserID, req.ToUserID, req.ReqMsg, req.Ex); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.FriendApplicationNotification(ctx, req)
|
||||
chat.FriendApplicationAddNotification(ctx, req)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *friendServer) ImportFriends(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.ImportFriendResp, error) {
|
||||
resp := &pbFriend.ImportFriendResp{}
|
||||
// ok
|
||||
func (s *friendServer) ImportFriends(ctx context.Context, req *pbFriend.ImportFriendReq) (resp *pbFriend.ImportFriendResp, err error) {
|
||||
resp = &pbFriend.ImportFriendResp{}
|
||||
if err := token_verify.CheckAdmin(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := check.GetUsersInfo(ctx, req.OwnerUserID); err != nil {
|
||||
if _, err := check.GetUsersInfo(ctx, req.OwnerUserID, req.FriendUserIDs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var friends []*relation2.FriendModel
|
||||
for _, userID := range utils.RemoveDuplicateElement(req.FriendUserIDs) {
|
||||
friends = append(friends, &relation2.FriendModel{OwnerUserID: userID, FriendUserID: req.OwnerUserID, AddSource: constant.BecomeFriendByImport, OperatorUserID: tracelog.GetOpUserID(ctx)})
|
||||
if utils.Contain(req.FriendUserIDs, req.OwnerUserID) {
|
||||
return nil, constant.ErrCanNotAddYourself.Wrap()
|
||||
}
|
||||
if len(friends) > 0 {
|
||||
if err := s.FriendInterface.BecomeFriend(ctx, friends); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if utils.Duplicate(req.FriendUserIDs) {
|
||||
return nil, constant.ErrArgs.Wrap("friend userID repeated")
|
||||
}
|
||||
|
||||
if err := s.FriendInterface.BecomeFriends(ctx, req.OwnerUserID, req.FriendUserIDs, constant.BecomeFriendByImport, tracelog.GetOpUserID(ctx)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// process Friend application
|
||||
func (s *friendServer) RespondFriendApply(ctx context.Context, req *pbFriend.RespondFriendApplyReq) (*pbFriend.RespondFriendApplyResp, error) {
|
||||
resp := &pbFriend.RespondFriendApplyResp{}
|
||||
// ok
|
||||
func (s *friendServer) RespondFriendApply(ctx context.Context, req *pbFriend.RespondFriendApplyReq) (resp *pbFriend.RespondFriendApplyResp, err error) {
|
||||
resp = &pbFriend.RespondFriendApplyResp{}
|
||||
if err := check.Access(ctx, req.ToUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -190,7 +191,7 @@ func (s *friendServer) RespondFriendApply(ctx context.Context, req *pbFriend.Res
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.FriendApplicationApprovedNotification(ctx, req)
|
||||
chat.FriendApplicationAgreedNotification(ctx, req)
|
||||
return resp, nil
|
||||
}
|
||||
if req.HandleResult == constant.FriendResponseRefuse {
|
||||
@@ -198,29 +199,39 @@ func (s *friendServer) RespondFriendApply(ctx context.Context, req *pbFriend.Res
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.FriendApplicationRejectedNotification(ctx, req)
|
||||
chat.FriendApplicationRefusedNotification(ctx, req)
|
||||
return resp, nil
|
||||
}
|
||||
return nil, constant.ErrArgs.Wrap("req.HandleResult != -1/1")
|
||||
}
|
||||
|
||||
func (s *friendServer) DeleteFriend(ctx context.Context, req *pbFriend.DeleteFriendReq) (*pbFriend.DeleteFriendResp, error) {
|
||||
resp := &pbFriend.DeleteFriendResp{}
|
||||
// ok
|
||||
func (s *friendServer) DeleteFriend(ctx context.Context, req *pbFriend.DeleteFriendReq) (resp *pbFriend.DeleteFriendResp, err error) {
|
||||
resp = &pbFriend.DeleteFriendResp{}
|
||||
if err := check.Access(ctx, req.OwnerUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.FriendInterface.Delete(ctx, req.OwnerUserID, req.FriendUserID); err != nil {
|
||||
_, err = s.FindFriends(ctx, req.OwnerUserID, []string{req.FriendUserID})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.FriendInterface.Delete(ctx, req.OwnerUserID, []string{req.FriendUserID}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.FriendDeletedNotification(ctx, req)
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *friendServer) SetFriendRemark(ctx context.Context, req *pbFriend.SetFriendRemarkReq) (*pbFriend.SetFriendRemarkResp, error) {
|
||||
resp := &pbFriend.SetFriendRemarkResp{}
|
||||
// ok
|
||||
func (s *friendServer) SetFriendRemark(ctx context.Context, req *pbFriend.SetFriendRemarkReq) (resp *pbFriend.SetFriendRemarkResp, err error) {
|
||||
resp = &pbFriend.SetFriendRemarkResp{}
|
||||
if err := check.Access(ctx, req.OwnerUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = s.FindFriends(ctx, req.OwnerUserID, []string{req.FriendUserID})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.FriendInterface.UpdateRemark(ctx, req.OwnerUserID, req.FriendUserID, req.Remark); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -228,8 +239,9 @@ func (s *friendServer) SetFriendRemark(ctx context.Context, req *pbFriend.SetFri
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *friendServer) GetFriends(ctx context.Context, req *pbFriend.GetFriendsReq) (*pbFriend.GetFriendsResp, error) {
|
||||
resp := &pbFriend.GetFriendsResp{}
|
||||
// ok
|
||||
func (s *friendServer) GetDesignatedFriendsReq(ctx context.Context, req *pbFriend.GetDesignatedFriendsReq) (resp *pbFriend.GetDesignatedFriendsResp, err error) {
|
||||
resp = &pbFriend.GetDesignatedFriendsResp{}
|
||||
if err := check.Access(ctx, req.UserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -237,18 +249,6 @@ func (s *friendServer) GetFriends(ctx context.Context, req *pbFriend.GetFriendsR
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
userIDList := make([]string, 0, len(friends))
|
||||
for _, f := range friends {
|
||||
userIDList = append(userIDList, f.FriendUserID)
|
||||
}
|
||||
users, err := check.GetUsersInfo(ctx, userIDList)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
userMap := make(map[string]*sdkws.UserInfo)
|
||||
for i, user := range users {
|
||||
userMap[user.UserID] = users[i]
|
||||
}
|
||||
resp.FriendsInfo, err = (*convert.DBFriend)(nil).DB2PB(friends)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -257,9 +257,9 @@ func (s *friendServer) GetFriends(ctx context.Context, req *pbFriend.GetFriendsR
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// 获取接收到的好友申请(即别人主动申请的)
|
||||
func (s *friendServer) GetToFriendsApply(ctx context.Context, req *pbFriend.GetToFriendsApplyReq) (*pbFriend.GetToFriendsApplyResp, error) {
|
||||
resp := &pbFriend.GetToFriendsApplyResp{}
|
||||
// ok 获取接收到的好友申请(即别人主动申请的)
|
||||
func (s *friendServer) GetPaginationFriendsApplyTo(ctx context.Context, req *pbFriend.GetPaginationFriendsApplyToReq) (resp *pbFriend.GetPaginationFriendsApplyToResp, err error) {
|
||||
resp = &pbFriend.GetPaginationFriendsApplyToResp{}
|
||||
if err := check.Access(ctx, req.UserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -275,9 +275,9 @@ func (s *friendServer) GetToFriendsApply(ctx context.Context, req *pbFriend.GetT
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// 获取主动发出去的好友申请列表
|
||||
func (s *friendServer) GetFromFriendsApply(ctx context.Context, req *pbFriend.GetFromFriendsApplyReq) (*pbFriend.GetFromFriendsApplyResp, error) {
|
||||
resp := &pbFriend.GetFromFriendsApplyResp{}
|
||||
// ok 获取主动发出去的好友申请列表
|
||||
func (s *friendServer) GetPaginationFriendsApplyFrom(ctx context.Context, req *pbFriend.GetPaginationFriendsApplyFromReq) (resp *pbFriend.GetPaginationFriendsApplyFromResp, err error) {
|
||||
resp = &pbFriend.GetPaginationFriendsApplyFromResp{}
|
||||
if err := check.Access(ctx, req.UserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -293,26 +293,28 @@ func (s *friendServer) GetFromFriendsApply(ctx context.Context, req *pbFriend.Ge
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *friendServer) IsFriend(ctx context.Context, req *pbFriend.IsFriendReq) (*pbFriend.IsFriendResp, error) {
|
||||
resp := &pbFriend.IsFriendResp{}
|
||||
err, in1, in2 := s.FriendInterface.CheckIn(ctx, req.UserID1, req.UserID2)
|
||||
// ok
|
||||
func (s *friendServer) IsFriend(ctx context.Context, req *pbFriend.IsFriendReq) (resp *pbFriend.IsFriendResp, err error) {
|
||||
resp = &pbFriend.IsFriendResp{}
|
||||
resp.InUser1Friends, resp.InUser2Friends, err = s.FriendInterface.CheckIn(ctx, req.UserID1, req.UserID2)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.InUser1Friends = in1
|
||||
resp.InUser2Friends = in2
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *friendServer) GetFriendsInfo(ctx context.Context, req *pbFriend.GetFriendsInfoReq) (*pbFriend.GetFriendsInfoResp, error) {
|
||||
resp := pbFriend.GetFriendsInfoResp{}
|
||||
// ok
|
||||
func (s *friendServer) GetPaginationFriends(ctx context.Context, req *pbFriend.GetPaginationFriendsReq) (resp *pbFriend.GetPaginationFriendsResp, err error) {
|
||||
resp = &pbFriend.GetPaginationFriendsResp{}
|
||||
if utils.Duplicate(req.FriendUserIDs) {
|
||||
return nil, constant.ErrArgs.Wrap("friend userID repeated")
|
||||
}
|
||||
friends, err := s.FriendInterface.FindFriends(ctx, req.OwnerUserID, req.FriendUserIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.FriendsInfo, err = (*convert.DBFriend)(nil).DB2PB(friends)
|
||||
if err != nil {
|
||||
if resp.FriendsInfo, err = (*convert.DBFriend)(nil).DB2PB(friends); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
+57
-37
@@ -22,6 +22,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/OpenIMSDK/getcdv3"
|
||||
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||
"math/big"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -256,32 +257,37 @@ func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJo
|
||||
if err := token_verify.CheckAccessV3(ctx, req.FromUserID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
total, groups, err := s.GroupInterface.FindJoinedGroup(ctx, req.FromUserID, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
total, members, err := s.GroupInterface.PageGroupMember(ctx, nil, []string{req.FromUserID}, nil, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Total = total
|
||||
if len(groups) == 0 {
|
||||
if len(members) == 0 {
|
||||
return resp, nil
|
||||
}
|
||||
groupIDs := utils.Slice(groups, func(e *relation2.GroupModel) string {
|
||||
groupIDs := utils.Slice(members, func(e *relation2.GroupMemberModel) string {
|
||||
return e.GroupID
|
||||
})
|
||||
groups, err := s.GroupInterface.FindGroup(ctx, groupIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
groupMemberNum, err := s.GroupInterface.MapGroupMemberNum(ctx, groupIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
groupOwnerUserID, err := s.GroupInterface.MapGroupOwnerUserID(ctx, groupIDs)
|
||||
owners, err := s.GroupInterface.FindGroupMember(ctx, groupIDs, nil, []int32{constant.GroupOwner})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, group := range groups {
|
||||
if group.Status == constant.GroupStatusDismissed || group.GroupType == constant.SuperGroup {
|
||||
continue
|
||||
}
|
||||
resp.Groups = append(resp.Groups, DbToPbGroupInfo(group, groupOwnerUserID[group.GroupID], uint32(groupMemberNum[group.GroupID])))
|
||||
}
|
||||
resp.Total = int32(len(resp.Groups))
|
||||
ownerMap := utils.SliceToMap(owners, func(e *relation2.GroupMemberModel) string {
|
||||
return e.GroupID
|
||||
})
|
||||
resp.Groups = utils.Slice(utils.Order(groupIDs, groups, func(group *relation2.GroupModel) string {
|
||||
return group.GroupID
|
||||
}), func(group *relation2.GroupModel) *open_im_sdk.GroupInfo {
|
||||
return DbToPbGroupInfo(group, ownerMap[group.GroupID].UserID, uint32(groupMemberNum[group.GroupID]))
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -300,7 +306,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
if group.Status == constant.GroupStatusDismissed {
|
||||
return nil, constant.ErrDismissedAlready.Wrap()
|
||||
}
|
||||
members, err := s.GroupInterface.FindGroupMemberAll(ctx, group.GroupID)
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, []string{group.GroupID}, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -350,7 +356,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
}
|
||||
}
|
||||
if group.GroupType == constant.SuperGroup {
|
||||
if err := s.GroupInterface.AddUserToSuperGroup(ctx, req.GroupID, req.InvitedUserIDs); err != nil {
|
||||
if err := s.GroupInterface.CreateSuperGroupMember(ctx, req.GroupID, req.InvitedUserIDs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, userID := range req.InvitedUserIDs {
|
||||
@@ -371,7 +377,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
}
|
||||
groupMembers = append(groupMembers, member)
|
||||
}
|
||||
if err := s.GroupInterface.CreateGroupMember(ctx, groupMembers); err != nil {
|
||||
if err := s.GroupInterface.CreateGroup(ctx, nil, groupMembers); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.MemberInvitedNotification(tracelog.GetOperationID(ctx), req.GroupID, tracelog.GetOpUserID(ctx), req.Reason, req.InvitedUserIDs)
|
||||
@@ -388,7 +394,7 @@ func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGro
|
||||
if group.GroupType == constant.SuperGroup {
|
||||
return nil, constant.ErrArgs.Wrap("unsupported super group")
|
||||
}
|
||||
members, err := s.GroupInterface.FindGroupMemberAll(ctx, req.GroupID)
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, []string{req.GroupID}, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -400,10 +406,11 @@ func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGro
|
||||
|
||||
func (s *groupServer) GetGroupMemberList(ctx context.Context, req *pbGroup.GetGroupMemberListReq) (*pbGroup.GetGroupMemberListResp, error) {
|
||||
resp := &pbGroup.GetGroupMemberListResp{}
|
||||
members, err := s.GroupInterface.FindGroupMemberFilterList(ctx, req.GroupID, req.Filter, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
total, members, err := s.GroupInterface.PageGroupMember(ctx, []string{req.GroupID}, nil, utils.If(req.Filter >= 0, []int32{req.Filter}, nil), req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Total = total
|
||||
resp.Members = utils.Slice(members, func(e *relation2.GroupMemberModel) *open_im_sdk.GroupMemberFullInfo {
|
||||
return DbToPbGroupMembersCMSResp(e)
|
||||
})
|
||||
@@ -436,7 +443,7 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
||||
}
|
||||
}()
|
||||
} else {
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, req.GroupID, append(req.KickedUserIDs, opUserID))
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, []string{req.GroupID}, append(req.KickedUserIDs, opUserID), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -479,7 +486,13 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
||||
|
||||
func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetGroupMembersInfoReq) (*pbGroup.GetGroupMembersInfoResp, error) {
|
||||
resp := &pbGroup.GetGroupMembersInfoResp{}
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, req.GroupID, req.Members)
|
||||
if len(req.Members) == 0 {
|
||||
return nil, constant.ErrArgs.Wrap("members empty")
|
||||
}
|
||||
if req.GroupID == "" {
|
||||
return nil, constant.ErrArgs.Wrap("groupID empty")
|
||||
}
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, []string{req.GroupID}, req.Members, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -491,10 +504,11 @@ func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetG
|
||||
|
||||
func (s *groupServer) GetGroupApplicationList(ctx context.Context, req *pbGroup.GetGroupApplicationListReq) (*pbGroup.GetGroupApplicationListResp, error) {
|
||||
resp := &pbGroup.GetGroupApplicationListResp{}
|
||||
groupRequests, err := s.GroupInterface.GetGroupRecvApplicationList(ctx, req.FromUserID)
|
||||
total, groupRequests, err := s.GroupInterface.PageGroupRequestUser(ctx, req.FromUserID, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Total = total
|
||||
if len(groupRequests) == 0 {
|
||||
return resp, nil
|
||||
}
|
||||
@@ -529,12 +543,15 @@ func (s *groupServer) GetGroupApplicationList(ctx context.Context, req *pbGroup.
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
groupOwnerUserIDMap, err := s.GroupInterface.MapGroupOwnerUserID(ctx, groupIDs)
|
||||
owners, err := s.GroupInterface.FindGroupMember(ctx, groupIDs, nil, []int32{constant.GroupOwner})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ownerMap := utils.SliceToMap(owners, func(e *relation2.GroupMemberModel) string {
|
||||
return e.GroupID
|
||||
})
|
||||
resp.GroupRequests = utils.Slice(groupRequests, func(e *relation2.GroupRequestModel) *open_im_sdk.GroupRequest {
|
||||
return DbToPbGroupRequest(e, userMap[e.UserID], DbToPbGroupInfo(groupMap[e.GroupID], groupOwnerUserIDMap[e.GroupID], uint32(groupMemberNumMap[e.GroupID])))
|
||||
return DbToPbGroupRequest(e, userMap[e.UserID], DbToPbGroupInfo(groupMap[e.GroupID], ownerMap[e.GroupID].UserID, uint32(groupMemberNumMap[e.GroupID])))
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
@@ -552,12 +569,15 @@ func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsI
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
groupOwnerUserIDMap, err := s.GroupInterface.MapGroupOwnerUserID(ctx, req.GroupIDs)
|
||||
owners, err := s.GroupInterface.FindGroupMember(ctx, req.GroupIDs, nil, []int32{constant.GroupOwner})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ownerMap := utils.SliceToMap(owners, func(e *relation2.GroupMemberModel) string {
|
||||
return e.GroupID
|
||||
})
|
||||
resp.GroupInfos = utils.Slice(groups, func(e *relation2.GroupModel) *open_im_sdk.GroupInfo {
|
||||
return DbToPbGroupInfo(e, groupOwnerUserIDMap[e.GroupID], uint32(groupMemberNumMap[e.GroupID]))
|
||||
return DbToPbGroupInfo(e, ownerMap[e.GroupID].UserID, uint32(groupMemberNumMap[e.GroupID]))
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
@@ -657,7 +677,7 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq)
|
||||
if err := CallbackBeforeMemberJoinGroup(ctx, tracelog.GetOperationID(ctx), groupMember, group.Ex); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.GroupInterface.CreateGroupMember(ctx, []*relation2.GroupMemberModel{groupMember}); err != nil {
|
||||
if err := s.GroupInterface.CreateGroup(ctx, nil, []*relation2.GroupMemberModel{groupMember}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.MemberEnterDirectlyNotification(req.GroupID, tracelog.GetOpUserID(ctx), tracelog.GetOperationID(ctx))
|
||||
@@ -746,7 +766,7 @@ func (s *groupServer) TransferGroupOwner(ctx context.Context, req *pbGroup.Trans
|
||||
if req.OldOwnerUserID == req.NewOwnerUserID {
|
||||
return nil, constant.ErrArgs.Wrap("OldOwnerUserID == NewOwnerUserID")
|
||||
}
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, req.GroupID, []string{req.OldOwnerUserID, req.NewOwnerUserID})
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, []string{req.GroupID}, []string{req.OldOwnerUserID, req.NewOwnerUserID}, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -774,7 +794,7 @@ func (s *groupServer) TransferGroupOwner(ctx context.Context, req *pbGroup.Trans
|
||||
return nil, constant.ErrNoPermission.Wrap(fmt.Sprintf("user %s no permission transfer group owner", tracelog.GetOpUserID(ctx)))
|
||||
}
|
||||
}
|
||||
if err := s.GroupInterface.TransferGroupOwner(ctx, req.GroupID, req.OldOwnerUserID, req.NewOwnerUserID); err != nil {
|
||||
if err := s.GroupInterface.TransferGroupOwner(ctx, req.GroupID, req.OldOwnerUserID, req.NewOwnerUserID, newOwner.RoleLevel); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.GroupOwnerTransferredNotification(req)
|
||||
@@ -799,7 +819,7 @@ func (s *groupServer) GetGroups(ctx context.Context, req *pbGroup.GetGroupsReq)
|
||||
groupIDs := utils.Slice(groups, func(e *relation2.GroupModel) string {
|
||||
return e.GroupID
|
||||
})
|
||||
ownerMembers, err := s.GroupInterface.FindGroupOwnerUser(ctx, groupIDs)
|
||||
ownerMembers, err := s.GroupInterface.FindGroupMember(ctx, groupIDs, nil, []int32{constant.GroupOwner})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -822,7 +842,7 @@ func (s *groupServer) GetGroups(ctx context.Context, req *pbGroup.GetGroupsReq)
|
||||
|
||||
func (s *groupServer) GetGroupMembersCMS(ctx context.Context, req *pbGroup.GetGroupMembersCMSReq) (*pbGroup.GetGroupMembersCMSResp, error) {
|
||||
resp := &pbGroup.GetGroupMembersCMSResp{}
|
||||
total, members, err := s.GroupInterface.SearchGroupMember(ctx, req.GroupID, req.UserName, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
total, members, err := s.GroupInterface.SearchGroupMember(ctx, req.UserName, []string{req.GroupID}, nil, nil, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -839,7 +859,7 @@ func (s *groupServer) GetUserReqApplicationList(ctx context.Context, req *pbGrou
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
total, requests, err := s.GroupInterface.FindUserGroupRequest(ctx, req.UserID, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
total, requests, err := s.GroupInterface.PageGroupRequestUser(ctx, req.UserID, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -860,7 +880,7 @@ func (s *groupServer) GetUserReqApplicationList(ctx context.Context, req *pbGrou
|
||||
if ids := utils.Single(groupIDs, utils.Keys(groupMap)); len(ids) > 0 {
|
||||
return nil, constant.ErrGroupIDNotFound.Wrap(strings.Join(ids, ","))
|
||||
}
|
||||
owners, err := s.GroupInterface.FindGroupOwnerUser(ctx, groupIDs)
|
||||
owners, err := s.GroupInterface.FindGroupMember(ctx, groupIDs, nil, []int32{constant.GroupOwner})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1034,16 +1054,16 @@ func (s *groupServer) GetGroupAbstractInfo(ctx context.Context, req *pbGroup.Get
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
numMap, err := s.GroupInterface.MapGroupMemberNum(ctx, req.GroupIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hashMap, err := s.GroupInterface.MapGroupHash(ctx, req.GroupIDs)
|
||||
groupUserMap, err := s.GroupInterface.MapGroupMemberUserID(ctx, req.GroupIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.GroupAbstractInfos = utils.Slice(groups, func(e *relation2.GroupModel) *pbGroup.GroupAbstractInfo {
|
||||
return DbToPbGroupAbstractInfo(e.GroupID, int32(numMap[e.GroupID]), hashMap[e.GroupID])
|
||||
userIDs := groupUserMap[e.GroupID]
|
||||
utils.Sort(userIDs, true)
|
||||
bi := big.NewInt(0)
|
||||
bi.SetString(utils.Md5(strings.Join(userIDs, ";;"))[0:8], 16)
|
||||
return DbToPbGroupAbstractInfo(e.GroupID, int32(len(userIDs)), bi.Uint64())
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
@@ -1053,7 +1073,7 @@ func (s *groupServer) GetUserInGroupMembers(ctx context.Context, req *pbGroup.Ge
|
||||
if len(req.GroupIDs) == 0 {
|
||||
return nil, constant.ErrArgs.Wrap("groupIDs empty")
|
||||
}
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, req.UserID, req.GroupIDs)
|
||||
members, err := s.GroupInterface.FindGroupMember(ctx, []string{req.UserID}, req.GroupIDs, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -23,10 +23,13 @@ func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ownerIdMap, err := s.GroupInterface.MapGroupOwnerUserID(ctx, groupIDs)
|
||||
owners, err := s.GroupInterface.FindGroupMember(ctx, groupIDs, nil, []int32{constant.GroupOwner})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ownerMap := utils.SliceToMap(owners, func(e *relation.GroupMemberModel) string {
|
||||
return e.GroupID
|
||||
})
|
||||
groups, err := s.GroupInterface.FindGroup(ctx, groupIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -35,7 +38,7 @@ func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.
|
||||
return e.GroupID
|
||||
})
|
||||
resp.Groups = utils.Slice(groupIDs, func(groupID string) *sdk_ws.GroupInfo {
|
||||
return DbToPbGroupInfo(groupMap[groupID], ownerIdMap[groupID], numMap[groupID])
|
||||
return DbToPbGroupInfo(groupMap[groupID], ownerMap[groupID].UserID, numMap[groupID])
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
@@ -53,12 +56,15 @@ func (s *groupServer) GetSuperGroupsInfo(ctx context.Context, req *pbGroup.GetSu
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ownerIdMap, err := s.GroupInterface.MapGroupOwnerUserID(ctx, req.GroupIDs)
|
||||
owners, err := s.GroupInterface.FindGroupMember(ctx, req.GroupIDs, nil, []int32{constant.GroupOwner})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ownerMap := utils.SliceToMap(owners, func(e *relation.GroupMemberModel) string {
|
||||
return e.GroupID
|
||||
})
|
||||
resp.GroupInfos = utils.Slice(groups, func(e *relation.GroupModel) *sdk_ws.GroupInfo {
|
||||
return DbToPbGroupInfo(e, ownerIdMap[e.GroupID], numMap[e.GroupID])
|
||||
return DbToPbGroupInfo(e, ownerMap[e.GroupID].UserID, numMap[e.GroupID])
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -91,14 +91,14 @@ func friendNotification(operationID, fromUserID, toUserID string, contentType in
|
||||
Notification(&n)
|
||||
}
|
||||
|
||||
func FriendApplicationNotification(ctx context.Context, req *pbFriend.AddFriendReq) {
|
||||
func FriendApplicationAddNotification(ctx context.Context, req *pbFriend.AddFriendReq) {
|
||||
FriendApplicationTips := open_im_sdk.FriendApplicationTips{FromToUserID: &open_im_sdk.FromToUserID{}}
|
||||
FriendApplicationTips.FromToUserID.FromUserID = req.FromUserID
|
||||
FriendApplicationTips.FromToUserID.ToUserID = req.ToUserID
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.FromUserID, req.ToUserID, constant.FriendApplicationNotification, &FriendApplicationTips)
|
||||
}
|
||||
|
||||
func FriendApplicationApprovedNotification(ctx context.Context, req *pbFriend.RespondFriendApplyReq) {
|
||||
func FriendApplicationAgreedNotification(ctx context.Context, req *pbFriend.RespondFriendApplyReq) {
|
||||
FriendApplicationApprovedTips := open_im_sdk.FriendApplicationApprovedTips{FromToUserID: &open_im_sdk.FromToUserID{}}
|
||||
FriendApplicationApprovedTips.FromToUserID.FromUserID = req.FromUserID
|
||||
FriendApplicationApprovedTips.FromToUserID.ToUserID = req.ToUserID
|
||||
@@ -106,7 +106,7 @@ func FriendApplicationApprovedNotification(ctx context.Context, req *pbFriend.Re
|
||||
friendNotification(tracelog.GetOperationID(ctx), req.ToUserID, req.FromUserID, constant.FriendApplicationApprovedNotification, &FriendApplicationApprovedTips)
|
||||
}
|
||||
|
||||
func FriendApplicationRejectedNotification(ctx context.Context, req *pbFriend.RespondFriendApplyReq) {
|
||||
func FriendApplicationRefusedNotification(ctx context.Context, req *pbFriend.RespondFriendApplyReq) {
|
||||
FriendApplicationApprovedTips := open_im_sdk.FriendApplicationApprovedTips{FromToUserID: &open_im_sdk.FromToUserID{}}
|
||||
FriendApplicationApprovedTips.FromToUserID.FromUserID = req.FromUserID
|
||||
FriendApplicationApprovedTips.FromToUserID.ToUserID = req.ToUserID
|
||||
|
||||
+33
-72
@@ -12,9 +12,9 @@ import (
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/common/tracelog"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
pbFriend "Open_IM/pkg/proto/friend"
|
||||
pbGroup "Open_IM/pkg/proto/group"
|
||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
@@ -167,8 +167,9 @@ func (s *userServer) SyncJoinedGroupMemberNickname(ctx context.Context, userID s
|
||||
}
|
||||
}
|
||||
|
||||
func (s *userServer) GetUsersInfo(ctx context.Context, req *pbUser.GetUsersInfoReq) (*pbUser.GetUsersInfoResp, error) {
|
||||
resp := &pbUser.GetUsersInfoResp{}
|
||||
// ok
|
||||
func (s *userServer) GetDesignateUsers(ctx context.Context, req *pbUser.GetDesignateUsersReq) (resp *pbUser.GetDesignateUsersResp, err error) {
|
||||
resp = &pbUser.GetDesignateUsersResp{}
|
||||
users, err := s.Find(ctx, req.UserIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -228,21 +229,24 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbUser.SetGlobalRecvMessageOptReq) (*pbUser.SetGlobalRecvMessageOptResp, error) {
|
||||
resp := pbUser.SetGlobalRecvMessageOptResp{}
|
||||
func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbUser.SetGlobalRecvMessageOptReq) (resp *pbUser.SetGlobalRecvMessageOptResp, err error) {
|
||||
resp = &pbUser.SetGlobalRecvMessageOptResp{}
|
||||
|
||||
if _, err := s.Find(ctx, []string{req.UserID}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m := make(map[string]interface{}, 1)
|
||||
m["global_recv_msg_opt"] = req.GlobalRecvMsgOpt
|
||||
err := s.UpdateByMap(ctx, req.UserID, m)
|
||||
if err != nil {
|
||||
if err := s.UpdateByMap(ctx, req.UserID, m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chat.UserInfoUpdatedNotification(ctx, req.UserID, req.UserID)
|
||||
return &resp, nil
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *userServer) AccountCheck(ctx context.Context, req *pbUser.AccountCheckReq) (*pbUser.AccountCheckResp, error) {
|
||||
resp := pbUser.AccountCheckResp{}
|
||||
err := token_verify.CheckAdmin(ctx)
|
||||
func (s *userServer) AccountCheck(ctx context.Context, req *pbUser.AccountCheckReq) (resp *pbUser.AccountCheckResp, err error) {
|
||||
resp = &pbUser.AccountCheckResp{}
|
||||
err = token_verify.CheckAdmin(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -250,72 +254,25 @@ func (s *userServer) AccountCheck(ctx context.Context, req *pbUser.AccountCheckR
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
uidList := make([]string, 0)
|
||||
userIDs := make(map[string]interface{}, 0)
|
||||
for _, v := range user {
|
||||
uidList = append(uidList, v.UserID)
|
||||
userIDs[v.UserID] = nil
|
||||
}
|
||||
var r []*pbUser.AccountCheckRespSingleUserStatus
|
||||
for _, v := range req.CheckUserIDs {
|
||||
temp := new(pbUser.AccountCheckRespSingleUserStatus)
|
||||
temp.UserID = v
|
||||
if utils.IsContain(v, uidList) {
|
||||
temp := &pbUser.AccountCheckRespSingleUserStatus{UserID: v}
|
||||
if _, ok := userIDs[v]; ok {
|
||||
temp.AccountStatus = constant.Registered
|
||||
} else {
|
||||
temp.AccountStatus = constant.UnRegistered
|
||||
}
|
||||
r = append(r, temp)
|
||||
resp.Results = append(resp.Results, temp)
|
||||
}
|
||||
return &resp, nil
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *userServer) GetUsers(ctx context.Context, req *pbUser.GetUsersReq) (*pbUser.GetUsersResp, error) {
|
||||
resp := pbUser.GetUsersResp{}
|
||||
var err error
|
||||
if req.UserID != "" {
|
||||
u, err := s.Find(ctx, []string{req.UserID})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Total = 1
|
||||
u1, err := convert.NewDBUser(u[0]).Convert()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Users = append(resp.Users, u1)
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
if req.UserName != "" {
|
||||
usersDB, total, err := s.GetByName(ctx, req.UserName, req.Pagination.ShowNumber, req.Pagination.PageNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Total = int32(total)
|
||||
for _, v := range usersDB {
|
||||
u1, err := convert.NewDBUser(v).Convert()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Users = append(resp.Users, u1)
|
||||
}
|
||||
return &resp, nil
|
||||
} else if req.Content != "" {
|
||||
usersDB, total, err := s.GetByNameAndID(ctx, req.UserName, req.Pagination.ShowNumber, req.Pagination.PageNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Total = int32(total)
|
||||
for _, v := range usersDB {
|
||||
u1, err := convert.NewDBUser(v).Convert()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.Users = append(resp.Users, u1)
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
usersDB, total, err := s.Get(ctx, req.Pagination.ShowNumber, req.Pagination.PageNumber)
|
||||
func (s *userServer) GetPaginationUsers(ctx context.Context, req *pbUser.GetPaginationUsersReq) (resp *pbUser.GetPaginationUsersResp, err error) {
|
||||
resp = &pbUser.GetPaginationUsersResp{}
|
||||
usersDB, total, err := s.Get(ctx, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -329,21 +286,25 @@ func (s *userServer) GetUsers(ctx context.Context, req *pbUser.GetUsersReq) (*pb
|
||||
}
|
||||
resp.Users = append(resp.Users, u)
|
||||
}
|
||||
return &resp, nil
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *userServer) UserRegister(ctx context.Context, req *pbUser.UserRegisterReq) (*pbUser.UserRegisterResp, error) {
|
||||
resp := pbUser.UserRegisterResp{}
|
||||
func (s *userServer) UserRegister(ctx context.Context, req *pbUser.UserRegisterReq) (resp *pbUser.UserRegisterResp, err error) {
|
||||
resp = &pbUser.UserRegisterResp{}
|
||||
if utils.DuplicateAny(req.Users, func(e *server_api_params.UserInfo) string { return e.UserID }) {
|
||||
return nil, constant.ErrArgs.Wrap("userID repeated")
|
||||
}
|
||||
userIDs := make([]string, 0)
|
||||
for _, v := range req.Users {
|
||||
userIDs = append(userIDs, v.UserID)
|
||||
}
|
||||
|
||||
exist, err := s.IsExist(ctx, userIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if exist {
|
||||
return nil, constant.ErrRegisteredAlready.Wrap("exist")
|
||||
return nil, constant.ErrRegisteredAlready.Wrap("userID exist in db")
|
||||
}
|
||||
users, err := (*convert.PBUser)(nil).PB2DB(req.Users)
|
||||
if err != nil {
|
||||
@@ -353,5 +314,5 @@ func (s *userServer) UserRegister(ctx context.Context, req *pbUser.UserRegisterR
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user