Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/62 : 즐겨찾기 목록 조회 응답 필드 추가 #66

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,24 @@ public FavoriteResponseDTO.FavoriteList findFavoriteListDTO(final Long memberId)
qPhraseImage.url.coalesce(""),
qPhraseImage.imageRatio.coalesce(""),
qPhrase.viewCount,
qLike.count().intValue()))
qLike.count().intValue(),
JPAExpressions.selectOne()
.from(qLike)
.where(
qLike.phrase
.eq(qPhrase)
.and(qLike.member.id.eq(memberId)))
.exists(),
JPAExpressions.selectOne()
.from(qFavorite)
.where(
qFavorite
.phrase
.eq(qPhrase)
.and(
qFavorite.member.id.eq(
memberId)))
.exists()))
.from(qPhrase)
.leftJoin(qPhrase.phraseImage, qPhraseImage)
.leftJoin(qLike)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public static class FavoriteListItem {
private String imageRatio;
private int viewCount;
private int likeCount;
@Builder.Default private Boolean isLike = false;
@Builder.Default private Boolean isFavorite = false;
}

@Builder
Expand Down
Loading