콘텐츠 메인 단편 - 일간랭킹

- 데이터가 5개 미만이면 5개 이상이 될 때까지 랭킹 계산 시작 날짜를 5일씩 이전으로 설정
This commit is contained in:
Klaus 2025-03-19 16:15:27 +09:00
parent 13a1fa674b
commit 1998a95c35
1 changed files with 18 additions and 8 deletions

View File

@ -165,14 +165,24 @@ class AudioContentMainTabContentService(
val dailyRankingEndDate = dailyRankingStartDate val dailyRankingEndDate = dailyRankingStartDate
.plusDays(1) .plusDays(1)
return rankingService.getContentRanking( var loopCount = 0
memberId = memberId, var contentCount: Int
isAdult = isAdult, var contentList: List<GetAudioContentRankingItem>
contentType = contentType,
startDate = dailyRankingStartDate, do {
endDate = dailyRankingEndDate, contentList = rankingService.getContentRanking(
sortType = sortType memberId = memberId,
) isAdult = isAdult,
contentType = contentType,
startDate = dailyRankingStartDate.minusDays(loopCount * 5L),
endDate = dailyRankingEndDate,
sortType = sortType
)
contentCount = contentList.size
loopCount++
} while (contentCount < 5)
return contentList
} }
fun getNewContentByTheme( fun getNewContentByTheme(