From d9ef97f1785fc0a10fae3185eaf9d51f629afc72 Mon Sep 17 00:00:00 2001 From: xhaktmchl Date: Wed, 15 Mar 2023 19:39:45 +0900 Subject: [PATCH] =?UTF-8?q?#9=20fix:=20=EB=B3=B4=EB=93=9C=20=EB=A7=88?= =?UTF-8?q?=EC=9D=B4=ED=81=B4=EB=9F=BD=20=EC=A1=B0=ED=9A=8Capi-opened?= =?UTF-8?q?=EC=9D=98=20=EC=B0=B8=EC=97=AC=20=EB=A9=A4=EB=B2=84=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/board/service/BoardServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/yogit/server/board/service/BoardServiceImpl.java b/server/src/main/java/com/yogit/server/board/service/BoardServiceImpl.java index 9e64938..a373f30 100644 --- a/server/src/main/java/com/yogit/server/board/service/BoardServiceImpl.java +++ b/server/src/main/java/com/yogit/server/board/service/BoardServiceImpl.java @@ -271,11 +271,20 @@ public ApplicationResponse 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 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())) { @@ -288,7 +297,7 @@ else if(dto.getMyClubType().equals(MyClubType.APPLIED_CLUB.toString())) { List 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()))); } } }