From e0b26623f665e343cdefad3a1786994d2c4f183b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=9C=A4=ED=98=B8?= Date: Sun, 25 Jan 2026 17:49:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=94=84=EB=A1=A0=ED=8A=B8=20=EC=9A=94?= =?UTF-8?q?=EC=B2=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../photoAlbum/dto/PerformerShowListResponseDTO.java | 3 +++ .../backend/photoAlbum/dto/PhotoAlbumResponseDTO.java | 6 +++++- .../photoAlbum/service/PhotoAlbumServiceImpl.java | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/cc/backend/photoAlbum/dto/PerformerShowListResponseDTO.java b/src/main/java/cc/backend/photoAlbum/dto/PerformerShowListResponseDTO.java index c6c64418..83b64830 100644 --- a/src/main/java/cc/backend/photoAlbum/dto/PerformerShowListResponseDTO.java +++ b/src/main/java/cc/backend/photoAlbum/dto/PerformerShowListResponseDTO.java @@ -19,6 +19,9 @@ public class PerformerShowListResponseDTO { @Schema(description = "총 등록된 공연 수", example = "4") private long totalCount; + @Schema(description = "공연진 이름") + private String performerName; + @Schema(description = "공연 카드 목록") private List shows; diff --git a/src/main/java/cc/backend/photoAlbum/dto/PhotoAlbumResponseDTO.java b/src/main/java/cc/backend/photoAlbum/dto/PhotoAlbumResponseDTO.java index 87fcfc9f..edad94d4 100644 --- a/src/main/java/cc/backend/photoAlbum/dto/PhotoAlbumResponseDTO.java +++ b/src/main/java/cc/backend/photoAlbum/dto/PhotoAlbumResponseDTO.java @@ -18,6 +18,7 @@ public class PhotoAlbumResponseDTO { public static class PhotoAlbumResultDTO { private String performerName; private Long photoAlbumId; + private Long amateurShowId; private String amateurShowName; private String schedule; private String detailAddress; @@ -30,8 +31,9 @@ public static class PhotoAlbumResultDTO { @NoArgsConstructor @AllArgsConstructor public static class PhotoAlbumResultWithPresignedUrlDTO { - private String performerName; private Long photoAlbumId; + private String performerName; + private Long amateurShowId; private String amateurShowName; private String schedule; private String detailAddress; @@ -45,6 +47,7 @@ public static class PhotoAlbumResultWithPresignedUrlDTO { @AllArgsConstructor public static class SinglePhotoAlbumDTO { private Long photoAlbumId; + private Long amateurShowId; private String amateurShowName; private String performerName; private String detailAddress; @@ -59,6 +62,7 @@ public static class SinglePhotoAlbumDTO { public static class MemberPhotoAlbumDTO { private Long photoAlbumId; private Long memberId; + private Long amateurShowId; private String performerName; private String amateurShowName; private String imageUrl; diff --git a/src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java b/src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java index 8a22175d..e53ccd97 100644 --- a/src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java +++ b/src/main/java/cc/backend/photoAlbum/service/PhotoAlbumServiceImpl.java @@ -77,6 +77,7 @@ public PhotoAlbumResponseDTO.PhotoAlbumResultWithPresignedUrlDTO createPhotoAlbu String schedule = mergeSchedule(start, end); return PhotoAlbumResponseDTO.PhotoAlbumResultWithPresignedUrlDTO.builder() + .amateurShowId(amateurShow.getId()) .performerName(amateurShow.getPerformerName()) .photoAlbumId(newPhotoAlbum.getId()) .amateurShowName(newPhotoAlbum.getAmateurShow().getName()) @@ -106,6 +107,7 @@ public PhotoAlbumResponseDTO.PhotoAlbumResultWithPresignedUrlDTO getPhotoAlbum(L return PhotoAlbumResponseDTO.PhotoAlbumResultWithPresignedUrlDTO.builder() .photoAlbumId(photoAlbum.getId()) + .amateurShowId(photoAlbum.getAmateurShow().getId()) .amateurShowName(photoAlbum.getAmateurShow().getName()) .performerName(photoAlbum.getAmateurShow().getPerformerName()) .content(photoAlbum.getContent()) @@ -145,6 +147,7 @@ public Slice getPhotoAlbumList(Long m // DTO 변환 List content = albums.stream() .map(album -> PhotoAlbumResponseDTO.SinglePhotoAlbumDTO.builder() + .amateurShowId(album.getAmateurShow().getId()) .photoAlbumId(album.getId()) .amateurShowName(album.getAmateurShow().getName()) .performerName(performer.getName()) @@ -231,6 +234,7 @@ public PhotoAlbumResponseDTO.PhotoAlbumResultDTO updatePhotoAlbum(Long photoAlbu return PhotoAlbumResponseDTO.PhotoAlbumResultDTO.builder() .photoAlbumId(updatedPhotoAlbum.getId()) + .amateurShowId(updatedPhotoAlbum.getAmateurShow().getId()) .amateurShowName(updatedPhotoAlbum.getAmateurShow().getName()) .performerName(updatedPhotoAlbum.getAmateurShow().getPerformerName()) .content(updatedPhotoAlbum.getContent()) @@ -292,6 +296,7 @@ public PhotoAlbumResponseDTO.ScrollMemberPhotoAlbumDTO getAllRecentPhotoAlbumLis .map(album -> PhotoAlbumResponseDTO.MemberPhotoAlbumDTO.builder() .photoAlbumId(album.getId()) .memberId(album.getAmateurShow().getMember().getId()) + .amateurShowId(album.getAmateurShow().getId()) .performerName(album.getAmateurShow().getMember().getName()) .amateurShowName(album.getAmateurShow().getName()) .imageUrl(firstImageMap.get(album.getId())) @@ -315,6 +320,9 @@ public PhotoAlbumResponseDTO.ScrollMemberPhotoAlbumDTO getAllRecentPhotoAlbumLis @Override public PerformerShowListResponseDTO getPerformerShows(Long memberId, Pageable pageable) { + Member performer = memberRepository.findById(memberId) + .orElseThrow(() -> new GeneralException(ErrorStatus.MEMBER_NOT_PERFORMER)); + Slice slice = amateurShowRepository.findByMember_IdOrderByIdDesc(memberId, pageable); //Page 방식 - 이름 수정 필요 long total = amateurShowRepository.countByMember_Id(memberId); // 총 개수 @@ -324,8 +332,10 @@ public PerformerShowListResponseDTO getPerformerShows(Long memberId, Pageable pa return PerformerShowListResponseDTO.builder() .totalCount(total) .shows(showLists) + .performerName(performer.getName()) .build(); } + private Map getFirstImageMapForPhotoAlbums(List albumIds) { if (albumIds == null || albumIds.isEmpty()) { return Collections.emptyMap();