mirror of https://github.com/usbharu/Hideout.git
refactor: 不要なコードを削除
This commit is contained in:
parent
cff8640b86
commit
ba743d3a36
|
@ -10,6 +10,5 @@ interface IPostRepository {
|
||||||
suspend fun findByUrl(url: String): Post?
|
suspend fun findByUrl(url: String): Post?
|
||||||
suspend fun delete(id: Long)
|
suspend fun delete(id: Long)
|
||||||
|
|
||||||
|
|
||||||
suspend fun findByApId(id: String): Post?
|
suspend fun findByApId(id: String): Post?
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.experimental.newSuspendedTransaction
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
import org.koin.core.annotation.Single
|
import org.koin.core.annotation.Single
|
||||||
import java.time.Instant
|
|
||||||
|
|
||||||
@Single
|
@Single
|
||||||
class PostRepositoryImpl(database: Database, private val idGenerateService: IdGenerateService) : IPostRepository {
|
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<Post> {
|
|
||||||
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<Post> {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun findByUserId(
|
|
||||||
idOrNull: Long,
|
|
||||||
since: Instant?,
|
|
||||||
until: Instant?,
|
|
||||||
minId: Long?,
|
|
||||||
maxId: Long?,
|
|
||||||
limit: Int?,
|
|
||||||
userId: Long?
|
|
||||||
): List<Post> {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun findByApId(id: String): Post? {
|
override suspend fun findByApId(id: String): Post? {
|
||||||
return query {
|
return query {
|
||||||
Posts.select { Posts.apId eq id }.singleOrNull()?.toPost()
|
Posts.select { Posts.apId eq id }.singleOrNull()?.toPost()
|
||||||
|
|
Loading…
Reference in New Issue