feat(home): 포인트 사용 가능 콘텐츠 리스트 추가
This commit is contained in:
@@ -26,5 +26,6 @@ data class GetHomeResponse(
|
|||||||
val contentRanking: List<GetAudioContentRankingItem>,
|
val contentRanking: List<GetAudioContentRankingItem>,
|
||||||
val recommendChannelList: List<RecommendChannelResponse>,
|
val recommendChannelList: List<RecommendChannelResponse>,
|
||||||
val freeContentList: List<AudioContentMainItem>,
|
val freeContentList: List<AudioContentMainItem>,
|
||||||
|
val pointAvailableContentList: List<AudioContentMainItem>,
|
||||||
val curationList: List<GetContentCurationResponse>
|
val curationList: List<GetContentCurationResponse>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -175,6 +175,22 @@ class HomeService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 포인트 사용가능 콘텐츠 리스트 - 랜덤으로 가져오기 (DB에서 isPointAvailable 조건 적용)
|
||||||
|
val pointAvailableContentList = contentService.getLatestContentByTheme(
|
||||||
|
theme = emptyList(),
|
||||||
|
contentType = contentType,
|
||||||
|
isFree = false,
|
||||||
|
isAdult = isAdult,
|
||||||
|
orderByRandom = true,
|
||||||
|
isPointAvailableOnly = true
|
||||||
|
).filter {
|
||||||
|
if (memberId != null) {
|
||||||
|
!memberService.isBlocked(blockedMemberId = memberId, memberId = it.creatorId)
|
||||||
|
} else {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val curationList = curationService.getContentCurationList(
|
val curationList = curationService.getContentCurationList(
|
||||||
tabId = 3L, // 기존에 사용하던 단편 탭의 큐레이션을 사용
|
tabId = 3L, // 기존에 사용하던 단편 탭의 큐레이션을 사용
|
||||||
isAdult = isAdult,
|
isAdult = isAdult,
|
||||||
@@ -196,6 +212,7 @@ class HomeService(
|
|||||||
contentRanking = contentRanking,
|
contentRanking = contentRanking,
|
||||||
recommendChannelList = recommendChannelList,
|
recommendChannelList = recommendChannelList,
|
||||||
freeContentList = freeContentList,
|
freeContentList = freeContentList,
|
||||||
|
pointAvailableContentList = pointAvailableContentList,
|
||||||
curationList = curationList
|
curationList = curationList
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,8 @@ interface AudioContentQueryRepository {
|
|||||||
limit: Long,
|
limit: Long,
|
||||||
isFree: Boolean,
|
isFree: Boolean,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
orderByRandom: Boolean = false
|
orderByRandom: Boolean = false,
|
||||||
|
isPointAvailableOnly: Boolean = false
|
||||||
): List<AudioContentMainItem>
|
): List<AudioContentMainItem>
|
||||||
|
|
||||||
fun findContentByCurationId(
|
fun findContentByCurationId(
|
||||||
@@ -1310,7 +1311,8 @@ class AudioContentQueryRepositoryImpl(
|
|||||||
limit: Long,
|
limit: Long,
|
||||||
isFree: Boolean,
|
isFree: Boolean,
|
||||||
isAdult: Boolean,
|
isAdult: Boolean,
|
||||||
orderByRandom: Boolean
|
orderByRandom: Boolean,
|
||||||
|
isPointAvailableOnly: Boolean
|
||||||
): List<AudioContentMainItem> {
|
): List<AudioContentMainItem> {
|
||||||
var where = audioContent.isActive.isTrue
|
var where = audioContent.isActive.isTrue
|
||||||
.and(audioContent.duration.isNotNull)
|
.and(audioContent.duration.isNotNull)
|
||||||
@@ -1345,6 +1347,10 @@ class AudioContentQueryRepositoryImpl(
|
|||||||
where = where.and(audioContent.price.loe(0))
|
where = where.and(audioContent.price.loe(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isPointAvailableOnly) {
|
||||||
|
where = where.and(audioContent.isPointAvailable.isTrue)
|
||||||
|
}
|
||||||
|
|
||||||
val orderBy = if (orderByRandom) {
|
val orderBy = if (orderByRandom) {
|
||||||
Expressions.numberTemplate(Double::class.java, "function('rand')").asc()
|
Expressions.numberTemplate(Double::class.java, "function('rand')").asc()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -990,7 +990,8 @@ class AudioContentService(
|
|||||||
limit: Long = 20,
|
limit: Long = 20,
|
||||||
isFree: Boolean = false,
|
isFree: Boolean = false,
|
||||||
isAdult: Boolean = false,
|
isAdult: Boolean = false,
|
||||||
orderByRandom: Boolean = false
|
orderByRandom: Boolean = false,
|
||||||
|
isPointAvailableOnly: Boolean = false
|
||||||
): List<AudioContentMainItem> {
|
): List<AudioContentMainItem> {
|
||||||
return repository.getLatestContentByTheme(
|
return repository.getLatestContentByTheme(
|
||||||
theme = theme,
|
theme = theme,
|
||||||
@@ -999,7 +1000,8 @@ class AudioContentService(
|
|||||||
limit = limit,
|
limit = limit,
|
||||||
isFree = isFree,
|
isFree = isFree,
|
||||||
isAdult = isAdult,
|
isAdult = isAdult,
|
||||||
orderByRandom = orderByRandom
|
orderByRandom = orderByRandom,
|
||||||
|
isPointAvailableOnly = isPointAvailableOnly
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user