fix(recommendation): 추천 snapshot offset 범위를 확장한다
This commit is contained in:
+9
-9
@@ -615,7 +615,7 @@ class HomeRecommendationQueryServiceTest {
|
||||
|
||||
private class FakeHomeRecommendationQueryPort : HomeRecommendationQueryPort {
|
||||
var liveLimit: Int? = null
|
||||
var liveOffset: Int? = null
|
||||
var liveOffset: Long? = null
|
||||
var liveMemberId: Long? = null
|
||||
var liveIncludeAdultLives: Boolean? = null
|
||||
var bannerLimit: Int? = null
|
||||
@@ -625,12 +625,12 @@ class HomeRecommendationQueryServiceTest {
|
||||
var activeCreatorIncludeAdultActivities: Boolean? = null
|
||||
var recentDebutNow: LocalDateTime? = null
|
||||
var recentDebutLimit: Int? = null
|
||||
var recentDebutOffset: Int? = null
|
||||
var recentDebutOffset: Long? = null
|
||||
var recentDebutMemberId: Long? = null
|
||||
var recentDebutIncludeAdultContents: Boolean? = null
|
||||
var firstAudioNow: LocalDateTime? = null
|
||||
var firstAudioLimit: Int? = null
|
||||
var firstAudioOffset: Int? = null
|
||||
var firstAudioOffset: Long? = null
|
||||
var firstAudioMemberId: Long? = null
|
||||
var firstAudioIncludeAdultContents: Boolean? = null
|
||||
var aiCharacterDetailIds: List<Long> = emptyList()
|
||||
@@ -699,7 +699,7 @@ class HomeRecommendationQueryServiceTest {
|
||||
var genreCreatorRecommendations: List<HomeGenreCreatorRecommendationGroup> = emptyList()
|
||||
|
||||
override fun findLiveRecommendations(
|
||||
offset: Int,
|
||||
offset: Long,
|
||||
limit: Int,
|
||||
memberId: Long?,
|
||||
includeAdultLives: Boolean
|
||||
@@ -730,7 +730,7 @@ class HomeRecommendationQueryServiceTest {
|
||||
|
||||
override fun findRecentDebutCreators(
|
||||
now: LocalDateTime,
|
||||
offset: Int,
|
||||
offset: Long,
|
||||
limit: Int,
|
||||
memberId: Long?,
|
||||
includeAdultContents: Boolean
|
||||
@@ -745,7 +745,7 @@ class HomeRecommendationQueryServiceTest {
|
||||
|
||||
override fun findFirstAudioContents(
|
||||
now: LocalDateTime,
|
||||
offset: Int,
|
||||
offset: Long,
|
||||
limit: Int,
|
||||
memberId: Long?,
|
||||
includeAdultContents: Boolean
|
||||
@@ -821,7 +821,7 @@ private class FakeHomeRecommendationSnapshotPort : RecommendationSnapshotPort {
|
||||
|
||||
override fun findLatestSnapshots(
|
||||
sectionType: RecommendedSectionType,
|
||||
offset: Int,
|
||||
offset: Long,
|
||||
limit: Int
|
||||
): List<RecommendationSnapshotRecord> {
|
||||
val latestSnapshotAt = snapshots
|
||||
@@ -832,8 +832,8 @@ private class FakeHomeRecommendationSnapshotPort : RecommendationSnapshotPort {
|
||||
.filter { it.sectionType == sectionType && it.snapshotAt == latestSnapshotAt }
|
||||
.sortedWith(compareByDescending<RecommendationSnapshotRecord> { it.score }.thenBy { it.randomTieBreaker })
|
||||
|
||||
if (offset == 0 && limit == Int.MAX_VALUE) return all
|
||||
return all.drop(offset).take(limit)
|
||||
if (offset == 0L && limit == Int.MAX_VALUE) return all
|
||||
return all.drop(offset.toInt()).take(limit)
|
||||
}
|
||||
|
||||
override fun replaceSnapshots(
|
||||
|
||||
+3
-3
@@ -256,7 +256,7 @@ private class FakeRecommendationSnapshotPort : RecommendationSnapshotPort {
|
||||
|
||||
override fun findLatestSnapshots(
|
||||
sectionType: RecommendedSectionType,
|
||||
offset: Int,
|
||||
offset: Long,
|
||||
limit: Int
|
||||
): List<RecommendationSnapshotRecord> {
|
||||
val latestSnapshotAt = snapshots
|
||||
@@ -267,8 +267,8 @@ private class FakeRecommendationSnapshotPort : RecommendationSnapshotPort {
|
||||
.filter { it.sectionType == sectionType && it.snapshotAt == latestSnapshotAt }
|
||||
.sortedWith(compareByDescending<RecommendationSnapshotRecord> { it.score }.thenBy { it.randomTieBreaker })
|
||||
|
||||
if (offset == 0 && limit == Int.MAX_VALUE) return all
|
||||
return all.drop(offset).take(limit)
|
||||
if (offset == 0L && limit == Int.MAX_VALUE) return all
|
||||
return all.drop(offset.toInt()).take(limit)
|
||||
}
|
||||
|
||||
override fun replaceSnapshots(
|
||||
|
||||
Reference in New Issue
Block a user