mirror of https://github.com/usbharu/Hideout.git
refactor: ExposedActorRepository.ktにuri型を導入2
This commit is contained in:
parent
8e43427f15
commit
404ca6c531
|
@ -24,7 +24,6 @@ import dev.usbharu.hideout.core.domain.model.support.domain.Domain
|
||||||
import dev.usbharu.hideout.core.infrastructure.exposedrepository.Actors
|
import dev.usbharu.hideout.core.infrastructure.exposedrepository.Actors
|
||||||
import org.jetbrains.exposed.sql.ResultRow
|
import org.jetbrains.exposed.sql.ResultRow
|
||||||
import org.springframework.stereotype.Component
|
import org.springframework.stereotype.Component
|
||||||
import java.net.URI
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
class ActorResultRowMapper : ResultRowMapper<Actor> {
|
class ActorResultRowMapper : ResultRowMapper<Actor> {
|
||||||
|
@ -35,15 +34,15 @@ class ActorResultRowMapper : ResultRowMapper<Actor> {
|
||||||
domain = Domain(resultRow[Actors.domain]),
|
domain = Domain(resultRow[Actors.domain]),
|
||||||
screenName = ActorScreenName(resultRow[Actors.screenName]),
|
screenName = ActorScreenName(resultRow[Actors.screenName]),
|
||||||
description = ActorDescription(resultRow[Actors.description]),
|
description = ActorDescription(resultRow[Actors.description]),
|
||||||
inbox = URI.create(resultRow[Actors.inbox]),
|
inbox = resultRow[Actors.inbox],
|
||||||
outbox = URI.create(resultRow[Actors.outbox]),
|
outbox = resultRow[Actors.outbox],
|
||||||
url = URI.create(resultRow[Actors.url]),
|
url = resultRow[Actors.url],
|
||||||
publicKey = ActorPublicKey(resultRow[Actors.publicKey]),
|
publicKey = ActorPublicKey(resultRow[Actors.publicKey]),
|
||||||
privateKey = resultRow[Actors.privateKey]?.let { ActorPrivateKey(it) },
|
privateKey = resultRow[Actors.privateKey]?.let { ActorPrivateKey(it) },
|
||||||
createdAt = resultRow[Actors.createdAt],
|
createdAt = resultRow[Actors.createdAt],
|
||||||
keyId = ActorKeyId(resultRow[Actors.keyId]),
|
keyId = ActorKeyId(resultRow[Actors.keyId]),
|
||||||
followersEndpoint = resultRow[Actors.followers]?.let { URI.create(it) },
|
followersEndpoint = resultRow[Actors.followers],
|
||||||
followingEndpoint = resultRow[Actors.following]?.let { URI.create(it) },
|
followingEndpoint = resultRow[Actors.following],
|
||||||
instance = InstanceId(resultRow[Actors.instance]),
|
instance = InstanceId(resultRow[Actors.instance]),
|
||||||
locked = resultRow[Actors.locked],
|
locked = resultRow[Actors.locked],
|
||||||
followersCount = resultRow[Actors.followersCount]?.let { ActorRelationshipCount(it) },
|
followersCount = resultRow[Actors.followersCount]?.let { ActorRelationshipCount(it) },
|
||||||
|
|
|
@ -90,7 +90,7 @@ class ExposedUserTimelineQueryService : UserTimelineQueryService, AbstractReposi
|
||||||
name = it[Actors.name],
|
name = it[Actors.name],
|
||||||
domain = it[Actors.domain],
|
domain = it[Actors.domain],
|
||||||
screenName = it[Actors.screenName],
|
screenName = it[Actors.screenName],
|
||||||
url = URI.create(it[Actors.url]),
|
url = it[Actors.url],
|
||||||
locked = it[Actors.locked],
|
locked = it[Actors.locked],
|
||||||
icon = it.getOrNull(iconMedia[Media.url])
|
icon = it.getOrNull(iconMedia[Media.url])
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue