Skip to content

Commit

Permalink
Merge pull request #148 from YogitTeam/feat/report
Browse files Browse the repository at this point in the history
Feat/report
  • Loading branch information
xhaktmchl authored Mar 15, 2023
2 parents 69cad2d + fcbe262 commit cf5c963
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,22 @@ public ApplicationResponse<GetAllBoardsByCategoryRes> findAllBoardsByCategory(Ge

Page<Board> boards = boardRepository.findAllBoardsByCategory(pageRequest, dto.getCategoryId());
// 보드 res에 이미지uuid -> aws s3 url로 변환
List<GetAllBoardRes> boardsRes = boards.stream()
/*List<GetAllBoardRes> boardsRes = boards.stream()
.filter(board -> !blockedUsers.contains(board.getHost())) // 차단당한 유저의 데이터 제외
.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());
.collect(Collectors.toList());*/

// 보드 res에 이미지uuid -> aws s3 url로 변환
//TODO: 동작 잘 되는지 확인
List<GetAllBoardRes> boardsRes = new ArrayList<>();
for(Board b:boards){
if(!blockedUsers.contains(b.getHost())){
// 보드 현재 인원
List<BoardUser> participantsOrigin = boardUserRepository.findAllByBoardId(b.getId());
b.changeBoardCurrentMember(participantsOrigin.size());
boardsRes.add(GetAllBoardRes.toDto(b, awsS3Service.makeUrlOfFilename(b.getBoardImagesUUids().get(0)), b.getBoardUsers().stream().map(boardUser -> awsS3Service.makeUrlOfFilename(boardUser.getUser().getProfileImg())).collect(Collectors.toList())));
}
}

return ApplicationResponse.ok(GetAllBoardsByCategoryRes.toDto(boardsRes, boards.getTotalPages()));
}
Expand Down

0 comments on commit cf5c963

Please sign in to comment.