콘텐츠 메인 홈
- 로그인 없이 조회가 가능하도록 수정
This commit is contained in:
@@ -43,7 +43,7 @@ class RankingRepository(
|
||||
}
|
||||
|
||||
fun getAudioContentRanking(
|
||||
memberId: Long,
|
||||
memberId: Long?,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
startDate: LocalDateTime,
|
||||
@@ -110,7 +110,40 @@ class RankingRepository(
|
||||
.innerJoin(audioContentComment.audioContent, audioContent)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
.leftJoin(blockMember).on(blockMemberCondition)
|
||||
}
|
||||
|
||||
"댓글" -> {
|
||||
select
|
||||
.from(audioContentComment)
|
||||
.innerJoin(audioContentComment.audioContent, audioContent)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
}
|
||||
|
||||
"좋아요" -> {
|
||||
select
|
||||
.from(audioContentLike)
|
||||
.innerJoin(audioContentLike.audioContent, audioContent)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
}
|
||||
|
||||
else -> {
|
||||
select
|
||||
.from(order)
|
||||
.innerJoin(order.audioContent, audioContent)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
}
|
||||
}
|
||||
|
||||
if (memberId != null) {
|
||||
select = select.leftJoin(blockMember).on(blockMemberCondition)
|
||||
}
|
||||
|
||||
select = when (sortType) {
|
||||
"후원" -> {
|
||||
select
|
||||
.where(
|
||||
where
|
||||
.and(audioContentComment.isActive.isTrue)
|
||||
@@ -124,11 +157,6 @@ class RankingRepository(
|
||||
|
||||
"댓글" -> {
|
||||
select
|
||||
.from(audioContentComment)
|
||||
.innerJoin(audioContentComment.audioContent, audioContent)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
.leftJoin(blockMember).on(blockMemberCondition)
|
||||
.where(
|
||||
where
|
||||
.and(audioContentComment.isActive.isTrue)
|
||||
@@ -141,11 +169,6 @@ class RankingRepository(
|
||||
|
||||
"좋아요" -> {
|
||||
select
|
||||
.from(audioContentLike)
|
||||
.innerJoin(audioContentLike.audioContent, audioContent)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
.leftJoin(blockMember).on(blockMemberCondition)
|
||||
.where(
|
||||
where
|
||||
.and(audioContentLike.isActive.isTrue)
|
||||
@@ -158,11 +181,6 @@ class RankingRepository(
|
||||
|
||||
else -> {
|
||||
select
|
||||
.from(order)
|
||||
.innerJoin(order.audioContent, audioContent)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
.leftJoin(blockMember).on(blockMemberCondition)
|
||||
.where(
|
||||
where
|
||||
.and(order.isActive.isTrue)
|
||||
@@ -181,7 +199,7 @@ class RankingRepository(
|
||||
}
|
||||
|
||||
fun getSeriesRanking(
|
||||
memberId: Long,
|
||||
memberId: Long?,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
startDate: LocalDateTime,
|
||||
@@ -221,14 +239,19 @@ class RankingRepository(
|
||||
}
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
var select = queryFactory
|
||||
.select(series)
|
||||
.from(seriesContent)
|
||||
.innerJoin(seriesContent.series, series)
|
||||
.innerJoin(seriesContent.content, audioContent)
|
||||
.innerJoin(series.member, member)
|
||||
.leftJoin(order).on(audioContent.id.eq(order.audioContent.id))
|
||||
.leftJoin(blockMember).on(blockMemberCondition)
|
||||
|
||||
if (memberId != null) {
|
||||
select = select.leftJoin(blockMember).on(blockMemberCondition)
|
||||
}
|
||||
|
||||
return select
|
||||
.where(where)
|
||||
.groupBy(series.id)
|
||||
.orderBy(
|
||||
@@ -408,7 +431,7 @@ class RankingRepository(
|
||||
}
|
||||
|
||||
fun fetchCreatorBySellContentCountRankTop20(
|
||||
memberId: Long,
|
||||
memberId: Long?,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
startDate: LocalDateTime,
|
||||
@@ -451,7 +474,7 @@ class RankingRepository(
|
||||
}
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
var select = queryFactory
|
||||
.select(
|
||||
QContentCreatorResponse(
|
||||
member.id,
|
||||
@@ -462,7 +485,12 @@ class RankingRepository(
|
||||
.from(audioContent)
|
||||
.innerJoin(member).on(memberCondition)
|
||||
.leftJoin(order).on(ordersCondition)
|
||||
.leftJoin(blockMember).on(blockMemberCondition)
|
||||
|
||||
if (memberId != null) {
|
||||
select = select.leftJoin(blockMember).on(blockMemberCondition)
|
||||
}
|
||||
|
||||
return select
|
||||
.where(where)
|
||||
.groupBy(member.id)
|
||||
.having(audioContent.id.count().goe(4))
|
||||
|
@@ -23,10 +23,16 @@ class RankingService(
|
||||
@Value("\${cloud.aws.cloud-front.host}")
|
||||
private val imageHost: String
|
||||
) {
|
||||
fun getCreatorRanking(memberId: Long, rankingDate: String): GetExplorerSectionResponse {
|
||||
fun getCreatorRanking(memberId: Long?, rankingDate: String): GetExplorerSectionResponse {
|
||||
val creatorRankings = repository
|
||||
.getCreatorRankings()
|
||||
.filter { !memberService.isBlocked(blockedMemberId = memberId, memberId = it.id!!) }
|
||||
.filter {
|
||||
if (memberId != null) {
|
||||
!memberService.isBlocked(blockedMemberId = memberId, memberId = it.id!!)
|
||||
} else {
|
||||
true
|
||||
}
|
||||
}
|
||||
.map { it.toExplorerSectionCreator(imageHost) }
|
||||
|
||||
return GetExplorerSectionResponse(
|
||||
@@ -39,7 +45,7 @@ class RankingService(
|
||||
}
|
||||
|
||||
fun getContentRanking(
|
||||
memberId: Long,
|
||||
memberId: Long?,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
startDate: LocalDateTime,
|
||||
@@ -71,7 +77,7 @@ class RankingService(
|
||||
}
|
||||
|
||||
fun getSeriesRanking(
|
||||
memberId: Long,
|
||||
memberId: Long?,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
startDate: LocalDateTime,
|
||||
@@ -211,7 +217,7 @@ class RankingService(
|
||||
}
|
||||
|
||||
fun fetchCreatorBySellContentCountRankTop20(
|
||||
memberId: Long,
|
||||
memberId: Long?,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
startDate: LocalDateTime,
|
||||
|
Reference in New Issue
Block a user