feat(creator): 채널 홈 오디오 소장 필드를 추가한다
This commit is contained in:
@@ -155,7 +155,8 @@ class DefaultCreatorChannelHomeQueryRepository(
|
||||
override fun findLatestAudioContent(
|
||||
creatorId: Long,
|
||||
now: LocalDateTime,
|
||||
canViewAdultContent: Boolean
|
||||
canViewAdultContent: Boolean,
|
||||
viewerId: Long?
|
||||
): CreatorChannelAudioContentRecord? {
|
||||
val row = findAudioContentRows(creatorId, now, null, canViewAdultContent, 1).firstOrNull() ?: return null
|
||||
return row.toAudioRecord(
|
||||
@@ -351,6 +352,7 @@ class DefaultCreatorChannelHomeQueryRepository(
|
||||
now: LocalDateTime,
|
||||
latestAudioContentId: Long?,
|
||||
canViewAdultContent: Boolean,
|
||||
viewerId: Long?,
|
||||
limit: Int
|
||||
): List<CreatorChannelAudioContentRecord> {
|
||||
val rows = findAudioContentRows(creatorId, now, latestAudioContentId, canViewAdultContent, limit)
|
||||
@@ -564,7 +566,9 @@ class DefaultCreatorChannelHomeQueryRepository(
|
||||
isFirstContent = firstContentId == audioContentId,
|
||||
publishedAt = get(audioContent.releaseDate)!!,
|
||||
seriesName = seriesSummary?.title,
|
||||
isOriginalSeries = seriesSummary?.isOriginal
|
||||
isOriginalSeries = seriesSummary?.isOriginal,
|
||||
isOwned = false,
|
||||
isRented = false
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -72,14 +72,15 @@ class CreatorChannelHomeQueryService(
|
||||
val isViewerCreator = viewerId == creatorId
|
||||
val effectiveViewerGender = viewer.effectiveGender()
|
||||
val latestAudioContent = queryPort
|
||||
.findLatestAudioContent(creatorId, now, canViewAdultContent)
|
||||
.findLatestAudioContent(creatorId, now, canViewAdultContent, viewerId)
|
||||
?.toDomain()
|
||||
val audioContents = queryPolicy.excludeLatestAudioContent(
|
||||
queryPort.findAudioContents(
|
||||
creatorId = creatorId,
|
||||
now = now,
|
||||
latestAudioContentId = latestAudioContent?.audioContentId,
|
||||
canViewAdultContent = canViewAdultContent
|
||||
canViewAdultContent = canViewAdultContent,
|
||||
viewerId = viewerId
|
||||
).map { it.toDomain() },
|
||||
latestAudioContent?.audioContentId
|
||||
)
|
||||
@@ -179,7 +180,9 @@ class CreatorChannelHomeQueryService(
|
||||
isFirstContent = isFirstContent,
|
||||
publishedAt = publishedAt,
|
||||
seriesName = seriesName,
|
||||
isOriginalSeries = isOriginalSeries
|
||||
isOriginalSeries = isOriginalSeries,
|
||||
isOwned = isOwned,
|
||||
isRented = isRented
|
||||
)
|
||||
|
||||
private fun CreatorChannelDonationRecord.toDomain() = CreatorChannelDonation(
|
||||
|
||||
@@ -51,7 +51,9 @@ data class CreatorChannelAudioContent(
|
||||
val isFirstContent: Boolean,
|
||||
val publishedAt: LocalDateTime,
|
||||
val seriesName: String?,
|
||||
val isOriginalSeries: Boolean?
|
||||
val isOriginalSeries: Boolean?,
|
||||
val isOwned: Boolean,
|
||||
val isRented: Boolean
|
||||
)
|
||||
|
||||
data class CreatorChannelDonation(
|
||||
|
||||
@@ -122,7 +122,11 @@ data class CreatorChannelAudioContentResponse(
|
||||
val isFirstContent: Boolean,
|
||||
val seriesName: String?,
|
||||
@JsonProperty("isOriginalSeries")
|
||||
val isOriginalSeries: Boolean?
|
||||
val isOriginalSeries: Boolean?,
|
||||
@JsonProperty("isOwned")
|
||||
val isOwned: Boolean,
|
||||
@JsonProperty("isRented")
|
||||
val isRented: Boolean
|
||||
) {
|
||||
companion object {
|
||||
fun from(audioContent: CreatorChannelAudioContent): CreatorChannelAudioContentResponse {
|
||||
@@ -136,7 +140,9 @@ data class CreatorChannelAudioContentResponse(
|
||||
isPointAvailable = audioContent.isPointAvailable,
|
||||
isFirstContent = audioContent.isFirstContent,
|
||||
seriesName = audioContent.seriesName,
|
||||
isOriginalSeries = audioContent.isOriginalSeries
|
||||
isOriginalSeries = audioContent.isOriginalSeries,
|
||||
isOwned = audioContent.isOwned,
|
||||
isRented = audioContent.isRented
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ interface CreatorChannelHomeQueryPort {
|
||||
fun findLatestAudioContent(
|
||||
creatorId: Long,
|
||||
now: LocalDateTime,
|
||||
canViewAdultContent: Boolean
|
||||
canViewAdultContent: Boolean,
|
||||
viewerId: Long? = null
|
||||
): CreatorChannelAudioContentRecord?
|
||||
|
||||
fun findChannelDonations(
|
||||
@@ -56,6 +57,7 @@ interface CreatorChannelHomeQueryPort {
|
||||
now: LocalDateTime,
|
||||
latestAudioContentId: Long?,
|
||||
canViewAdultContent: Boolean,
|
||||
viewerId: Long? = null,
|
||||
limit: Int = 9
|
||||
): List<CreatorChannelAudioContentRecord>
|
||||
|
||||
@@ -109,7 +111,9 @@ data class CreatorChannelAudioContentRecord(
|
||||
val isFirstContent: Boolean,
|
||||
val publishedAt: LocalDateTime,
|
||||
val seriesName: String?,
|
||||
val isOriginalSeries: Boolean?
|
||||
val isOriginalSeries: Boolean?,
|
||||
val isOwned: Boolean,
|
||||
val isRented: Boolean
|
||||
)
|
||||
|
||||
data class CreatorChannelDonationRecord(
|
||||
|
||||
Reference in New Issue
Block a user