From d982cbdafdacc44a8601b3bc9ca88f44591bfd9c Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Fri, 22 Nov 2024 12:29:36 +0900 Subject: [PATCH 1/5] feat: implement get album list by member api --- .../java/kr/mafoo/photo/api/AlbumApi.java | 10 ++-- .../photo/controller/AlbumController.java | 14 ++++-- .../dto/response/AlbumDetailResponse.java | 44 ++++++++++++++++ .../repository/SharedMemberRepository.java | 1 + .../kr/mafoo/photo/service/AlbumQuery.java | 6 +++ .../kr/mafoo/photo/service/AlbumService.java | 33 ++++++++++-- .../photo/service/SharedMemberQuery.java | 5 ++ .../kr/mafoo/photo/service/dto/AlbumDto.java | 50 +++++++++++++++++++ 8 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java create mode 100644 photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java diff --git a/photo-service/src/main/java/kr/mafoo/photo/api/AlbumApi.java b/photo-service/src/main/java/kr/mafoo/photo/api/AlbumApi.java index 239066b..1e9e525 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/api/AlbumApi.java +++ b/photo-service/src/main/java/kr/mafoo/photo/api/AlbumApi.java @@ -7,10 +7,11 @@ import kr.mafoo.photo.annotation.RequestMemberId; import kr.mafoo.photo.annotation.ULID; import kr.mafoo.photo.controller.dto.request.AlbumCreateRequest; -import kr.mafoo.photo.controller.dto.request.AlbumUpdateDisplayIndexRequest; import kr.mafoo.photo.controller.dto.request.AlbumUpdateNameAndTypeRequest; import kr.mafoo.photo.controller.dto.request.AlbumUpdateOwnershipRequest; +import kr.mafoo.photo.controller.dto.response.AlbumDetailResponse; import kr.mafoo.photo.controller.dto.response.AlbumResponse; +import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; @@ -22,9 +23,12 @@ public interface AlbumApi { @Operation(summary = "사용자 별 앨범 목록 조회", description = "사용자 별 앨범 목록을 조회합니다.") @GetMapping - Flux getAlbumListByMember( + Flux getAlbumListByMember( @RequestMemberId - String memberId + String memberId, + + // Authorization Header를 받아올 목적 + ServerHttpRequest serverHttpRequest ); @Operation(summary = "앨범 단건 조회", description = "앨범 단건을 조회합니다.") diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/AlbumController.java b/photo-service/src/main/java/kr/mafoo/photo/controller/AlbumController.java index 0b5f298..d1893e6 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/controller/AlbumController.java +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/AlbumController.java @@ -2,12 +2,13 @@ import kr.mafoo.photo.api.AlbumApi; import kr.mafoo.photo.controller.dto.request.AlbumCreateRequest; -import kr.mafoo.photo.controller.dto.request.AlbumUpdateDisplayIndexRequest; import kr.mafoo.photo.controller.dto.request.AlbumUpdateNameAndTypeRequest; import kr.mafoo.photo.controller.dto.request.AlbumUpdateOwnershipRequest; +import kr.mafoo.photo.controller.dto.response.AlbumDetailResponse; import kr.mafoo.photo.controller.dto.response.AlbumResponse; import kr.mafoo.photo.service.AlbumService; import lombok.RequiredArgsConstructor; +import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -19,12 +20,15 @@ public class AlbumController implements AlbumApi { private final AlbumService albumService; @Override - public Flux getAlbumListByMember( - String memberId + public Flux getAlbumListByMember( + String memberId, + ServerHttpRequest serverHttpRequest ) { + String authorizationToken = serverHttpRequest.getHeaders().getFirst("Authorization"); + return albumService - .findAlbumListByMemberId(memberId) - .map(AlbumResponse::fromEntity); + .findAlbumListByMemberId(memberId, authorizationToken) + .map(AlbumDetailResponse::fromDto); } @Override diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java new file mode 100644 index 0000000..0ae5be5 --- /dev/null +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java @@ -0,0 +1,44 @@ +package kr.mafoo.photo.controller.dto.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import kr.mafoo.photo.domain.enums.AlbumType; +import kr.mafoo.photo.domain.enums.ShareStatus; +import kr.mafoo.photo.service.dto.AlbumDto; + +@Schema(description = "앨범 응답") +public record AlbumDetailResponse( + @Schema(description = "앨범 ID", example = "test_album_id") + String albumId, + + @Schema(description = "앨범 이름", example = "야뿌들") + String name, + + @Schema(description = "앨범 종류", example = "HEART") + AlbumType type, + + @Schema(description = "앨범 내 사진 수", example = "6") + String photoCount, + + @Schema(description = "공유 받은 앨범 여부", example = "false") + Boolean isShared, + + @Schema(description = "공유 받은 앨범 권한", example = "null") + ShareStatus shareStatus, + + @Schema(description = "공유 받은 앨범 소유자 프로필 사진", example = "null") + String ownerProfileImgUrl +) { + public static AlbumDetailResponse fromDto( + AlbumDto dto + ) { + return new AlbumDetailResponse( + dto.albumId(), + dto.name(), + dto.type(), + dto.photoCount().toString(), + dto.isShared(), + dto.shareStatus(), + dto.ownerProfileImgUrl() + ); + } +} diff --git a/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java b/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java index 70b8277..6e93338 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java +++ b/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java @@ -9,5 +9,6 @@ @Repository public interface SharedMemberRepository extends R2dbcRepository { Flux findAllByAlbumId(String albumId); + Flux findAllByMemberId(String memberId); Mono findByAlbumIdAndMemberId(String albumId, String memberId); } \ No newline at end of file diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumQuery.java b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumQuery.java index f2b4ac8..2f272a3 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumQuery.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumQuery.java @@ -5,6 +5,7 @@ import kr.mafoo.photo.repository.AlbumRepository; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @Service @@ -17,4 +18,9 @@ public Mono findById(String albumId) { return albumRepository.findById(albumId) .switchIfEmpty(Mono.error(new AlbumNotFoundException())); } + + public Flux findByMemberId(String memberId) { + return albumRepository.findAllByOwnerMemberIdOrderByDisplayIndex(memberId) + .switchIfEmpty(Mono.error(new AlbumNotFoundException())); + } } diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java index e67ae67..29de78a 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java @@ -3,7 +3,11 @@ import static kr.mafoo.photo.domain.enums.PermissionLevel.FULL_ACCESS; import static kr.mafoo.photo.domain.enums.PermissionLevel.VIEW_ACCESS; +import java.util.Comparator; import kr.mafoo.photo.domain.AlbumEntity; +import kr.mafoo.photo.exception.AlbumNotFoundException; +import kr.mafoo.photo.exception.SharedMemberNotFoundException; +import kr.mafoo.photo.service.dto.AlbumDto; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -19,15 +23,36 @@ public class AlbumService { private final AlbumPermissionVerifier albumPermissionVerifier; + private final SharedMemberQuery sharedMemberQuery; + private final MemberService memberService; + @Transactional(readOnly = true) - public Flux findAlbumListByMemberId(String memberId) { - return null; + public Flux findAlbumListByMemberId(String memberId, String token) { + return Flux.merge( + findOwnedAlbumListByMemberId(memberId), + findSharedAlbumListByMemberId(memberId, token) + ).sort(Comparator.comparing(AlbumDto::createdAt).reversed()); + } + + private Flux findOwnedAlbumListByMemberId(String memberId) { + return albumQuery.findByMemberId(memberId) + .onErrorResume(AlbumNotFoundException.class, ex -> Mono.empty()) + .map(AlbumDto::fromOwnedAlbum); + } + + private Flux findSharedAlbumListByMemberId(String memberId, String token) { + return sharedMemberQuery.findAllByMemberId(memberId) + .onErrorResume(SharedMemberNotFoundException.class, ex -> Mono.empty()) + .concatMap(sharedMember -> albumQuery.findById(sharedMember.getAlbumId()) + .flatMap(album -> memberService.getMemberInfoById(album.getOwnerMemberId(), token) + .flatMap(member -> Mono.just(AlbumDto.fromSharedAlbum(album, sharedMember, member))) + ) + ); } @Transactional(readOnly = true) public Mono findAlbumById(String albumId, String memberId) { - return albumPermissionVerifier.verifyOwnershipOrAccessPermission(albumId, memberId, VIEW_ACCESS) - .then(albumQuery.findById(albumId)); + return albumPermissionVerifier.verifyOwnershipOrAccessPermission(albumId, memberId, VIEW_ACCESS); } @Transactional diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java b/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java index 4e9e610..483d695 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java @@ -20,6 +20,11 @@ public Flux findAllByAlbumId(String albumId) { .switchIfEmpty(Mono.error(new SharedMemberNotFoundException())); } + public Flux findAllByMemberId(String memberId) { + return sharedMemberRepository.findAllByMemberId(memberId) + .switchIfEmpty(Mono.error(new SharedMemberNotFoundException())); + } + public Mono findBySharedMemberId(String sharedMemberId) { return sharedMemberRepository.findById(sharedMemberId) .switchIfEmpty(Mono.error(new SharedMemberNotFoundException())); diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java new file mode 100644 index 0000000..dddbf84 --- /dev/null +++ b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java @@ -0,0 +1,50 @@ +package kr.mafoo.photo.service.dto; + +import java.time.LocalDateTime; +import kr.mafoo.photo.domain.AlbumEntity; +import kr.mafoo.photo.domain.SharedMemberEntity; +import kr.mafoo.photo.domain.enums.AlbumType; +import kr.mafoo.photo.domain.enums.ShareStatus; + +public record AlbumDto( + String albumId, + String name, + AlbumType type, + Integer photoCount, + Boolean isShared, + ShareStatus shareStatus, + String ownerProfileImgUrl, + LocalDateTime createdAt +) { + public static AlbumDto fromOwnedAlbum( + AlbumEntity albumEntity + ) { + return new AlbumDto( + albumEntity.getAlbumId(), + albumEntity.getName(), + albumEntity.getType(), + albumEntity.getPhotoCount(), + false, + null, + null, + albumEntity.getCreatedAt() + ); + } + + public static AlbumDto fromSharedAlbum( + AlbumEntity albumEntity, + SharedMemberEntity sharedMemberEntity, + MemberDto memberDto + ) { + return new AlbumDto( + albumEntity.getAlbumId(), + albumEntity.getName(), + albumEntity.getType(), + albumEntity.getPhotoCount(), + true, + sharedMemberEntity.getShareStatus(), + memberDto.profileImageUrl(), + sharedMemberEntity.getCreatedAt() + ); + } +} From 62044d44fd488afe6385ee14b999cb6de01fea3a Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Fri, 22 Nov 2024 13:11:52 +0900 Subject: [PATCH 2/5] fix: change findAllByMemberId as findAllByMemberIdWhereStatusNotRejected --- .../kr/mafoo/photo/repository/SharedMemberRepository.java | 3 ++- .../src/main/java/kr/mafoo/photo/service/AlbumService.java | 2 +- .../main/java/kr/mafoo/photo/service/SharedMemberQuery.java | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java b/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java index 6e93338..c3eb502 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java +++ b/photo-service/src/main/java/kr/mafoo/photo/repository/SharedMemberRepository.java @@ -1,6 +1,7 @@ package kr.mafoo.photo.repository; import kr.mafoo.photo.domain.SharedMemberEntity; +import kr.mafoo.photo.domain.enums.ShareStatus; import org.springframework.data.r2dbc.repository.R2dbcRepository; import org.springframework.stereotype.Repository; import reactor.core.publisher.Flux; @@ -9,6 +10,6 @@ @Repository public interface SharedMemberRepository extends R2dbcRepository { Flux findAllByAlbumId(String albumId); - Flux findAllByMemberId(String memberId); + Flux findAllByMemberIdAndShareStatusNot(String memberId, ShareStatus status); Mono findByAlbumIdAndMemberId(String albumId, String memberId); } \ No newline at end of file diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java index 29de78a..12f660f 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumService.java @@ -41,7 +41,7 @@ private Flux findOwnedAlbumListByMemberId(String memberId) { } private Flux findSharedAlbumListByMemberId(String memberId, String token) { - return sharedMemberQuery.findAllByMemberId(memberId) + return sharedMemberQuery.findAllByMemberIdWhereStatusNotRejected(memberId) .onErrorResume(SharedMemberNotFoundException.class, ex -> Mono.empty()) .concatMap(sharedMember -> albumQuery.findById(sharedMember.getAlbumId()) .flatMap(album -> memberService.getMemberInfoById(album.getOwnerMemberId(), token) diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java b/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java index 483d695..9c9d8ea 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/SharedMemberQuery.java @@ -1,5 +1,7 @@ package kr.mafoo.photo.service; +import static kr.mafoo.photo.domain.enums.ShareStatus.REJECTED; + import kr.mafoo.photo.domain.SharedMemberEntity; import kr.mafoo.photo.exception.SharedMemberDuplicatedException; import kr.mafoo.photo.exception.SharedMemberNotFoundException; @@ -20,8 +22,8 @@ public Flux findAllByAlbumId(String albumId) { .switchIfEmpty(Mono.error(new SharedMemberNotFoundException())); } - public Flux findAllByMemberId(String memberId) { - return sharedMemberRepository.findAllByMemberId(memberId) + public Flux findAllByMemberIdWhereStatusNotRejected(String memberId) { + return sharedMemberRepository.findAllByMemberIdAndShareStatusNot(memberId, REJECTED) .switchIfEmpty(Mono.error(new SharedMemberNotFoundException())); } From c8e8bc9a1d8d4bc91256b5456c07e0471aa1ef49 Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Fri, 22 Nov 2024 17:41:19 +0900 Subject: [PATCH 3/5] fix: add permission level field in AlbumDetailResponse --- .../photo/controller/dto/response/AlbumDetailResponse.java | 7 ++++++- .../kr/mafoo/photo/service/AlbumPermissionVerifier.java | 2 +- .../src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java index 0ae5be5..a27bdd7 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java @@ -2,6 +2,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import kr.mafoo.photo.domain.enums.AlbumType; +import kr.mafoo.photo.domain.enums.PermissionLevel; import kr.mafoo.photo.domain.enums.ShareStatus; import kr.mafoo.photo.service.dto.AlbumDto; @@ -22,9 +23,12 @@ public record AlbumDetailResponse( @Schema(description = "공유 받은 앨범 여부", example = "false") Boolean isShared, - @Schema(description = "공유 받은 앨범 권한", example = "null") + @Schema(description = "공유 받은 앨범 상태", example = "null") ShareStatus shareStatus, + @Schema(description = "공유 받은 앨범 권한", example = "null") + PermissionLevel permissionLevel, + @Schema(description = "공유 받은 앨범 소유자 프로필 사진", example = "null") String ownerProfileImgUrl ) { @@ -38,6 +42,7 @@ public static AlbumDetailResponse fromDto( dto.photoCount().toString(), dto.isShared(), dto.shareStatus(), + dto.permissionLevel(), dto.ownerProfileImgUrl() ); } diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumPermissionVerifier.java b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumPermissionVerifier.java index 5491061..c907870 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/AlbumPermissionVerifier.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/AlbumPermissionVerifier.java @@ -30,7 +30,7 @@ public Mono verifyOwnershipOrAccessPermission(String albumId, Strin .flatMap(sharedAlbumMember -> checkShareStatus(sharedAlbumMember.getShareStatus()) .then(checkAccessPermission(sharedAlbumMember.getPermissionLevel(), permissionLevel)) - ).then(albumQuery.findById(albumId)) // FIXME : findById 중복 실행 제거 필요 + ).then(albumQuery.findById(albumId)) ); } diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java index dddbf84..7a5c3ec 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java @@ -4,6 +4,7 @@ import kr.mafoo.photo.domain.AlbumEntity; import kr.mafoo.photo.domain.SharedMemberEntity; import kr.mafoo.photo.domain.enums.AlbumType; +import kr.mafoo.photo.domain.enums.PermissionLevel; import kr.mafoo.photo.domain.enums.ShareStatus; public record AlbumDto( @@ -13,6 +14,7 @@ public record AlbumDto( Integer photoCount, Boolean isShared, ShareStatus shareStatus, + PermissionLevel permissionLevel, String ownerProfileImgUrl, LocalDateTime createdAt ) { @@ -27,6 +29,7 @@ public static AlbumDto fromOwnedAlbum( false, null, null, + null, albumEntity.getCreatedAt() ); } @@ -43,6 +46,7 @@ public static AlbumDto fromSharedAlbum( albumEntity.getPhotoCount(), true, sharedMemberEntity.getShareStatus(), + sharedMemberEntity.getPermissionLevel(), memberDto.profileImageUrl(), sharedMemberEntity.getCreatedAt() ); From b1f6614323e309de461bdb8d286cd01bc2ac472a Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Fri, 22 Nov 2024 17:49:18 +0900 Subject: [PATCH 4/5] fix: fix img -> image for name unity --- .../photo/controller/dto/response/AlbumDetailResponse.java | 6 +++--- .../src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java index a27bdd7..ead708b 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java @@ -29,8 +29,8 @@ public record AlbumDetailResponse( @Schema(description = "공유 받은 앨범 권한", example = "null") PermissionLevel permissionLevel, - @Schema(description = "공유 받은 앨범 소유자 프로필 사진", example = "null") - String ownerProfileImgUrl + @Schema(description = "공유 받은 앨범 소유자 프로필 사진 URL", example = "null") + String ownerProfileImageUrl ) { public static AlbumDetailResponse fromDto( AlbumDto dto @@ -43,7 +43,7 @@ public static AlbumDetailResponse fromDto( dto.isShared(), dto.shareStatus(), dto.permissionLevel(), - dto.ownerProfileImgUrl() + dto.ownerProfileImageUrl() ); } } diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java index 7a5c3ec..eb2cf15 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java @@ -15,7 +15,7 @@ public record AlbumDto( Boolean isShared, ShareStatus shareStatus, PermissionLevel permissionLevel, - String ownerProfileImgUrl, + String ownerProfileImageUrl, LocalDateTime createdAt ) { public static AlbumDto fromOwnedAlbum( From 50682db201d43480b4f0c88e797a9f2e0a1c8566 Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Fri, 22 Nov 2024 21:57:21 +0900 Subject: [PATCH 5/5] fix: delete useless field --- .../photo/controller/dto/response/AlbumDetailResponse.java | 4 ---- .../src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java | 3 --- 2 files changed, 7 deletions(-) diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java index ead708b..c835318 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/AlbumDetailResponse.java @@ -20,9 +20,6 @@ public record AlbumDetailResponse( @Schema(description = "앨범 내 사진 수", example = "6") String photoCount, - @Schema(description = "공유 받은 앨범 여부", example = "false") - Boolean isShared, - @Schema(description = "공유 받은 앨범 상태", example = "null") ShareStatus shareStatus, @@ -40,7 +37,6 @@ public static AlbumDetailResponse fromDto( dto.name(), dto.type(), dto.photoCount().toString(), - dto.isShared(), dto.shareStatus(), dto.permissionLevel(), dto.ownerProfileImageUrl() diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java index eb2cf15..6f77a42 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/dto/AlbumDto.java @@ -12,7 +12,6 @@ public record AlbumDto( String name, AlbumType type, Integer photoCount, - Boolean isShared, ShareStatus shareStatus, PermissionLevel permissionLevel, String ownerProfileImageUrl, @@ -26,7 +25,6 @@ public static AlbumDto fromOwnedAlbum( albumEntity.getName(), albumEntity.getType(), albumEntity.getPhotoCount(), - false, null, null, null, @@ -44,7 +42,6 @@ public static AlbumDto fromSharedAlbum( albumEntity.getName(), albumEntity.getType(), albumEntity.getPhotoCount(), - true, sharedMemberEntity.getShareStatus(), sharedMemberEntity.getPermissionLevel(), memberDto.profileImageUrl(),