콘텐츠 메인 홈, 모닝콜, asmr, 단편, 무료, 다시듣기, 시리즈

- 19금 콘텐츠 (안)보기 설정
- 남성향, 여성향 콘텐츠만 보기 설정 적용
This commit is contained in:
2025-03-18 14:42:04 +09:00
parent 537ec88d05
commit b3b3d46696
26 changed files with 777 additions and 185 deletions

View File

@@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.rank
import com.querydsl.core.types.dsl.Expressions
import com.querydsl.jpa.impl.JPAQueryFactory
import kr.co.vividnext.sodalive.admin.content.series.genre.QSeriesGenre.seriesGenre
import kr.co.vividnext.sodalive.content.ContentType
import kr.co.vividnext.sodalive.content.QAudioContent.audioContent
import kr.co.vividnext.sodalive.content.comment.QAudioContentComment.audioContentComment
import kr.co.vividnext.sodalive.content.like.QAudioContentLike.audioContentLike
@@ -44,6 +45,7 @@ class RankingRepository(
fun getAudioContentRanking(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long,
@@ -66,6 +68,18 @@ class RankingRepository(
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
audioContent.member.auth.gender.eq(
if (contentType == ContentType.MALE) {
0
} else {
1
}
)
)
}
}
if (theme.isNotBlank()) {
@@ -167,6 +181,7 @@ class RankingRepository(
fun getSeriesRanking(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime
): List<Series> {
@@ -188,6 +203,18 @@ class RankingRepository(
if (!isAdult) {
where = where.and(series.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
series.member.auth.gender.eq(
if (contentType == ContentType.MALE) {
0
} else {
1
}
)
)
}
}
return queryFactory
@@ -209,7 +236,7 @@ class RankingRepository(
.fetch()
}
fun getCompleteSeriesRankingTotalCount(memberId: Long, isAdult: Boolean): Int {
fun getCompleteSeriesRankingTotalCount(memberId: Long, isAdult: Boolean, contentType: ContentType): Int {
val blockMemberCondition = blockMember.member.id.eq(member.id)
.and(blockMember.isActive.isTrue)
.and(blockMember.blockedMember.id.eq(memberId))
@@ -226,6 +253,18 @@ class RankingRepository(
if (!isAdult) {
where = where.and(series.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
series.member.auth.gender.eq(
if (contentType == ContentType.MALE) {
0
} else {
1
}
)
)
}
}
return queryFactory
@@ -244,6 +283,7 @@ class RankingRepository(
fun getCompleteSeriesRanking(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long,
@@ -270,6 +310,12 @@ class RankingRepository(
if (!isAdult) {
where = where.and(series.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
series.member.auth.gender.eq(if (contentType == ContentType.MALE) 0 else 1)
)
}
}
return queryFactory
@@ -288,7 +334,12 @@ class RankingRepository(
.fetch()
}
fun getSeriesAllRankingByGenre(memberId: Long, isAdult: Boolean, genreId: Long): List<Series> {
fun getSeriesAllRankingByGenre(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
genreId: Long
): List<Series> {
val blockMemberCondition = blockMember.member.id.eq(member.id)
.and(blockMember.isActive.isTrue)
.and(blockMember.blockedMember.id.eq(memberId))
@@ -306,6 +357,12 @@ class RankingRepository(
if (!isAdult) {
where = where.and(series.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
series.member.auth.gender.eq(if (contentType == ContentType.MALE) 0 else 1)
)
}
}
return queryFactory
@@ -330,6 +387,7 @@ class RankingRepository(
fun fetchCreatorBySellContentCountRankTop20(
memberId: Long,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime
): List<ContentCreatorResponse> {
@@ -342,10 +400,22 @@ class RankingRepository(
.and(order.createdAt.goe(startDate))
.and(order.createdAt.lt(endDate))
val memberCondition = member.isActive.isTrue
var memberCondition = member.isActive.isTrue
.and(member.role.eq(MemberRole.CREATOR))
.and(member.id.eq(audioContent.member.id))
if (contentType != ContentType.ALL) {
memberCondition = memberCondition.and(
member.auth.gender.eq(
if (contentType == ContentType.MALE) {
0
} else {
1
}
)
)
}
val where = audioContent.isActive.isTrue
.and(audioContent.price.gt(0))
.and(audioContent.duration.isNotNull)
@@ -376,6 +446,7 @@ class RankingRepository(
fun fetchCreatorContentBySalesCountTop4(
creatorId: Long,
isAdult: Boolean,
contentType: ContentType,
theme: String
): List<GetAudioContentRankingItem> {
var where = member.isActive.isTrue
@@ -389,6 +460,12 @@ class RankingRepository(
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
audioContent.member.auth.gender.eq(if (contentType == ContentType.MALE) 0 else 1)
)
}
}
if (theme.isNotBlank()) {
@@ -423,6 +500,7 @@ class RankingRepository(
fun fetchCreatorBySeriesRevenueRankTop20(
memberId: Long,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime
): List<ContentCreatorResponse> {
@@ -435,7 +513,7 @@ class RankingRepository(
.and(order.createdAt.goe(startDate))
.and(order.createdAt.lt(startDate))
val where = member.isActive.isTrue
var where = member.isActive.isTrue
.and(member.role.eq(MemberRole.CREATOR))
.and(series.isActive.isTrue)
.and(audioContent.isActive.isTrue)
@@ -443,6 +521,12 @@ class RankingRepository(
.and(audioContent.limited.isNull)
.and(blockMember.id.isNull)
if (contentType != ContentType.ALL) {
where = where.and(
audioContent.member.auth.gender.eq(if (contentType == ContentType.MALE) 0 else 1)
)
}
return queryFactory
.select(
QContentCreatorResponse(
@@ -469,7 +553,7 @@ class RankingRepository(
.fetch()
}
fun fetchCreatorSeriesBySales(creatorId: Long, isAdult: Boolean): List<Series> {
fun fetchCreatorSeriesBySales(creatorId: Long, isAdult: Boolean, contentType: ContentType): List<Series> {
var where = member.isActive.isTrue
.and(member.role.eq(MemberRole.CREATOR))
.and(series.isActive.isTrue)
@@ -481,6 +565,12 @@ class RankingRepository(
if (!isAdult) {
where = where.and(series.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
series.member.auth.gender.eq(if (contentType == ContentType.MALE) 0 else 1)
)
}
}
return queryFactory
@@ -501,7 +591,11 @@ class RankingRepository(
.fetch()
}
fun fetchFreeContentByCreatorIdTop4(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
fun fetchFreeContentByCreatorIdTop4(
creatorId: Long,
isAdult: Boolean,
contentType: ContentType
): List<GetAudioContentRankingItem> {
var where = member.isActive.isTrue
.and(member.id.eq(creatorId))
.and(member.role.eq(MemberRole.CREATOR))
@@ -512,6 +606,18 @@ class RankingRepository(
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
audioContent.member.auth.gender.eq(
if (contentType == ContentType.MALE) {
0
} else {
1
}
)
)
}
}
return queryFactory
@@ -538,7 +644,11 @@ class RankingRepository(
.fetch()
}
fun fetchCreatorContentByLikeCountTop4(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
fun fetchCreatorContentByLikeCountTop4(
creatorId: Long,
isAdult: Boolean,
contentType: ContentType
): List<GetAudioContentRankingItem> {
var where = member.isActive.isTrue
.and(member.id.eq(creatorId))
.and(member.role.eq(MemberRole.CREATOR))
@@ -550,6 +660,12 @@ class RankingRepository(
if (!isAdult) {
where = where.and(audioContent.isAdult.isFalse)
} else {
if (contentType != ContentType.ALL) {
where = where.and(
audioContent.member.auth.gender.eq(if (contentType == ContentType.MALE) 0 else 1)
)
}
}
return queryFactory

View File

@@ -1,5 +1,6 @@
package kr.co.vividnext.sodalive.rank
import kr.co.vividnext.sodalive.content.ContentType
import kr.co.vividnext.sodalive.content.main.ContentCreatorResponse
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
import kr.co.vividnext.sodalive.content.series.GetSeriesListResponse
@@ -40,6 +41,7 @@ class RankingService(
fun getContentRanking(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long = 0,
@@ -50,6 +52,7 @@ class RankingService(
return repository.getAudioContentRanking(
memberId = memberId,
isAdult = isAdult,
contentType = contentType,
startDate = startDate,
endDate = endDate,
offset = offset,
@@ -62,21 +65,24 @@ class RankingService(
fun getSeriesRanking(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime
): List<GetSeriesListResponse.SeriesListItem> {
val seriesList = repository.getSeriesRanking(memberId, isAdult, startDate, endDate)
val seriesList = repository.getSeriesRanking(memberId, isAdult, contentType, startDate, endDate)
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult)
}
fun getSeriesAllRankingByGenre(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
genreId: Long
): List<GetSeriesListResponse.SeriesListItem> {
val seriesList = repository.getSeriesAllRankingByGenre(
memberId = memberId,
isAdult = isAdult,
contentType = contentType,
genreId = genreId
)
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult)
@@ -84,17 +90,20 @@ class RankingService(
fun getCompleteSeriesRankingTotalCount(
memberId: Long,
isAdult: Boolean
isAdult: Boolean,
contentType: ContentType
): Int {
return repository.getCompleteSeriesRankingTotalCount(
memberId = memberId,
isAdult = isAdult
isAdult = isAdult,
contentType = contentType
)
}
fun getCompleteSeriesRanking(
memberId: Long,
isAdult: Boolean,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime,
offset: Long = 0,
@@ -103,6 +112,7 @@ class RankingService(
val seriesList = repository.getCompleteSeriesRanking(
memberId = memberId,
isAdult = isAdult,
contentType = contentType,
startDate = startDate,
endDate = endDate,
offset = offset,
@@ -179,38 +189,57 @@ class RankingService(
fun fetchCreatorBySellContentCountRankTop20(
memberId: Long,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime
): List<ContentCreatorResponse> {
return repository.fetchCreatorBySellContentCountRankTop20(memberId, startDate, endDate)
return repository.fetchCreatorBySellContentCountRankTop20(memberId, contentType, startDate, endDate)
}
fun fetchCreatorContentBySalesCountTop4(
creatorId: Long,
isAdult: Boolean,
contentType: ContentType,
theme: String = ""
): List<GetAudioContentRankingItem> {
return repository.fetchCreatorContentBySalesCountTop4(creatorId, isAdult, theme)
return repository.fetchCreatorContentBySalesCountTop4(creatorId, isAdult, contentType, theme)
}
fun fetchCreatorContentByLikeCountTop4(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
return repository.fetchCreatorContentByLikeCountTop4(creatorId, isAdult)
fun fetchCreatorContentByLikeCountTop4(
creatorId: Long,
isAdult: Boolean,
contentType: ContentType
): List<GetAudioContentRankingItem> {
return repository.fetchCreatorContentByLikeCountTop4(creatorId, isAdult, contentType)
}
fun fetchCreatorBySeriesRevenueRankTop20(
memberId: Long,
contentType: ContentType,
startDate: LocalDateTime,
endDate: LocalDateTime
): List<ContentCreatorResponse> {
return repository.fetchCreatorBySeriesRevenueRankTop20(memberId, startDate, endDate)
return repository.fetchCreatorBySeriesRevenueRankTop20(memberId, contentType, startDate, endDate)
}
fun fetchCreatorSeriesBySales(creatorId: Long, isAdult: Boolean): List<GetSeriesListResponse.SeriesListItem> {
val seriesList = repository.fetchCreatorSeriesBySales(creatorId = creatorId, isAdult = isAdult)
fun fetchCreatorSeriesBySales(
creatorId: Long,
isAdult: Boolean,
contentType: ContentType
): List<GetSeriesListResponse.SeriesListItem> {
val seriesList = repository.fetchCreatorSeriesBySales(
creatorId = creatorId,
isAdult = isAdult,
contentType = contentType
)
return seriesToSeriesListItem(seriesList, isAdult)
}
fun fetchFreeContentByCreatorIdTop4(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
return repository.fetchFreeContentByCreatorIdTop4(creatorId, isAdult)
fun fetchFreeContentByCreatorIdTop4(
creatorId: Long,
isAdult: Boolean,
contentType: ContentType
): List<GetAudioContentRankingItem> {
return repository.fetchFreeContentByCreatorIdTop4(creatorId, isAdult, contentType)
}
}