Skip to content

Commit

Permalink
Merge branch 'main' into feat/user-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhn committed Jan 5, 2023
2 parents d3010c6 + df8eee0 commit a5f4ec6
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,23 @@ public ApplicationResponse<List<GetAllBoardRes>> findMyClubBoards(GetMyClubBoard
boards = boardRepository.findMyClubBoardsByUserId(pageRequest, dto.getUserId());

// 보드 res에 이미지uuid -> aws s3 url로 변환
res = boards.stream()
.map(board -> GetAllBoardRes.toDto(board, awsS3Service.makeUrlOfFilename(board.getBoardImagesUUids().get(0)), awsS3Service.makeUrlOfFilename(user.getProfileImg())))
.collect(Collectors.toList());
if(boards != null){
res = boards.stream()
.map(board -> GetAllBoardRes.toDto(board, awsS3Service.makeUrlOfFilename(board.getBoardImagesUUids().get(0)), awsS3Service.makeUrlOfFilename(user.getProfileImg())))
.collect(Collectors.toList());
}
}
else if(dto.getMyClubType().equals(MyClubType.APPLIED_CLUB.toString())){
boardUsers = boardUserRepository.findByUserId(dto.getUserId());
// System.out.println("보드 유저는?: "+ boardUsers);

// 보드 res에 이미지uuid -> aws s3 url로 변환
res = boardUsers.stream()
.filter(boardUser -> !boardUser.getBoard().getHost().getId().equals(dto.getUserId())) // 조건1: 호스트가 아닌 것
.map(boardUser -> GetAllBoardRes.toDto(boardUser.getBoard(), awsS3Service.makeUrlOfFilename(boardUser.getBoard().getBoardImagesUUids().get(0)), awsS3Service.makeUrlOfFilename(user.getProfileImg())))
.collect(Collectors.toList());
if(boardUsers!= null && !boardUsers.isEmpty()){
res = boardUsers.stream()
.filter(boardUser -> !boardUser.getBoard().getHost().getId().equals(dto.getUserId())) // 조건1: 호스트가 아닌 것
.map(boardUser -> GetAllBoardRes.toDto(boardUser.getBoard(), awsS3Service.makeUrlOfFilename(boardUser.getBoard().getBoardImagesUUids().get(0)), awsS3Service.makeUrlOfFilename(user.getProfileImg())))
.collect(Collectors.toList());
}
}
else{ throw new InvalidMyClubTypeException();}

Expand Down

0 comments on commit a5f4ec6

Please sign in to comment.