Skip to content

Commit

Permalink
Merge pull request #136 from 9uttery/feat/album-detail-dto-api-#135
Browse files Browse the repository at this point in the history
[Feature] 앨범 상세 조회 DTO 공개 여부 필드 추가
  • Loading branch information
hojeong2747 authored Feb 24, 2024
2 parents 1ccfa81 + fdcf89d commit 8cbf851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

@Schema(description = "앨범 상세 조회 응답")
public record AlbumGetDetailResponse(
@Schema(description = "앨범 공개 여부", example = "true(1)")
Boolean isAlbumOfficial,
@Schema(description = "앨범 썸네일 아이콘 번호", example = "3")
Integer albumIconNum,
@Schema(description = "앨범 썸네일 배경 번호", example = "2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ public AlbumGetDetailResponse getAlbumDetail(Long albumId, UserPrincipal userPri
List<JoyGetInfo> joyInfoList;
if (album.getUser().getUserId().equals(user.getUserId())) { // 내 앨범
joyInfoList = albumQueryDslRepository.getMyAlbumJoys(albumId);
albumGetDetailResponse = new AlbumGetDetailResponse(album.getAlbumInfo().getAlbumIconNum(), album.getAlbumInfo().getAlbumColorNum(), null, album.getName(), null, album.getDescription(), joyInfoList);
albumGetDetailResponse = new AlbumGetDetailResponse(album.getAlbumStatus().getIsOfficial(), album.getAlbumInfo().getAlbumIconNum(), album.getAlbumInfo().getAlbumColorNum(), null, album.getName(), null, album.getDescription(), joyInfoList);
} else { // 남 앨범
joyInfoList = albumQueryDslRepository.getAlbumJoys(albumId, user.getUserId());
Boolean isAlbumSaved = albumQueryDslRepository.getIsAlbumSaved(albumId, user.getUserId());
albumGetDetailResponse = new AlbumGetDetailResponse(album.getAlbumInfo().getAlbumIconNum(), album.getAlbumInfo().getAlbumColorNum(), isAlbumSaved, album.getName(), album.getUser().getUserProfile().getNickname(), album.getDescription(), joyInfoList);
albumGetDetailResponse = new AlbumGetDetailResponse(album.getAlbumStatus().getIsOfficial(), album.getAlbumInfo().getAlbumIconNum(), album.getAlbumInfo().getAlbumColorNum(), isAlbumSaved, album.getName(), album.getUser().getUserProfile().getNickname(), album.getDescription(), joyInfoList);
}

return albumGetDetailResponse;
Expand Down

0 comments on commit 8cbf851

Please sign in to comment.