superGroup

This commit is contained in:
wangchuxiao
2022-05-30 16:23:15 +08:00
parent edb5cb4ee5
commit 653c0faa18
7 changed files with 425 additions and 212 deletions
+10 -2
View File
@@ -1,9 +1,17 @@
package base_info
type GetJoinedSuperGroupReq struct {
type GetJoinedSuperGroupListReq struct {
GetJoinedGroupListReq
}
type GetJoinedSuperGroupResp struct {
type GetJoinedSuperGroupListResp struct {
GetJoinedGroupListResp
}
type GetSuperGroupsInfoReq struct {
GetGroupInfoReq
}
type GetSuperGroupsInfoResp struct {
GetGroupInfoResp
}
+5 -1
View File
@@ -1026,7 +1026,11 @@ func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) err
UserID: v,
})
}
_, err = c.UpdateMany(sCtx, users, bson.M{"$addToSet": bson.M{"group_id_list": groupID}})
upsert := true
opts := &options.UpdateOptions{
Upsert: &upsert,
}
_, err = c.UpdateMany(sCtx, bson.M{"user_id": bson.M{"$in": userIDList}}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts)
if err != nil {
session.AbortTransaction(ctx)
return utils.Wrap(err, "transaction failed")
File diff suppressed because it is too large Load Diff
+11
View File
@@ -401,6 +401,16 @@ message GetJoinedSuperGroupListResp {
repeated server_api_params.GroupInfo GroupList = 3;
}
message GetSuperGroupsInfoReq {
repeated string GroupIDList = 1;
string OperationID = 2;
string OpUserID = 3; //No verification permission
}
message GetSuperGroupsInfoResp {
CommonResp commonResp = 1;
repeated server_api_params.GroupInfo GroupInfoList = 3;
}
service group{
rpc createGroup(CreateGroupReq) returns(CreateGroupResp);
@@ -438,6 +448,7 @@ service group{
rpc SetGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp);
rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
}