|
|
|
@ -410,25 +410,13 @@ 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{}
|
|
|
|
|
total, members, err := s.GroupDatabase.PageGetGroupMember(ctx, req.GroupID, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
|
|
|
|
total, members, err := s.PageGetGroupMember(ctx, req.GroupID, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
|
|
|
|
log.ZDebug(ctx, "GetGroupMemberList", "total", total, "members", members, "length", len(members))
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
resp.Total = total
|
|
|
|
|
nameMap, err := s.GetUsernameMap(ctx, utils.Filter(members, func(e *relationTb.GroupMemberModel) (string, bool) {
|
|
|
|
|
return e.UserID, e.Nickname == ""
|
|
|
|
|
}), true)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
log.ZDebug(ctx, "GetGroupMemberList", "nameMap", nameMap)
|
|
|
|
|
resp.Members = utils.Slice(members, func(e *relationTb.GroupMemberModel) *sdkws.GroupMemberFullInfo {
|
|
|
|
|
if e.Nickname == "" {
|
|
|
|
|
e.Nickname = nameMap[e.UserID]
|
|
|
|
|
}
|
|
|
|
|
return convert.Db2PbGroupMember(e)
|
|
|
|
|
})
|
|
|
|
|
resp.Members = utils.Batch(convert.Db2PbGroupMember, members)
|
|
|
|
|
log.ZDebug(ctx, "GetGroupMemberList", "resp", resp, "length", len(resp.Members))
|
|
|
|
|
return resp, nil
|
|
|
|
|
}
|
|
|
|
|