From fbfd7fe702a507228f142db3f1d6f1721921dd0b Mon Sep 17 00:00:00 2001 From: Seoyoung2222 Date: Wed, 27 Nov 2024 17:30:32 +0900 Subject: [PATCH] =?UTF-8?q?BE:=20[feat]=20=ED=81=AC=EB=A3=A8=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=A1=B0=ED=9A=8C=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?#83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crew/post/notice/dto/CrewMainNoticeResponseDto.java | 4 +++- .../crew/post/notice/service/NoticePostQueryService.java | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/dto/CrewMainNoticeResponseDto.java b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/dto/CrewMainNoticeResponseDto.java index 0ad6bb6..d781955 100644 --- a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/dto/CrewMainNoticeResponseDto.java +++ b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/dto/CrewMainNoticeResponseDto.java @@ -9,13 +9,15 @@ @Builder public class CrewMainNoticeResponseDto { private String crewTitle; + private String crewProfileImage; private int postCount; private int memberCount; private List noticePost; - public static CrewMainNoticeResponseDto of(String crewTitle, int postCount, int memberCount, List noticePost) { + public static CrewMainNoticeResponseDto of(String crewTitle,String crewProfileImage, int postCount, int memberCount, List noticePost) { return CrewMainNoticeResponseDto.builder() .crewTitle(crewTitle) + .crewProfileImage(crewProfileImage) .postCount(postCount) .memberCount(memberCount) .noticePost(noticePost) diff --git a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/service/NoticePostQueryService.java b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/service/NoticePostQueryService.java index b6ae941..db5ac8e 100644 --- a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/service/NoticePostQueryService.java +++ b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/notice/service/NoticePostQueryService.java @@ -39,8 +39,12 @@ public CrewMainNoticeResponseDto getNoticePostsByCrew(Long crewId) { .map(NoticePostSimpleResponseDto::fromEntity) .collect(Collectors.toList()); + // 크루 프로필 이미지 URL 가져오기 + String crewProfileImage = crew.getImages() != null ? crew.getImages().getImageUrl() : null; + return CrewMainNoticeResponseDto.of( crew.getTitle(), + crewProfileImage, noticePosts.size(), crew.getCrewUsers().size(), noticePostSimpleResponseDtos