콘텐츠 메인 홈 - 인기 단편

- 데이터가 5개 미만이면 5개 이상이 될 때까지 랭킹 계산 시작 날짜를 1주일 씩 이전으로 설정
This commit is contained in:
Klaus 2025-03-19 16:23:44 +09:00
parent 1998a95c35
commit 46321dd3c1
2 changed files with 20 additions and 14 deletions

View File

@ -166,7 +166,6 @@ class AudioContentMainTabContentService(
.plusDays(1) .plusDays(1)
var loopCount = 0 var loopCount = 0
var contentCount: Int
var contentList: List<GetAudioContentRankingItem> var contentList: List<GetAudioContentRankingItem>
do { do {
@ -178,9 +177,8 @@ class AudioContentMainTabContentService(
endDate = dailyRankingEndDate, endDate = dailyRankingEndDate,
sortType = sortType sortType = sortType
) )
contentCount = contentList.size
loopCount++ loopCount++
} while (contentCount < 5) } while (contentList.size < 5)
return contentList return contentList
} }

View File

@ -49,17 +49,25 @@ class RankingService(
sortType: String = "매출", sortType: String = "매출",
theme: String = "" theme: String = ""
): List<GetAudioContentRankingItem> { ): List<GetAudioContentRankingItem> {
return repository.getAudioContentRanking( var loopCount = 0L
memberId = memberId, var contentList: List<GetAudioContentRankingItem>
isAdult = isAdult,
contentType = contentType, do {
startDate = startDate, contentList = repository.getAudioContentRanking(
endDate = endDate, memberId = memberId,
offset = offset, isAdult = isAdult,
limit = limit, contentType = contentType,
sortType = sortType, startDate = startDate.minusWeeks(loopCount),
theme = theme endDate = endDate,
) offset = offset,
limit = limit,
sortType = sortType,
theme = theme
)
loopCount++
} while (contentList.size < 5)
return contentList
} }
fun getSeriesRanking( fun getSeriesRanking(