From ba743d3a365d9c7d749bd23499166e45ad7ce851 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Thu, 10 Aug 2023 20:08:56 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hideout/repository/IPostRepository.kt | 1 - .../hideout/repository/PostRepositoryImpl.kt | 39 ------------------- 2 files changed, 40 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/IPostRepository.kt b/src/main/kotlin/dev/usbharu/hideout/repository/IPostRepository.kt index 9b331370..4e135f70 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/IPostRepository.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/IPostRepository.kt @@ -10,6 +10,5 @@ interface IPostRepository { suspend fun findByUrl(url: String): Post? suspend fun delete(id: Long) - suspend fun findByApId(id: String): Post? } diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt index 12156818..c8a327d9 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt @@ -9,7 +9,6 @@ import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.transactions.experimental.newSuspendedTransaction import org.jetbrains.exposed.sql.transactions.transaction import org.koin.core.annotation.Single -import java.time.Instant @Single class PostRepositoryImpl(database: Database, private val idGenerateService: IdGenerateService) : IPostRepository { @@ -80,44 +79,6 @@ class PostRepositoryImpl(database: Database, private val idGenerateService: IdGe } } - override suspend fun findAll( - since: Instant?, - until: Instant?, - minId: Long?, - maxId: Long?, - limit: Int?, - userId: Long? - ): List { - return query { - Posts.select { Posts.visibility eq Visibility.PUBLIC.ordinal }.map { it.toPost() } - } - } - - override suspend fun findByUserNameAndDomain( - username: String, - s: String, - since: Instant?, - until: Instant?, - minId: Long?, - maxId: Long?, - limit: Int?, - userId: Long? - ): List { - TODO("Not yet implemented") - } - - override suspend fun findByUserId( - idOrNull: Long, - since: Instant?, - until: Instant?, - minId: Long?, - maxId: Long?, - limit: Int?, - userId: Long? - ): List { - TODO("Not yet implemented") - } - override suspend fun findByApId(id: String): Post? { return query { Posts.select { Posts.apId eq id }.singleOrNull()?.toPost()