Skip to content

Commit

Permalink
Merge pull request #154 from YogitTeam/feat/report
Browse files Browse the repository at this point in the history
#9 fix: 보드 마이클럽 조회api-opened의 참여 멤버 프로필 이미지 에러 해결
  • Loading branch information
xhaktmchl authored Mar 15, 2023
2 parents b403d83 + d9ef97f commit 48795db
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,20 @@ public ApplicationResponse<GetAllBoardsByCategoryRes> findMyClubBoards(GetMyClub
if(dto.getMyClubType().equals(MyClubType.OPENED_CLUB.toString())){
boards = boardRepository.findMyClubBoardsByUserId(pageRequest, dto.getUserId());


// 보드 res에 이미지uuid -> aws s3 url로 변환
if(boards != null){
/*if(boards != null){
res = boards.stream()
.map(board -> GetAllBoardRes.toDto(board, awsS3Service.makeUrlOfFilename(board.getBoardImagesUUids().get(0)), board.getBoardUsers().stream().map(boardUser -> awsS3Service.makeUrlOfFilename(boardUser.getUser().getProfileImg())).collect(Collectors.toList())))
.collect(Collectors.toList());
}*/

if(boards != null && !boards.isEmpty()){
for(Board b: boards){
List<BoardUser> participantsOrigin = boardUserRepository.findAllByBoardId(b.getId());// 보드 현재 인원 반영
b.changeBoardCurrentMember(participantsOrigin.size());
res.add(GetAllBoardRes.toDto(b, awsS3Service.makeUrlOfFilename(b.getBoardImagesUUids().get(0)), b.getBoardUsers().stream().filter(boardUser -> boardUser.getStatus().equals(BaseStatus.ACTIVE)).map(boardUser -> awsS3Service.makeUrlOfFilename(boardUser.getUser().getProfileImg())).collect(Collectors.toList())));
}
}
}
else if(dto.getMyClubType().equals(MyClubType.APPLIED_CLUB.toString())) {
Expand All @@ -288,7 +297,7 @@ else if(dto.getMyClubType().equals(MyClubType.APPLIED_CLUB.toString())) {

List<BoardUser> participantsOrigin = boardUserRepository.findAllByBoardId(bu.getBoard().getId());// 보드 현재 인원 반영
bu.getBoard().changeBoardCurrentMember(participantsOrigin.size());
res.add(GetAllBoardRes.toDto(bu.getBoard(), awsS3Service.makeUrlOfFilename(bu.getBoard().getBoardImagesUUids().get(0)), bu.getBoard().getBoardUsers().stream().map(boardUser -> awsS3Service.makeUrlOfFilename(boardUser.getUser().getProfileImg())).collect(Collectors.toList())));
res.add(GetAllBoardRes.toDto(bu.getBoard(), awsS3Service.makeUrlOfFilename(bu.getBoard().getBoardImagesUUids().get(0)), bu.getBoard().getBoardUsers().stream().filter(boardUser -> boardUser.getStatus().equals(BaseStatus.ACTIVE)).map(boardUser -> awsS3Service.makeUrlOfFilename(boardUser.getUser().getProfileImg())).collect(Collectors.toList())));
}
}
}
Expand Down

0 comments on commit 48795db

Please sign in to comment.