feat: Timelineの構築に必要なものを追加

This commit is contained in:
usbharu 2024-06-29 12:31:06 +09:00
parent c0f03560d5
commit 6188463a68
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
17 changed files with 119 additions and 0 deletions

View File

@ -0,0 +1,6 @@
package dev.usbharu.hideout.core.domain.model.followtimeline
import dev.usbharu.hideout.core.domain.model.timeline.TimelineId
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
class FollowTimeline(val userDetailId: UserDetailId, val timelineId: TimelineId)

View File

@ -0,0 +1,6 @@
package dev.usbharu.hideout.core.domain.model.followtimeline
interface FollowTimelineRepository {
suspend fun save(followTimeline: FollowTimeline): FollowTimeline
suspend fun delete(followTimeline: FollowTimeline)
}

View File

@ -0,0 +1,3 @@
package dev.usbharu.hideout.core.domain.model.timeline
class Timeline(val id: TimelineId, val name: TimelineName, val visibility: TimelineVisibility, val isSystem: Boolean)

View File

@ -0,0 +1,5 @@
package dev.usbharu.hideout.core.domain.model.timeline
class TimelineId {
}

View File

@ -0,0 +1,5 @@
package dev.usbharu.hideout.core.domain.model.timeline
class TimelineName {
}

View File

@ -0,0 +1,6 @@
package dev.usbharu.hideout.core.domain.model.timeline
interface TimelineRepository {
suspend fun save(timeline: Timeline): Timeline
suspend fun delete(timeline: Timeline)
}

View File

@ -0,0 +1,7 @@
package dev.usbharu.hideout.core.domain.model.timeline
enum class TimelineVisibility {
PRIVATE,
UNLISTED,
PUBLIC
}

View File

@ -0,0 +1,4 @@
package dev.usbharu.hideout.core.domain.model.timelinebuilder
class TimelineBuilder(val id: TimelineBuilderId, val timelineBuilderName: TimelineBuilderName) {
}

View File

@ -0,0 +1,5 @@
package dev.usbharu.hideout.core.domain.model.timelinebuilder
class TimelineBuilderId {
}

View File

@ -0,0 +1,4 @@
package dev.usbharu.hideout.core.domain.model.timelinebuilder
@JvmInline
value class TimelineBuilderName(val value: String)

View File

@ -0,0 +1,6 @@
package dev.usbharu.hideout.core.domain.model.timelinebuilder
interface TimelineBuilderRepository {
suspend fun save(timelineBuilder: TimelineBuilder): TimelineBuilder
suspend fun delete(timelineBuilder: TimelineBuilder)
}

View File

@ -0,0 +1,31 @@
package dev.usbharu.hideout.core.domain.model.timelineobject
import dev.usbharu.hideout.core.domain.model.actor.ActorId
import dev.usbharu.hideout.core.domain.model.emoji.EmojiId
import dev.usbharu.hideout.core.domain.model.media.MediaId
import dev.usbharu.hideout.core.domain.model.post.PostId
import dev.usbharu.hideout.core.domain.model.post.Visibility
import dev.usbharu.hideout.core.domain.model.timeline.TimelineId
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
import java.time.Instant
class TimelineObject(
val id: TimelineObjectId,
val userDetailId: UserDetailId,
val timelineId: TimelineId,
val postId: PostId,
val postActorId: ActorId,
val postCreatedAt: Instant,
val replyId: PostId?,
val repostId: PostId?,
val visibility: Visibility,
val isPureRepost: Boolean,
val mediaIds: List<MediaId>,
val emojiIds: List<EmojiId>,
val visibleActors: List<ActorId>,
val hasMedia: Boolean,
val hasMediaInRepost: Boolean,
val lastUpdatedAt: Instant,
val warnFilters: List<TimelineObjectWarnFilter>
) {
}

View File

@ -0,0 +1,4 @@
package dev.usbharu.hideout.core.domain.model.timelineobject
@JvmInline
value class TimelineObjectId(val value: Long)

View File

@ -0,0 +1,7 @@
package dev.usbharu.hideout.core.domain.model.timelineobject
import dev.usbharu.hideout.core.domain.model.filter.FilterId
class TimelineObjectWarnFilter(val filterId: FilterId, val matchedKeyword: String) {
}

View File

@ -0,0 +1,10 @@
package dev.usbharu.hideout.core.domain.model.timelinerelationship
import dev.usbharu.hideout.core.domain.model.actor.ActorId
import dev.usbharu.hideout.core.domain.model.instance.InstanceId
class TimelineRelationship(
val timelineRelationshipId: TimelineRelationshipId,
val actorId: ActorId?,
val instanceId: InstanceId?
)

View File

@ -0,0 +1,4 @@
package dev.usbharu.hideout.core.domain.model.timelinerelationship
@JvmInline
value class TimelineRelationshipId(val value: Long)

View File

@ -0,0 +1,6 @@
package dev.usbharu.hideout.core.domain.model.timelinerelationship
interface TimelineRelationshipRepository {
suspend fun save(timelineRelationship: TimelineRelationship): TimelineRelationship
suspend fun delete(timelineRelationship: TimelineRelationship)
}