From b070b8c71d69c3f4464d7251203277f63bff909d Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Thu, 21 Dec 2023 19:13:36 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Actor=E3=81=AB=E7=B5=B5=E6=96=87?= =?UTF-8?q?=E5=AD=97=E6=83=85=E5=A0=B1=E3=82=92=E5=90=AB=E3=82=81=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=8C=E5=8F=AF=E8=83=BD=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usbharu/hideout/core/domain/model/actor/Actor.kt | 12 ++++++++---- .../exposedrepository/ActorRepositoryImpl.kt | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt index 0377df95..39344589 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/actor/Actor.kt @@ -26,7 +26,8 @@ data class Actor private constructor( val followersCount: Int = 0, val followingCount: Int = 0, val postsCount: Int = 0, - val lastPostDate: Instant? = null + val lastPostDate: Instant? = null, + val emojis: List = emptyList() ) { @Component @@ -55,7 +56,8 @@ data class Actor private constructor( followersCount: Int = 0, followingCount: Int = 0, postsCount: Int = 0, - lastPostDate: Instant? = null + lastPostDate: Instant? = null, + emojis: List = emptyList() ): Actor { if (id == 0L) { return Actor( @@ -78,7 +80,8 @@ data class Actor private constructor( followersCount = followersCount, followingCount = followingCount, postsCount = postsCount, - lastPostDate = lastPostDate + lastPostDate = lastPostDate, + emojis = emojis ) } @@ -188,7 +191,8 @@ data class Actor private constructor( followersCount = followersCount, followingCount = followingCount, postsCount = postsCount, - lastPostDate = lastPostDate + lastPostDate = lastPostDate, + emojis = emojis ) } } diff --git a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ActorRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ActorRepositoryImpl.kt index f4a70693..e0d7eca2 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ActorRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ActorRepositoryImpl.kt @@ -45,6 +45,7 @@ class ActorRepositoryImpl( it[followingCount] = actor.followingCount it[postsCount] = actor.postsCount it[lastPostAt] = actor.lastPostDate + it[emojis] = actor.emojis.joinToString(",") } } else { Actors.update({ Actors.id eq actor.id }) { @@ -67,6 +68,7 @@ class ActorRepositoryImpl( it[followingCount] = actor.followingCount it[postsCount] = actor.postsCount it[lastPostAt] = actor.lastPostDate + it[emojis] = actor.emojis.joinToString(",") } } return@query actor @@ -152,7 +154,7 @@ object Actors : Table("actors") { val followersCount = integer("followers_count") val postsCount = integer("posts_count") val lastPostAt = timestamp("last_post_at").nullable() - + val emojis = varchar("emojis", 3000) override val primaryKey: PrimaryKey = PrimaryKey(id) init {