refactor: ExposedActorRepository.ktにuri型を導入

This commit is contained in:
usbharu 2024-09-11 16:12:36 +09:00
parent 57430b7e4a
commit 554ce68c93
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 11 additions and 10 deletions

View File

@ -5,6 +5,7 @@ import dev.usbharu.hideout.core.domain.model.support.domain.Domain
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventPublisher
import dev.usbharu.hideout.core.domain.shared.repository.DomainEventPublishableRepository
import dev.usbharu.hideout.core.infrastructure.exposed.QueryMapper
import dev.usbharu.hideout.core.infrastructure.exposed.uri
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
import org.jetbrains.exposed.sql.javatime.timestamp
@ -30,15 +31,15 @@ class ExposedActorRepository(
it[domain] = actor.domain.domain
it[screenName] = actor.screenName.screenName
it[description] = actor.description.description
it[inbox] = actor.inbox.toString()
it[outbox] = actor.outbox.toString()
it[url] = actor.url.toString()
it[inbox] = actor.inbox
it[outbox] = actor.outbox
it[url] = actor.url
it[publicKey] = actor.publicKey.publicKey
it[privateKey] = actor.privateKey?.privateKey
it[createdAt] = actor.createdAt
it[keyId] = actor.keyId.keyId
it[following] = actor.followingEndpoint?.toString()
it[followers] = actor.followersEndpoint?.toString()
it[following] = actor.followingEndpoint
it[followers] = actor.followersEndpoint
it[instance] = actor.instance.instanceId
it[locked] = actor.locked
it[followingCount] = actor.followingCount?.relationshipCount
@ -126,15 +127,15 @@ object Actors : Table("actors") {
val domain = varchar("domain", Domain.LENGTH)
val screenName = varchar("screen_name", ActorScreenName.LENGTH)
val description = varchar("description", ActorDescription.LENGTH)
val inbox = varchar("inbox", 1000).uniqueIndex()
val outbox = varchar("outbox", 1000).uniqueIndex()
val url = varchar("url", 1000).uniqueIndex()
val inbox = uri("inbox", 1000).uniqueIndex()
val outbox = uri("outbox", 1000).uniqueIndex()
val url = uri("url", 1000).uniqueIndex()
val publicKey = varchar("public_key", 10000)
val privateKey = varchar("private_key", 100000).nullable()
val createdAt = timestamp("created_at")
val keyId = varchar("key_id", 1000)
val following = varchar("following", 1000).nullable()
val followers = varchar("followers", 1000).nullable()
val following = uri("following", 1000).nullable()
val followers = uri("followers", 1000).nullable()
val instance = long("instance").references(Instance.id)
val locked = bool("locked")
val followingCount = integer("following_count").nullable()