feat(creator): 스케줄 성인 노출 정책을 적용한다
This commit is contained in:
@@ -68,7 +68,8 @@ data class CreatorChannelSchedule(
|
||||
val scheduledAt: LocalDateTime,
|
||||
val title: String,
|
||||
val type: CreatorActivityType,
|
||||
val targetId: Long
|
||||
val targetId: Long,
|
||||
val isAdult: Boolean
|
||||
)
|
||||
|
||||
data class CreatorChannelSeries(
|
||||
|
||||
@@ -6,10 +6,12 @@ import java.time.LocalDateTime
|
||||
class CreatorChannelHomeQueryPolicy {
|
||||
fun limitSchedules(
|
||||
schedules: List<CreatorChannelSchedule>,
|
||||
now: LocalDateTime
|
||||
now: LocalDateTime,
|
||||
canViewAdultContent: Boolean
|
||||
): List<CreatorChannelSchedule> {
|
||||
return schedules
|
||||
.filter { it.scheduledAt > now }
|
||||
.filter { canViewAdultContent || !it.isAdult }
|
||||
.sortedWith(compareBy<CreatorChannelSchedule> { it.scheduledAt }.thenBy { it.type.scheduleOrder() })
|
||||
.take(3)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user