feat(creator): 채널 홈 오디오 소장 필드를 추가한다
This commit is contained in:
@@ -122,6 +122,10 @@ class CreatorChannelHomeControllerTest @Autowired constructor(
|
||||
.andExpect(jsonPath("$.data.latestAudioContent.isPointAvailable").value(true))
|
||||
.andExpect(jsonPath("$.data.latestAudioContent.isFirstContent").value(true))
|
||||
.andExpect(jsonPath("$.data.latestAudioContent.isOriginalSeries").value(true))
|
||||
.andExpect(jsonPath("$.data.latestAudioContent.isOwned").value(true))
|
||||
.andExpect(jsonPath("$.data.latestAudioContent.isRented").value(false))
|
||||
.andExpect(jsonPath("$.data.audioContents[0].isOwned").value(false))
|
||||
.andExpect(jsonPath("$.data.audioContents[0].isRented").value(true))
|
||||
.andExpect(jsonPath("$.data.currentLive.isAdult").value(true))
|
||||
.andExpect(jsonPath("$.data.schedules[0].isAdult").doesNotExist())
|
||||
.andExpect(jsonPath("$.data.channelDonations[0].donationId").doesNotExist())
|
||||
@@ -195,7 +199,9 @@ class CreatorChannelHomeControllerTest @Autowired constructor(
|
||||
isFirstContent = true,
|
||||
publishedAt = LocalDateTime.of(2026, 6, 11, 1, 0),
|
||||
seriesName = "series",
|
||||
isOriginalSeries = true
|
||||
isOriginalSeries = true,
|
||||
isOwned = true,
|
||||
isRented = false
|
||||
),
|
||||
channelDonations = listOf(
|
||||
CreatorChannelDonation(
|
||||
@@ -228,7 +234,9 @@ class CreatorChannelHomeControllerTest @Autowired constructor(
|
||||
isFirstContent = false,
|
||||
publishedAt = LocalDateTime.of(2026, 6, 10, 1, 0),
|
||||
seriesName = null,
|
||||
isOriginalSeries = null
|
||||
isOriginalSeries = null,
|
||||
isOwned = false,
|
||||
isRented = true
|
||||
)
|
||||
),
|
||||
series = listOf(
|
||||
|
||||
@@ -68,7 +68,11 @@ class CreatorChannelHomeQueryServiceTest {
|
||||
assertEquals("https://cdn.test/profile/creator.png", home.creator.profileImageUrl)
|
||||
assertEquals("https://cdn.test/live.png", home.currentLive?.coverImageUrl)
|
||||
assertEquals("https://cdn.test/audio/latest.png", home.latestAudioContent?.imageUrl)
|
||||
assertTrue(home.latestAudioContent?.isOwned == true)
|
||||
assertFalse(home.latestAudioContent?.isRented == true)
|
||||
assertEquals(listOf(203L, 202L), home.audioContents.map { it.audioContentId })
|
||||
assertEquals(listOf(false, true), home.audioContents.map { it.isOwned })
|
||||
assertEquals(listOf(true, false), home.audioContents.map { it.isRented })
|
||||
assertEquals(listOf(402L, 401L, 404L), home.schedules.map { it.targetId })
|
||||
assertFalse(home.schedules.any { it.isAdult })
|
||||
assertEquals("https://cdn.test/profile/fan.png", home.channelDonations.first().profileImageUrl)
|
||||
@@ -179,6 +183,8 @@ class CreatorChannelHomeQueryServiceTest {
|
||||
assertEquals(home.creator.characterId, response.creator.characterId)
|
||||
assertEquals(home.currentLive?.liveId, response.currentLive?.liveId)
|
||||
assertEquals(home.latestAudioContent?.audioContentId, response.latestAudioContent?.audioContentId)
|
||||
assertEquals(home.latestAudioContent?.isOwned, response.latestAudioContent?.isOwned)
|
||||
assertEquals(home.latestAudioContent?.isRented, response.latestAudioContent?.isRented)
|
||||
assertEquals(home.channelDonations.first().message, response.channelDonations.first().message)
|
||||
assertEquals(home.notices.first().postId, response.notices.first().postId)
|
||||
assertEquals(home.schedules.first().targetId, response.schedules.first().targetId)
|
||||
@@ -217,6 +223,8 @@ class CreatorChannelHomeQueryServiceTest {
|
||||
assertTrue(response.latestAudioContent?.isPointAvailable == true)
|
||||
assertTrue(response.latestAudioContent?.isFirstContent == true)
|
||||
assertTrue(response.latestAudioContent?.isAdult == true)
|
||||
assertTrue(response.latestAudioContent?.isOwned == true)
|
||||
assertFalse(response.latestAudioContent?.isRented == true)
|
||||
assertTrue(response.series.first().isOriginal)
|
||||
assertNotNull(response.latestAudioContent?.isOriginalSeries)
|
||||
}
|
||||
@@ -239,6 +247,10 @@ class CreatorChannelHomeQueryServiceTest {
|
||||
assertFalse(json["latestAudioContent"].has("firstContent"))
|
||||
assertTrue(json["latestAudioContent"]["isAdult"].asBoolean())
|
||||
assertFalse(json["latestAudioContent"].has("adult"))
|
||||
assertTrue(json["latestAudioContent"]["isOwned"].asBoolean())
|
||||
assertFalse(json["latestAudioContent"].has("owned"))
|
||||
assertFalse(json["latestAudioContent"]["isRented"].asBoolean())
|
||||
assertFalse(json["latestAudioContent"].has("rented"))
|
||||
assertTrue(json["series"][0]["isOriginal"].asBoolean())
|
||||
assertFalse(json["series"][0].has("original"))
|
||||
assertFalse(json["series"][0].has("published" + "DaysOfWeek"))
|
||||
@@ -297,7 +309,9 @@ class CreatorChannelHomeQueryServiceTest {
|
||||
isFirstContent = true,
|
||||
publishedAt = LocalDateTime.of(2026, 6, 11, 1, 0),
|
||||
seriesName = "series",
|
||||
isOriginalSeries = true
|
||||
isOriginalSeries = true,
|
||||
isOwned = true,
|
||||
isRented = false
|
||||
),
|
||||
channelDonations = listOf(
|
||||
CreatorChannelDonation(
|
||||
@@ -330,7 +344,9 @@ class CreatorChannelHomeQueryServiceTest {
|
||||
isFirstContent = false,
|
||||
publishedAt = LocalDateTime.of(2026, 6, 10, 1, 0),
|
||||
seriesName = null,
|
||||
isOriginalSeries = null
|
||||
isOriginalSeries = null,
|
||||
isOwned = false,
|
||||
isRented = true
|
||||
)
|
||||
),
|
||||
series = listOf(
|
||||
@@ -484,7 +500,8 @@ private class FakeCreatorChannelHomeQueryPort : CreatorChannelHomeQueryPort {
|
||||
override fun findLatestAudioContent(
|
||||
creatorId: Long,
|
||||
now: LocalDateTime,
|
||||
canViewAdultContent: Boolean
|
||||
canViewAdultContent: Boolean,
|
||||
viewerId: Long?
|
||||
): CreatorChannelAudioContentRecord? = audioContentRecord(201L, "audio/latest.png")
|
||||
|
||||
override fun findChannelDonations(
|
||||
@@ -553,6 +570,7 @@ private class FakeCreatorChannelHomeQueryPort : CreatorChannelHomeQueryPort {
|
||||
now: LocalDateTime,
|
||||
latestAudioContentId: Long?,
|
||||
canViewAdultContent: Boolean,
|
||||
viewerId: Long?,
|
||||
limit: Int
|
||||
): List<CreatorChannelAudioContentRecord> {
|
||||
audioContentsLatestAudioContentId = latestAudioContentId
|
||||
@@ -630,7 +648,9 @@ private class FakeCreatorChannelHomeQueryPort : CreatorChannelHomeQueryPort {
|
||||
isFirstContent = false,
|
||||
publishedAt = LocalDateTime.of(2026, 6, 10, 0, audioContentId.toInt() % 60),
|
||||
seriesName = null,
|
||||
isOriginalSeries = null
|
||||
isOriginalSeries = null,
|
||||
isOwned = audioContentId == 201L || audioContentId == 202L,
|
||||
isRented = audioContentId == 203L
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,9 @@ class CreatorChannelHomeQueryPolicyTest {
|
||||
isFirstContent = false,
|
||||
publishedAt = publishedAt,
|
||||
seriesName = null,
|
||||
isOriginalSeries = null
|
||||
isOriginalSeries = null,
|
||||
isOwned = false,
|
||||
isRented = false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user