fix: fix cannot get user from empty club
All checks were successful
ci / build (17, ubuntu-22.04) (push) Successful in 1m8s
All checks were successful
ci / build (17, ubuntu-22.04) (push) Successful in 1m8s
This commit is contained in:
parent
369f11479e
commit
4e13c44fc8
@ -87,8 +87,10 @@ public class ClubServices {
|
||||
if (clubDao.selectCountByCondition(CLUB_VO.ID.eq(clubId)) == 0)
|
||||
return Result.failed(HttpStatus.NOT_FOUND, "社团不存在!");
|
||||
Page<ClubUserAuthVo> paginate = clubUserAuthDao.paginate(page, num, select(CLUB_USER_AUTH_VO.ALL_COLUMNS).where(CLUB_USER_AUTH_VO.CLUB_ID.eq(clubId)).orderBy(CLUB_USER_AUTH_VO.AUTH_ID.asc(), CLUB_USER_AUTH_VO.USER_ID.asc()));
|
||||
long totalRow = paginate.getTotalRow();
|
||||
if (totalRow == 0) return Result.success(new PagerData<>(0, List.of()));
|
||||
List<UserVo> userVos = userDao.selectListWithRelationsByQuery(select(USER_VO.ALL_COLUMNS).from(USER_VO).where(USER_VO.ID.in(paginate.getRecords().stream().map(ClubUserAuthVo::getUserId).toList())));
|
||||
return Result.success(new PagerData<>(paginate.getTotalRow(), userVos.stream().map(e -> voUtils.vo2DtoSafe(e, User.class)).toList()));
|
||||
return Result.success(new PagerData<>(totalRow, userVos.stream().map(e -> voUtils.vo2DtoSafe(e, User.class)).toList()));
|
||||
}
|
||||
|
||||
public Result<Boolean> clubRemoveUser(User user, long clubId, long userId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user