pull/236/head
wangchuxiao 3 years ago
parent 10881c8f5b
commit cf094a2048

@ -46,7 +46,7 @@ func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.
func (s *groupServer) GetSuperGroupsInfo(_ context.Context, req *pbGroup.GetSuperGroupsInfoReq) (resp *pbGroup.GetSuperGroupsInfoResp, err error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp = &pbGroup.GetSuperGroupsInfoResp{}
resp = &pbGroup.GetSuperGroupsInfoResp{CommonResp: &pbGroup.CommonResp{}}
groupsInfoList := make([]*commonPb.GroupInfo, 0)
for _, groupID := range req.GroupIDList {
groupInfoFromMysql, err := imdb.GetGroupInfoByGroupID(groupID)

@ -987,7 +987,7 @@ func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string,
}
c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup)
for _, userID := range initMemberIDList {
_, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}, "user_id": userID}, opts)
_, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts)
if err != nil {
session.AbortTransaction(ctx)
return utils.Wrap(err, "transaction failed")
@ -1034,7 +1034,7 @@ func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) err
Upsert: &upsert,
}
for _, userID := range userIDList {
_, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}, "user_id": userID}, opts)
_, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts)
if err != nil {
session.AbortTransaction(ctx)
return utils.Wrap(err, "transaction failed")

Loading…
Cancel
Save