feat(recommendation): 인기 커뮤니티 좋아요 조회를 추가한다

This commit is contained in:
2026-06-30 01:08:06 +09:00
parent aaac81417d
commit 6c2c8a0386
3 changed files with 22 additions and 2 deletions

View File

@@ -792,7 +792,8 @@ class DefaultHomeRecommendationQueryRepository(
creatorCommunity.createdAt,
creatorCommunityLike.id.countDistinct(),
creatorCommunityComment.id.countDistinct(),
orderedCommunityPostCondition(memberId)
orderedCommunityPostCondition(memberId),
likedCommunityPostCondition(memberId)
)
)
.from(creatorCommunity)
@@ -1229,6 +1230,19 @@ class DefaultHomeRecommendationQueryRepository(
.exists()
}
private fun likedCommunityPostCondition(memberId: Long?): BooleanExpression {
if (memberId == null) return Expressions.FALSE
return JPAExpressions
.selectOne()
.from(creatorCommunityLike)
.where(
creatorCommunityLike.creatorCommunity.id.eq(creatorCommunity.id),
creatorCommunityLike.member.id.eq(memberId),
creatorCommunityLike.isActive.isTrue
)
.exists()
}
private fun notBlockedCreatorSql(creatorIdExpression: String): String {
return """
not exists (

View File

@@ -152,7 +152,8 @@ data class HomePopularCommunityRecommendationRecord(
val createdAt: LocalDateTime,
val likeCount: Long,
val commentCount: Long,
val existOrdered: Boolean
val existOrdered: Boolean,
val isLiked: Boolean
)
data class HomeGenreCreatorRecommendationGroup(