mirror of https://github.com/usbharu/Hideout.git
fix: 削除されていなかった実装を削除
This commit is contained in:
parent
bf4d694aa2
commit
fddc29bdfd
|
@ -1,18 +0,0 @@
|
|||
package dev.usbharu.hideout.core.infrastructure.exposedquery
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.deletedActor.DeletedActor
|
||||
import dev.usbharu.hideout.core.infrastructure.exposedrepository.DeletedActors
|
||||
import dev.usbharu.hideout.core.infrastructure.exposedrepository.toDeletedActor
|
||||
import org.jetbrains.exposed.sql.and
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.springframework.stereotype.Repository
|
||||
|
||||
@Repository
|
||||
class DeletedActorQueryServiceImpl : DeletedActorQueryService {
|
||||
override suspend fun findByNameAndDomain(name: String, domain: String): DeletedActor? {
|
||||
return DeletedActors
|
||||
.select { DeletedActors.name eq name and (DeletedActors.domain eq domain) }
|
||||
.singleOrNull()
|
||||
?.toDeletedActor()
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package dev.usbharu.hideout.core.infrastructure.exposedquery
|
||||
|
||||
import dev.usbharu.hideout.core.infrastructure.exposedrepository.Instance
|
||||
import dev.usbharu.hideout.core.infrastructure.exposedrepository.toInstance
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.springframework.stereotype.Repository
|
||||
import dev.usbharu.hideout.core.domain.model.instance.Instance as InstanceEntity
|
||||
|
||||
@Repository
|
||||
class InstanceQueryServiceImpl : InstanceQueryService {
|
||||
override suspend fun findByUrl(url: String): InstanceEntity? = Instance.select { Instance.url eq url }
|
||||
.singleOrNull()?.toInstance()
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package dev.usbharu.hideout.core.infrastructure.exposedquery
|
||||
|
||||
import dev.usbharu.hideout.core.infrastructure.exposedrepository.Media
|
||||
import dev.usbharu.hideout.core.infrastructure.exposedrepository.toMedia
|
||||
import org.jetbrains.exposed.sql.select
|
||||
import org.springframework.stereotype.Repository
|
||||
import dev.usbharu.hideout.core.domain.model.media.Media as MediaEntity
|
||||
|
||||
@Repository
|
||||
class MediaQueryServiceImpl : MediaQueryService {
|
||||
|
||||
override suspend fun findByRemoteUrl(remoteUrl: String): MediaEntity? {
|
||||
return Media.select { Media.remoteUrl eq remoteUrl }.forUpdate()
|
||||
.singleOrNull()
|
||||
?.toMedia()
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package dev.usbharu.hideout.core.infrastructure.exposedquery
|
||||
|
||||
import org.springframework.stereotype.Repository
|
||||
|
||||
@Repository
|
||||
class ReactionQueryServiceImpl : ReactionQueryService {
|
||||
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package dev.usbharu.hideout.core.infrastructure.exposedquery
|
||||
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class RelationshipQueryServiceImpl : RelationshipQueryService {
|
||||
|
||||
}
|
|
@ -38,9 +38,17 @@ class DeletedActorRepositoryImpl : DeletedActorRepository, AbstractRepository()
|
|||
}
|
||||
|
||||
override suspend fun findById(id: Long): DeletedActor? = query {
|
||||
return@query DeletedActors.select { DeletedActors.id eq id }
|
||||
return@query DeletedActors
|
||||
.select { DeletedActors.id eq id }
|
||||
.singleOrNull()
|
||||
?.let { it.toDeletedActor() }
|
||||
?.toDeletedActor()
|
||||
}
|
||||
|
||||
override suspend fun findByNameAndDomain(name: String, domain: String): DeletedActor? = query {
|
||||
return@query DeletedActors
|
||||
.select { DeletedActors.name eq name and (DeletedActors.domain eq domain) }
|
||||
.singleOrNull()
|
||||
?.toDeletedActor()
|
||||
}
|
||||
|
||||
override val logger: Logger
|
||||
|
|
|
@ -54,6 +54,10 @@ class InstanceRepositoryImpl(private val idGenerateService: IdGenerateService) :
|
|||
override suspend fun delete(instance: InstanceEntity) {
|
||||
Instance.deleteWhere { id eq instance.id }
|
||||
}
|
||||
|
||||
override suspend fun findByUrl(url: String): dev.usbharu.hideout.core.domain.model.instance.Instance? {
|
||||
return Instance.select { Instance.url eq url }.singleOrNull()?.toInstance()
|
||||
}
|
||||
}
|
||||
|
||||
fun ResultRow.toInstance(): InstanceEntity {
|
||||
|
|
|
@ -59,6 +59,10 @@ class MediaRepositoryImpl(private val idGenerateService: IdGenerateService) : Me
|
|||
Media.id eq id
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun findByRemoteUrl(remoteUrl: String): dev.usbharu.hideout.core.domain.model.media.Media? {
|
||||
return Media.select { Media.remoteUrl eq remoteUrl }.singleOrNull()?.toMedia()
|
||||
}
|
||||
}
|
||||
|
||||
fun ResultRow.toMedia(): EntityMedia {
|
||||
|
|
|
@ -70,8 +70,7 @@ class AccountApiServiceImpl(
|
|||
private val statusQueryService: StatusQueryService,
|
||||
private val relationshipService: RelationshipService,
|
||||
private val relationshipRepository: RelationshipRepository,
|
||||
private val mediaService: MediaService,
|
||||
private val relationshipQueryService: RelationshipQueryService
|
||||
private val mediaService: MediaService
|
||||
) :
|
||||
AccountApiService {
|
||||
override suspend fun accountsStatuses(
|
||||
|
|
Loading…
Reference in New Issue