pull/255/head
skiffer-git 2 years ago
parent 8ad22f8148
commit 2b2ecad437

@ -47,7 +47,7 @@ func GetJoinedSuperGroupList(c *gin.Context) {
} }
GroupListResp := api.GetJoinedSuperGroupListResp{GetJoinedGroupListResp: api.GetJoinedGroupListResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupList}} GroupListResp := api.GetJoinedSuperGroupListResp{GetJoinedGroupListResp: api.GetJoinedGroupListResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupList}}
GroupListResp.Data = jsonData.JsonDataList(GroupListResp.GroupInfoList) GroupListResp.Data = jsonData.JsonDataList(GroupListResp.GroupInfoList)
log.NewInfo(req.OperationID, "GetJoinedGroupList api return ", GroupListResp) log.NewInfo(req.OperationID, "GetJoinedSuperGroupList api return ", GroupListResp)
c.JSON(http.StatusOK, GroupListResp) c.JSON(http.StatusOK, GroupListResp)
} }

@ -262,7 +262,7 @@ func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJo
groupNode.OwnerUserID = owner.UserID groupNode.OwnerUserID = owner.UserID
resp.GroupList = append(resp.GroupList, &groupNode) resp.GroupList = append(resp.GroupList, &groupNode)
} else { } else {
log.NewError(req.OperationID, "check nil ", num, owner, err, group, err2) log.Debug(req.OperationID, "check nil ", num, owner, err, group, err2)
continue continue
} }
log.NewDebug(req.OperationID, "joinedGroup ", groupNode) log.NewDebug(req.OperationID, "joinedGroup ", groupNode)

@ -10,14 +10,19 @@ import (
commonPb "Open_IM/pkg/proto/sdk_ws" commonPb "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"go.mongodb.org/mongo-driver/mongo"
) )
func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) { func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp := &pbGroup.GetJoinedSuperGroupListResp{CommonResp: &pbGroup.CommonResp{}} resp := &pbGroup.GetJoinedSuperGroupListResp{CommonResp: &pbGroup.CommonResp{}}
userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID) userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID)
if err == mongo.ErrNoDocuments {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed ", err.Error(), req.UserID)
return resp, nil
}
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed", err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed ", err.Error(), req.UserID)
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg
return resp, nil return resp, nil

Loading…
Cancel
Save