Skip to content

Commit

Permalink
group member
Browse files Browse the repository at this point in the history
  • Loading branch information
withchao committed May 11, 2024
1 parent c7b8f78 commit 7ac1fe7
Show file tree
Hide file tree
Showing 10 changed files with 924 additions and 669 deletions.
10 changes: 10 additions & 0 deletions constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,13 @@ const (
SubscriberUser = 1
Unsubscribe = 2
)

const (
GroupSearchPositionHead = 1
GroupSearchPositionAny = 2
)

const (
FirstPageNumber = 1
MaxSyncPullNumber = 500
)
497 changes: 339 additions & 158 deletions friend/friend.pb.go

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions friend/friend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ message getSpecifiedFriendsInfoResp {
repeated getSpecifiedFriendsInfoInfo infos = 1;
}

message getFriendHashReq {
string userID = 1;
}

message getFriendHashResp {
int64 total = 1;
uint64 hash = 2;
}

service friend{
//申请加好友
rpc applyToAddFriend(applyToAddFriendReq) returns(applyToAddFriendResp);
Expand Down Expand Up @@ -227,4 +236,6 @@ service friend{
rpc getFriendIDs(getFriendIDsReq) returns (getFriendIDsResp);
// 获取指定好友信息
rpc GetSpecifiedFriendsInfo(getSpecifiedFriendsInfoReq) returns (getSpecifiedFriendsInfoResp);
// 获取好友列表hash
rpc getFriendHash(getFriendHashReq) returns (getFriendHashResp);
}
123 changes: 0 additions & 123 deletions google/wrappers.proto

This file was deleted.

24 changes: 23 additions & 1 deletion group/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@

package group

import "errors"
import (
"errors"
"github.com/openimsdk/protocol/constant"
)

func (x *CreateGroupReq) Check() error {
if x.MemberUserIDs == nil && x.AdminUserIDs == nil {
Expand Down Expand Up @@ -354,3 +357,22 @@ func (x *GroupCreateCountReq) Check() error {
}
return nil
}

func (x *SearchGroupMemberReq) Check() error {
if x.GroupID == "" {
return errors.New("groupID is empty")
}
if x.Keyword == "" {
return errors.New("keyword is empty")
}
switch x.Position {
case constant.GroupSearchPositionHead:
case constant.GroupSearchPositionAny:
default:
return errors.New("position is invalid")
}
if err := x.Pagination.Check(); err != nil {
return err
}
return nil
}
Loading

0 comments on commit 7ac1fe7

Please sign in to comment.