fix(home): AI 캐릭터 홈 노출 개수를 늘린다
This commit is contained in:
@@ -315,7 +315,7 @@ class HomeRecommendationFacade(
|
|||||||
private const val HOME_ACTIVE_CREATOR_LIMIT = 10
|
private const val HOME_ACTIVE_CREATOR_LIMIT = 10
|
||||||
private const val HOME_RECENT_DEBUT_CREATOR_LIMIT = 10
|
private const val HOME_RECENT_DEBUT_CREATOR_LIMIT = 10
|
||||||
private const val HOME_FIRST_AUDIO_CONTENT_LIMIT = 10
|
private const val HOME_FIRST_AUDIO_CONTENT_LIMIT = 10
|
||||||
private const val HOME_AI_CHARACTER_LIMIT = 10
|
private const val HOME_AI_CHARACTER_LIMIT = 20
|
||||||
private const val HOME_GENRE_CREATOR_GENRE_LIMIT = 5
|
private const val HOME_GENRE_CREATOR_GENRE_LIMIT = 5
|
||||||
private const val HOME_GENRE_CREATOR_CREATOR_LIMIT = 8
|
private const val HOME_GENRE_CREATOR_CREATOR_LIMIT = 8
|
||||||
private const val HOME_CHEER_CREATOR_LIMIT = 8
|
private const val HOME_CHEER_CREATOR_LIMIT = 8
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class HomeRecommendationQueryService(
|
|||||||
private const val DEFAULT_ACTIVE_CREATOR_LIMIT = 10
|
private const val DEFAULT_ACTIVE_CREATOR_LIMIT = 10
|
||||||
private const val DEFAULT_RECENT_DEBUT_CREATOR_LIMIT = 10
|
private const val DEFAULT_RECENT_DEBUT_CREATOR_LIMIT = 10
|
||||||
private const val DEFAULT_FIRST_AUDIO_CONTENT_LIMIT = 10
|
private const val DEFAULT_FIRST_AUDIO_CONTENT_LIMIT = 10
|
||||||
private const val DEFAULT_AI_CHARACTER_LIMIT = 10
|
private const val DEFAULT_AI_CHARACTER_LIMIT = 20
|
||||||
private const val DEFAULT_CHEER_CREATOR_LIMIT = 8
|
private const val DEFAULT_CHEER_CREATOR_LIMIT = 8
|
||||||
private const val CHEER_CREATOR_CANDIDATE_LIMIT = 16
|
private const val CHEER_CREATOR_CANDIDATE_LIMIT = 16
|
||||||
private const val DEFAULT_POPULAR_COMMUNITY_LIMIT = 10
|
private const val DEFAULT_POPULAR_COMMUNITY_LIMIT = 10
|
||||||
|
|||||||
@@ -243,6 +243,22 @@ class HomeRecommendationControllerTest @Autowired constructor(
|
|||||||
.andExpect(jsonPath("$.data.lives").isArray)
|
.andExpect(jsonPath("$.data.lives").isArray)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("메인 홈 통합 조회는 AI 캐릭터를 최신 스냅샷 기준 최대 20개까지 반환한다")
|
||||||
|
fun shouldReturnTwentyAiCharactersOnHomeRecommendations() {
|
||||||
|
(1..22).forEach { index ->
|
||||||
|
val character = saveAiCharacter("home-ai-character-$index")
|
||||||
|
saveRecommendationSnapshot(character.id!!)
|
||||||
|
}
|
||||||
|
entityManager.flush()
|
||||||
|
entityManager.clear()
|
||||||
|
|
||||||
|
mockMvc.perform(get("/api/v2/home/recommendations"))
|
||||||
|
.andExpect(status().isOk)
|
||||||
|
.andExpect(jsonPath("$.success").value(true))
|
||||||
|
.andExpect(jsonPath("$.data.aiCharacters.length()").value(20))
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("메인 홈 통합 조회 실패는 응답 시간과 함께 로그로 관측된다")
|
@DisplayName("메인 홈 통합 조회 실패는 응답 시간과 함께 로그로 관측된다")
|
||||||
fun shouldLogHomeRecommendationFailure(output: CapturedOutput) {
|
fun shouldLogHomeRecommendationFailure(output: CapturedOutput) {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("AI 캐릭터 추천은 최신 스냅샷 10개를 기준으로 순서를 유지해 상세를 조립한다")
|
@DisplayName("AI 캐릭터 추천은 최신 스냅샷 20개를 기준으로 순서를 유지해 상세를 조립한다")
|
||||||
fun shouldFindAiCharactersFromLatestSnapshotsWithLimitAndDetails() {
|
fun shouldFindAiCharactersFromLatestSnapshotsWithLimitAndDetails() {
|
||||||
val oldSnapshotAt = LocalDateTime.of(2026, 5, 28, 23, 59, 59)
|
val oldSnapshotAt = LocalDateTime.of(2026, 5, 28, 23, 59, 59)
|
||||||
val latestSnapshotAt = LocalDateTime.of(2026, 5, 29, 23, 59, 59)
|
val latestSnapshotAt = LocalDateTime.of(2026, 5, 29, 23, 59, 59)
|
||||||
@@ -153,7 +153,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
snapshotPort.replaceSnapshots(
|
snapshotPort.replaceSnapshots(
|
||||||
RecommendedSectionType.AI_CHARACTER,
|
RecommendedSectionType.AI_CHARACTER,
|
||||||
latestSnapshotAt,
|
latestSnapshotAt,
|
||||||
(1L..12L).map { targetId ->
|
(1L..22L).map { targetId ->
|
||||||
snapshot(RecommendedSectionType.AI_CHARACTER, targetId, 100.0 - targetId, latestSnapshotAt)
|
snapshot(RecommendedSectionType.AI_CHARACTER, targetId, 100.0 - targetId, latestSnapshotAt)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -180,7 +180,7 @@ class HomeRecommendationQueryServiceTest {
|
|||||||
|
|
||||||
val characters = service.findAiCharacterRecommendations()
|
val characters = service.findAiCharacterRecommendations()
|
||||||
|
|
||||||
assertEquals((1L..10L).toList(), port.aiCharacterDetailIds)
|
assertEquals((1L..20L).toList(), port.aiCharacterDetailIds)
|
||||||
assertEquals(listOf(1L, 2L), characters.map { it.characterId })
|
assertEquals(listOf(1L, 2L), characters.map { it.characterId })
|
||||||
assertEquals(listOf(101L, 102L), characters.map { it.creatorId })
|
assertEquals(listOf(101L, 102L), characters.map { it.creatorId })
|
||||||
assertEquals("profile/character-1.png", characters.first().profileImage)
|
assertEquals("profile/character-1.png", characters.first().profileImage)
|
||||||
|
|||||||
Reference in New Issue
Block a user