Compare commits
5 Commits
3d1716d847
...
3344757af8
Author | SHA1 | Date |
---|---|---|
|
3344757af8 | |
|
5521f39cc5 | |
|
f9c34d14c3 | |
|
dc0902c555 | |
|
239516b98b |
|
@ -31,6 +31,7 @@ class AudioContentMainTabRepository(
|
|||
val where = member.isActive.isTrue
|
||||
.and(member.role.eq(MemberRole.CREATOR))
|
||||
.and(audioContent.isActive.isTrue)
|
||||
.and(audioContent.price.gt(0))
|
||||
.and(audioContent.duration.isNotNull)
|
||||
.and(audioContent.limited.isNull)
|
||||
.and(audioContentTheme.isActive.isTrue)
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package kr.co.vividnext.sodalive.content.main.tab
|
||||
|
||||
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||
|
||||
data class GetPopularContentByCreatorResponse(
|
||||
val salesRankContentList: List<GetAudioContentRankingItem>,
|
||||
val salesCountRankContentList: List<GetAudioContentRankingItem>
|
||||
)
|
|
@ -2,11 +2,11 @@ package kr.co.vividnext.sodalive.content.main.tab.asmr
|
|||
|
||||
import kr.co.vividnext.sodalive.content.AudioContentRepository
|
||||
import kr.co.vividnext.sodalive.content.ContentType
|
||||
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
||||
import kr.co.vividnext.sodalive.content.main.curation.AudioContentCurationQueryRepository
|
||||
import kr.co.vividnext.sodalive.content.main.tab.AudioContentMainTabRepository
|
||||
import kr.co.vividnext.sodalive.content.main.tab.GetContentCurationResponse
|
||||
import kr.co.vividnext.sodalive.content.main.tab.GetPopularContentByCreatorResponse
|
||||
import kr.co.vividnext.sodalive.event.EventService
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
import kr.co.vividnext.sodalive.rank.RankingService
|
||||
|
@ -68,18 +68,8 @@ class AudioContentMainTabAsmrService(
|
|||
minCount = 4
|
||||
)
|
||||
|
||||
val salesRankContentList = if (creatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesTop2(
|
||||
creatorId = creatorList[0].creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
)
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
|
||||
val salesCountRankContentList = if (creatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = creatorList[0].creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
|
@ -107,30 +97,17 @@ class AudioContentMainTabAsmrService(
|
|||
newAsmrContentList = newAsmrContentList,
|
||||
rankAsmrContentList = rankAsmrContentList,
|
||||
creatorList = creatorList,
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList,
|
||||
eventBannerList = eventBannerList,
|
||||
curationList = curationList
|
||||
)
|
||||
}
|
||||
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): GetPopularContentByCreatorResponse {
|
||||
val theme = "ASMR"
|
||||
val salesRankContentList = rankingService.fetchCreatorContentBySalesTop2(
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
return rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
)
|
||||
|
||||
val salesCountRankContentList = rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
)
|
||||
|
||||
return GetPopularContentByCreatorResponse(
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList
|
||||
theme = "ASMR"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ data class GetContentMainTabAsmrResponse(
|
|||
val newAsmrContentList: List<GetAudioContentMainItem>,
|
||||
val rankAsmrContentList: List<GetAudioContentRankingItem>,
|
||||
val creatorList: List<ContentCreatorResponse>,
|
||||
val salesRankContentList: List<GetAudioContentRankingItem>,
|
||||
val salesCountRankContentList: List<GetAudioContentRankingItem>,
|
||||
val eventBannerList: GetEventResponse,
|
||||
val curationList: List<GetContentCurationResponse>
|
||||
|
|
|
@ -5,7 +5,6 @@ import kr.co.vividnext.sodalive.content.ContentType
|
|||
import kr.co.vividnext.sodalive.content.main.GetAudioContentMainItem
|
||||
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
||||
import kr.co.vividnext.sodalive.content.main.tab.GetPopularContentByCreatorResponse
|
||||
import kr.co.vividnext.sodalive.content.theme.AudioContentThemeQueryRepository
|
||||
import kr.co.vividnext.sodalive.event.EventService
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
|
@ -69,23 +68,14 @@ class AudioContentMainTabContentService(
|
|||
// 이벤트 배너
|
||||
val eventBannerList = eventService.getEventList(isAdult = isAdult)
|
||||
|
||||
val contentRankCreatorList = rankingService.fetchCreatorByContentRevenueRankTop20(
|
||||
val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
|
||||
memberId = member.id!!,
|
||||
startDate = dailyRankingStartDate.minusDays(1),
|
||||
endDate = dailyRankingEndDate
|
||||
)
|
||||
|
||||
val salesRankContentList = if (contentRankCreatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesTop2(
|
||||
creatorId = contentRankCreatorList[0].creatorId,
|
||||
isAdult = member.auth != null
|
||||
)
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
|
||||
val salesCountRankContentList = if (contentRankCreatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = contentRankCreatorList[0].creatorId,
|
||||
isAdult = member.auth != null
|
||||
)
|
||||
|
@ -100,7 +90,6 @@ class AudioContentMainTabContentService(
|
|||
rankSortTypeList = listOf("매출", "댓글", "좋아요"),
|
||||
rankContentList = rankContentList,
|
||||
contentRankCreatorList = contentRankCreatorList,
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList,
|
||||
eventBannerList = eventBannerList
|
||||
)
|
||||
|
@ -144,20 +133,10 @@ class AudioContentMainTabContentService(
|
|||
)
|
||||
}
|
||||
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): GetPopularContentByCreatorResponse {
|
||||
val salesRankContentList = rankingService.fetchCreatorContentBySalesTop2(
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
return rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
val salesCountRankContentList = rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
return GetPopularContentByCreatorResponse(
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ data class GetContentMainTabContentResponse(
|
|||
val rankSortTypeList: List<String>,
|
||||
val rankContentList: List<GetAudioContentRankingItem>,
|
||||
val contentRankCreatorList: List<ContentCreatorResponse>,
|
||||
val salesRankContentList: List<GetAudioContentRankingItem>,
|
||||
val salesCountRankContentList: List<GetAudioContentRankingItem>,
|
||||
val eventBannerList: GetEventResponse
|
||||
)
|
||||
|
|
|
@ -53,7 +53,6 @@ class AudioContentMainTabFreeService(
|
|||
val newFreeContentList = if (themeList.isNotEmpty()) {
|
||||
audioContentRepository.findByTheme(
|
||||
memberId = member.id!!,
|
||||
theme = themeList[0],
|
||||
isAdult = member.auth != null,
|
||||
contentType = ContentType.ALL,
|
||||
offset = 0,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package kr.co.vividnext.sodalive.content.main.tab.home
|
||||
|
||||
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
||||
import kr.co.vividnext.sodalive.content.main.tab.GetPopularContentByCreatorResponse
|
||||
import kr.co.vividnext.sodalive.event.EventService
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
import kr.co.vividnext.sodalive.notice.ServiceNoticeService
|
||||
|
@ -74,27 +74,17 @@ class AudioContentMainTabHomeService(
|
|||
|
||||
/* 채널별 인기 콘텐츠
|
||||
* - 콘텐츠를 4개 이상 등록한 채널
|
||||
* - 주간 콘텐츠 매출 Top 20 채널
|
||||
* - 해당 채널의 누적 매출 Top 2
|
||||
* - 해당 채널의 누적 판매 개수 Top 2
|
||||
* - 주간 콘텐츠 판매 개수 Top 20 채널
|
||||
* - 해당 채널의 누적 판매 개수 Top 4
|
||||
*/
|
||||
val contentRankCreatorList = rankingService.fetchCreatorByContentRevenueRankTop20(
|
||||
val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
|
||||
memberId = member.id!!,
|
||||
startDate = startDate.minusDays(1),
|
||||
endDate = endDate
|
||||
)
|
||||
|
||||
val salesRankContentList = if (contentRankCreatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesTop2(
|
||||
creatorId = contentRankCreatorList[0].creatorId,
|
||||
isAdult = member.auth != null
|
||||
)
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
|
||||
val salesCountRankContentList = if (contentRankCreatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = contentRankCreatorList[0].creatorId,
|
||||
isAdult = member.auth != null
|
||||
)
|
||||
|
@ -111,25 +101,14 @@ class AudioContentMainTabHomeService(
|
|||
rankContentList = rankContentList,
|
||||
eventBannerList = eventBannerList,
|
||||
contentRankCreatorList = contentRankCreatorList,
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList
|
||||
)
|
||||
}
|
||||
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): GetPopularContentByCreatorResponse {
|
||||
val salesRankContentList = rankingService.fetchCreatorContentBySalesTop2(
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
return rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
val salesCountRankContentList = rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
return GetPopularContentByCreatorResponse(
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,5 @@ data class GetContentMainTabHomeResponse(
|
|||
val rankContentList: List<GetAudioContentRankingItem>,
|
||||
val eventBannerList: GetEventResponse,
|
||||
val contentRankCreatorList: List<ContentCreatorResponse>,
|
||||
val salesRankContentList: List<GetAudioContentRankingItem>,
|
||||
val salesCountRankContentList: List<GetAudioContentRankingItem>
|
||||
)
|
||||
|
|
|
@ -2,11 +2,11 @@ package kr.co.vividnext.sodalive.content.main.tab.replay
|
|||
|
||||
import kr.co.vividnext.sodalive.content.AudioContentRepository
|
||||
import kr.co.vividnext.sodalive.content.ContentType
|
||||
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
||||
import kr.co.vividnext.sodalive.content.main.curation.AudioContentCurationQueryRepository
|
||||
import kr.co.vividnext.sodalive.content.main.tab.AudioContentMainTabRepository
|
||||
import kr.co.vividnext.sodalive.content.main.tab.GetContentCurationResponse
|
||||
import kr.co.vividnext.sodalive.content.main.tab.GetPopularContentByCreatorResponse
|
||||
import kr.co.vividnext.sodalive.event.EventService
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
import kr.co.vividnext.sodalive.rank.RankingService
|
||||
|
@ -68,18 +68,8 @@ class AudioContentMainTabLiveReplayService(
|
|||
minCount = 4
|
||||
)
|
||||
|
||||
val salesRankContentList = if (creatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesTop2(
|
||||
creatorId = creatorList[0].creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
)
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
|
||||
val salesCountRankContentList = if (creatorList.isNotEmpty()) {
|
||||
rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = creatorList[0].creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
|
@ -107,30 +97,17 @@ class AudioContentMainTabLiveReplayService(
|
|||
newLiveReplayContentList = newLiveReplayContentList,
|
||||
rankLiveReplayContentList = rankLiveReplayContentList,
|
||||
creatorList = creatorList,
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList,
|
||||
eventBannerList = eventBannerList,
|
||||
curationList = curationList
|
||||
)
|
||||
}
|
||||
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): GetPopularContentByCreatorResponse {
|
||||
val theme = "다시듣기"
|
||||
val salesRankContentList = rankingService.fetchCreatorContentBySalesTop2(
|
||||
fun getPopularContentByCreator(creatorId: Long, isAdult: Boolean): List<GetAudioContentRankingItem> {
|
||||
return rankingService.fetchCreatorContentBySalesCountTop4(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
)
|
||||
|
||||
val salesCountRankContentList = rankingService.fetchCreatorContentBySalesCountTop2(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult,
|
||||
theme = theme
|
||||
)
|
||||
|
||||
return GetPopularContentByCreatorResponse(
|
||||
salesRankContentList = salesRankContentList,
|
||||
salesCountRankContentList = salesCountRankContentList
|
||||
theme = "다시듣기"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ data class GetContentMainTabLiveReplayResponse(
|
|||
val newLiveReplayContentList: List<GetAudioContentMainItem>,
|
||||
val rankLiveReplayContentList: List<GetAudioContentRankingItem>,
|
||||
val creatorList: List<ContentCreatorResponse>,
|
||||
val salesRankContentList: List<GetAudioContentRankingItem>,
|
||||
val salesCountRankContentList: List<GetAudioContentRankingItem>,
|
||||
val eventBannerList: GetEventResponse,
|
||||
val curationList: List<GetContentCurationResponse>
|
||||
|
|
|
@ -336,7 +336,7 @@ class RankingRepository(
|
|||
.fetch()
|
||||
}
|
||||
|
||||
fun fetchCreatorByContentRevenueRankTop20(
|
||||
fun fetchCreatorBySellContentCountRankTop20(
|
||||
memberId: Long,
|
||||
startDate: LocalDateTime,
|
||||
endDate: LocalDateTime
|
||||
|
@ -350,9 +350,12 @@ class RankingRepository(
|
|||
.and(order.createdAt.goe(startDate))
|
||||
.and(order.createdAt.lt(startDate))
|
||||
|
||||
val where = member.isActive.isTrue
|
||||
val memberCondition = member.isActive.isTrue
|
||||
.and(member.role.eq(MemberRole.CREATOR))
|
||||
.and(audioContent.isActive.isTrue)
|
||||
.and(member.id.eq(audioContent.member.id))
|
||||
|
||||
val where = audioContent.isActive.isTrue
|
||||
.and(audioContent.price.gt(0))
|
||||
.and(audioContent.duration.isNotNull)
|
||||
.and(audioContent.limited.isNull)
|
||||
.and(blockMember.id.isNull)
|
||||
|
@ -365,71 +368,20 @@ class RankingRepository(
|
|||
member.profileImage.prepend("/").prepend(imageHost)
|
||||
)
|
||||
)
|
||||
.from(member)
|
||||
.innerJoin(audioContent).on(member.id.eq(audioContent.member.id))
|
||||
.from(audioContent)
|
||||
.innerJoin(member).on(memberCondition)
|
||||
.leftJoin(order).on(ordersCondition)
|
||||
.leftJoin(blockMember).on(blockMemberCondition)
|
||||
.where(where)
|
||||
.groupBy(member.id)
|
||||
.having(audioContent.id.count().goe(4))
|
||||
.orderBy(
|
||||
order.can.sum().desc(),
|
||||
Expressions.numberTemplate(Double::class.java, "function('rand')").asc()
|
||||
)
|
||||
.orderBy(order.id.count().desc(), member.id.desc())
|
||||
.offset(0)
|
||||
.limit(20)
|
||||
.fetch()
|
||||
}
|
||||
|
||||
fun fetchCreatorContentBySalesTop2(
|
||||
creatorId: Long,
|
||||
isAdult: Boolean,
|
||||
theme: String
|
||||
): List<GetAudioContentRankingItem> {
|
||||
var where = member.isActive.isTrue
|
||||
.and(member.role.eq(MemberRole.CREATOR))
|
||||
.and(audioContent.isActive.isTrue)
|
||||
.and(audioContent.duration.isNotNull)
|
||||
.and(audioContent.limited.isNull)
|
||||
.and(audioContentTheme.isActive.isTrue)
|
||||
.and(order.isActive.isTrue)
|
||||
.and(member.id.eq(creatorId))
|
||||
|
||||
if (!isAdult) {
|
||||
where = where.and(series.isAdult.isFalse)
|
||||
}
|
||||
|
||||
if (theme.isNotBlank()) {
|
||||
where = where.and(audioContentTheme.theme.eq(theme))
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.select(
|
||||
QGetAudioContentRankingItem(
|
||||
audioContent.id,
|
||||
audioContent.title,
|
||||
audioContent.coverImage.prepend("/").prepend(imageHost),
|
||||
audioContentTheme.theme,
|
||||
audioContent.price,
|
||||
audioContent.duration,
|
||||
member.id,
|
||||
member.nickname,
|
||||
member.profileImage.prepend("/").prepend(imageHost)
|
||||
)
|
||||
)
|
||||
.from(order)
|
||||
.innerJoin(order.audioContent, audioContent)
|
||||
.innerJoin(audioContent.theme, audioContentTheme)
|
||||
.innerJoin(audioContent.member, member)
|
||||
.where(where)
|
||||
.groupBy(audioContent.id)
|
||||
.orderBy(order.can.sum().desc())
|
||||
.offset(0)
|
||||
.limit(2)
|
||||
.fetch()
|
||||
}
|
||||
|
||||
fun fetchCreatorContentBySalesCountTop2(
|
||||
fun fetchCreatorContentBySalesCountTop4(
|
||||
creatorId: Long,
|
||||
isAdult: Boolean,
|
||||
theme: String
|
||||
|
@ -473,7 +425,7 @@ class RankingRepository(
|
|||
.groupBy(audioContent.id)
|
||||
.orderBy(order.id.count().desc())
|
||||
.offset(0)
|
||||
.limit(2)
|
||||
.limit(4)
|
||||
.fetch()
|
||||
}
|
||||
|
||||
|
|
|
@ -181,28 +181,20 @@ class RankingService(
|
|||
}
|
||||
}
|
||||
|
||||
fun fetchCreatorByContentRevenueRankTop20(
|
||||
fun fetchCreatorBySellContentCountRankTop20(
|
||||
memberId: Long,
|
||||
startDate: LocalDateTime,
|
||||
endDate: LocalDateTime
|
||||
): List<ContentCreatorResponse> {
|
||||
return repository.fetchCreatorByContentRevenueRankTop20(memberId, startDate, endDate)
|
||||
return repository.fetchCreatorBySellContentCountRankTop20(memberId, startDate, endDate)
|
||||
}
|
||||
|
||||
fun fetchCreatorContentBySalesTop2(
|
||||
fun fetchCreatorContentBySalesCountTop4(
|
||||
creatorId: Long,
|
||||
isAdult: Boolean,
|
||||
theme: String = ""
|
||||
): List<GetAudioContentRankingItem> {
|
||||
return repository.fetchCreatorContentBySalesTop2(creatorId, isAdult, theme)
|
||||
}
|
||||
|
||||
fun fetchCreatorContentBySalesCountTop2(
|
||||
creatorId: Long,
|
||||
isAdult: Boolean,
|
||||
theme: String = ""
|
||||
): List<GetAudioContentRankingItem> {
|
||||
return repository.fetchCreatorContentBySalesCountTop2(creatorId, isAdult, theme)
|
||||
return repository.fetchCreatorContentBySalesCountTop4(creatorId, isAdult, theme)
|
||||
}
|
||||
|
||||
fun fetchCreatorBySeriesRevenueRankTop20(
|
||||
|
|
Loading…
Reference in New Issue