From ad11b072a84c936bcf6a2dfa3acadc9dad981e00 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 23 Sep 2023 00:14:40 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20Koin=E3=81=AE=E3=82=B3=E3=83=BC?= =?UTF-8?q?=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 --- src/main/kotlin/dev/usbharu/hideout/HideoutModule.kt | 8 -------- .../dev/usbharu/hideout/query/FollowerQueryServiceImpl.kt | 2 -- .../hideout/query/JwtRefreshTokenQueryServiceImpl.kt | 2 -- .../dev/usbharu/hideout/query/PostQueryServiceImpl.kt | 2 -- .../usbharu/hideout/query/PostResponseQueryServiceImpl.kt | 2 -- .../dev/usbharu/hideout/query/ReactionQueryServiceImpl.kt | 2 -- .../dev/usbharu/hideout/query/UserQueryServiceImpl.kt | 2 -- .../hideout/repository/JwtRefreshTokenRepositoryImpl.kt | 2 -- .../dev/usbharu/hideout/repository/MetaRepositoryImpl.kt | 2 -- .../dev/usbharu/hideout/repository/PostRepositoryImpl.kt | 2 -- .../usbharu/hideout/repository/ReactionRepositoryImpl.kt | 2 -- .../dev/usbharu/hideout/repository/UserRepositoryImpl.kt | 2 -- .../dev/usbharu/hideout/service/ap/APAcceptService.kt | 2 -- .../dev/usbharu/hideout/service/ap/APCreateService.kt | 2 -- .../dev/usbharu/hideout/service/ap/APLikeService.kt | 2 -- .../dev/usbharu/hideout/service/ap/APNoteService.kt | 2 -- .../dev/usbharu/hideout/service/ap/APReactionService.kt | 2 -- .../usbharu/hideout/service/ap/APReceiveFollowService.kt | 2 -- .../dev/usbharu/hideout/service/ap/APSendFollowService.kt | 2 -- .../kotlin/dev/usbharu/hideout/service/ap/APService.kt | 2 -- .../dev/usbharu/hideout/service/ap/APUndoService.kt | 2 -- .../dev/usbharu/hideout/service/ap/APUserService.kt | 2 -- .../dev/usbharu/hideout/service/api/PostApiService.kt | 2 -- .../dev/usbharu/hideout/service/api/UserApiService.kt | 2 -- .../dev/usbharu/hideout/service/api/UserAuthApiService.kt | 2 -- .../usbharu/hideout/service/api/WebFingerApiService.kt | 2 -- .../hideout/service/auth/HttpSignatureVerifyService.kt | 2 -- .../kotlin/dev/usbharu/hideout/service/auth/JwtService.kt | 2 -- .../usbharu/hideout/service/core/ExposedTransaction.kt | 2 -- .../dev/usbharu/hideout/service/core/MetaServiceImpl.kt | 2 -- .../hideout/service/core/ServerInitialiseServiceImpl.kt | 2 -- .../dev/usbharu/hideout/service/post/PostServiceImpl.kt | 2 -- .../hideout/service/reaction/ReactionServiceImpl.kt | 2 -- .../usbharu/hideout/service/user/UserAuthServiceImpl.kt | 2 -- .../dev/usbharu/hideout/service/user/UserServiceImpl.kt | 2 -- src/test/kotlin/dev/usbharu/hideout/Empty.kt | 6 ------ 36 files changed, 82 deletions(-) delete mode 100644 src/main/kotlin/dev/usbharu/hideout/HideoutModule.kt delete mode 100644 src/test/kotlin/dev/usbharu/hideout/Empty.kt diff --git a/src/main/kotlin/dev/usbharu/hideout/HideoutModule.kt b/src/main/kotlin/dev/usbharu/hideout/HideoutModule.kt deleted file mode 100644 index f91506f8..00000000 --- a/src/main/kotlin/dev/usbharu/hideout/HideoutModule.kt +++ /dev/null @@ -1,8 +0,0 @@ -package dev.usbharu.hideout - -import org.koin.core.annotation.ComponentScan -import org.koin.core.annotation.Module - -@Module -@ComponentScan -class HideoutModule diff --git a/src/main/kotlin/dev/usbharu/hideout/query/FollowerQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/FollowerQueryServiceImpl.kt index 831c715c..218d793c 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/FollowerQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/FollowerQueryServiceImpl.kt @@ -5,11 +5,9 @@ import dev.usbharu.hideout.repository.Users import dev.usbharu.hideout.repository.UsersFollowers import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository import java.time.Instant -@Single @Repository class FollowerQueryServiceImpl : FollowerQueryService { override suspend fun findFollowersById(id: Long): List { diff --git a/src/main/kotlin/dev/usbharu/hideout/query/JwtRefreshTokenQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/JwtRefreshTokenQueryServiceImpl.kt index ce217c42..a3d890ce 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/JwtRefreshTokenQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/JwtRefreshTokenQueryServiceImpl.kt @@ -9,10 +9,8 @@ import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.deleteAll import org.jetbrains.exposed.sql.deleteWhere import org.jetbrains.exposed.sql.select -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository -@Single @Repository class JwtRefreshTokenQueryServiceImpl : JwtRefreshTokenQueryService { override suspend fun findById(id: Long): JwtRefreshToken = diff --git a/src/main/kotlin/dev/usbharu/hideout/query/PostQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/PostQueryServiceImpl.kt index a3293b06..545c2bfd 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/PostQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/PostQueryServiceImpl.kt @@ -6,10 +6,8 @@ import dev.usbharu.hideout.repository.Posts import dev.usbharu.hideout.repository.toPost import dev.usbharu.hideout.util.singleOr import org.jetbrains.exposed.sql.select -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository -@Single @Repository class PostQueryServiceImpl : PostQueryService { override suspend fun findById(id: Long): Post = diff --git a/src/main/kotlin/dev/usbharu/hideout/query/PostResponseQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/PostResponseQueryServiceImpl.kt index ce350fc1..b359707d 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/PostResponseQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/PostResponseQueryServiceImpl.kt @@ -11,10 +11,8 @@ import org.jetbrains.exposed.sql.and import org.jetbrains.exposed.sql.innerJoin import org.jetbrains.exposed.sql.select import org.jetbrains.exposed.sql.selectAll -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository -@Single @Repository class PostResponseQueryServiceImpl : PostResponseQueryService { override suspend fun findById(id: Long, userId: Long?): PostResponse { diff --git a/src/main/kotlin/dev/usbharu/hideout/query/ReactionQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/ReactionQueryServiceImpl.kt index 9536ca61..4d9897d9 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/ReactionQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/ReactionQueryServiceImpl.kt @@ -10,10 +10,8 @@ import dev.usbharu.hideout.repository.toReaction import dev.usbharu.hideout.util.singleOr import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository -@Single @Repository class ReactionQueryServiceImpl : ReactionQueryService { override suspend fun findByPostId(postId: Long, userId: Long?): List { diff --git a/src/main/kotlin/dev/usbharu/hideout/query/UserQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/UserQueryServiceImpl.kt index fc2bc9b3..ef2e8cd6 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/UserQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/UserQueryServiceImpl.kt @@ -8,11 +8,9 @@ import dev.usbharu.hideout.util.singleOr import org.jetbrains.exposed.sql.and import org.jetbrains.exposed.sql.select import org.jetbrains.exposed.sql.selectAll -import org.koin.core.annotation.Single import org.slf4j.LoggerFactory import org.springframework.stereotype.Repository -@Single @Repository class UserQueryServiceImpl : UserQueryService { diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt index c1bf8ad3..234703e9 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt @@ -5,11 +5,9 @@ import dev.usbharu.hideout.service.core.IdGenerateService import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.transactions.transaction -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository import java.time.Instant -@Single @Repository class JwtRefreshTokenRepositoryImpl( private val database: Database, diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/MetaRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/MetaRepositoryImpl.kt index 543bb1fb..07200178 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/MetaRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/MetaRepositoryImpl.kt @@ -3,11 +3,9 @@ package dev.usbharu.hideout.repository import dev.usbharu.hideout.domain.model.hideout.entity.Jwt import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.transactions.transaction -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository import java.util.* -@Single @Repository class MetaRepositoryImpl(private val database: Database) : MetaRepository { diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt index 08998c15..08c7d279 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt @@ -7,10 +7,8 @@ import dev.usbharu.hideout.service.core.IdGenerateService import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.transactions.transaction -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository -@Single @Repository class PostRepositoryImpl(database: Database, private val idGenerateService: IdGenerateService) : PostRepository { diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/ReactionRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/ReactionRepositoryImpl.kt index 00f74d01..26fc3e52 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/ReactionRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/ReactionRepositoryImpl.kt @@ -6,10 +6,8 @@ import org.jetbrains.exposed.dao.id.LongIdTable import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.transactions.transaction -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository -@Single @Repository class ReactionRepositoryImpl( private val database: Database, diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/UserRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/UserRepositoryImpl.kt index c57a7ab7..8fdbebc1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/UserRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/UserRepositoryImpl.kt @@ -7,11 +7,9 @@ import org.jetbrains.exposed.dao.id.LongIdTable import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.transactions.transaction -import org.koin.core.annotation.Single import org.springframework.stereotype.Repository import java.time.Instant -@Single @Repository class UserRepositoryImpl(private val database: Database, private val idGenerateService: IdGenerateService) : UserRepository { diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APAcceptService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APAcceptService.kt index 9c3f10ed..3cf16f03 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APAcceptService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APAcceptService.kt @@ -10,7 +10,6 @@ import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.service.core.Transaction import dev.usbharu.hideout.service.user.UserService import io.ktor.http.* -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -18,7 +17,6 @@ interface APAcceptService { suspend fun receiveAccept(accept: Accept): ActivityPubResponse } -@Single @Service class APAcceptServiceImpl( private val userService: UserService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APCreateService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APCreateService.kt index 51ea4eee..91aecea4 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APCreateService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APCreateService.kt @@ -7,7 +7,6 @@ import dev.usbharu.hideout.domain.model.ap.Note import dev.usbharu.hideout.exception.ap.IllegalActivityPubObjectException import dev.usbharu.hideout.service.core.Transaction import io.ktor.http.* -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -15,7 +14,6 @@ interface APCreateService { suspend fun receiveCreate(create: Create): ActivityPubResponse } -@Single @Service class APCreateServiceImpl( private val apNoteService: APNoteService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APLikeService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APLikeService.kt index c98b8cfc..62a8e39e 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APLikeService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APLikeService.kt @@ -8,7 +8,6 @@ import dev.usbharu.hideout.query.PostQueryService import dev.usbharu.hideout.service.core.Transaction import dev.usbharu.hideout.service.reaction.ReactionService import io.ktor.http.* -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -16,7 +15,6 @@ interface APLikeService { suspend fun receiveLike(like: Like): ActivityPubResponse } -@Single @Service class APLikeServiceImpl( private val reactionService: ReactionService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt index b706c4fa..f569ef7e 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt @@ -19,7 +19,6 @@ import dev.usbharu.hideout.service.job.JobQueueParentService import io.ktor.client.* import io.ktor.client.statement.* import kjob.core.job.JobProps -import org.koin.core.annotation.Single import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.time.Instant @@ -34,7 +33,6 @@ interface APNoteService { suspend fun fetchNote(note: Note, targetActor: String? = null): Note } -@Single @Service class APNoteServiceImpl( private val httpClient: HttpClient, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APReactionService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APReactionService.kt index 78698512..ce201308 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APReactionService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APReactionService.kt @@ -14,7 +14,6 @@ import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.service.job.JobQueueParentService import io.ktor.client.* import kjob.core.job.JobProps -import org.koin.core.annotation.Single import org.springframework.stereotype.Service import java.time.Instant @@ -26,7 +25,6 @@ interface APReactionService { suspend fun removeReactionJob(props: JobProps) } -@Single @Service class APReactionServiceImpl( private val jobQueueParentService: JobQueueParentService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APReceiveFollowService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APReceiveFollowService.kt index 602a8740..867ff717 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APReceiveFollowService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APReceiveFollowService.kt @@ -15,7 +15,6 @@ import dev.usbharu.hideout.service.user.UserService import io.ktor.client.* import io.ktor.http.* import kjob.core.job.JobProps -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -24,7 +23,6 @@ interface APReceiveFollowService { suspend fun receiveFollowJob(props: JobProps) } -@Single @Service class APReceiveFollowServiceImpl( private val jobQueueParentService: JobQueueParentService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APSendFollowService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APSendFollowService.kt index ad67b955..ef8e526b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APSendFollowService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APSendFollowService.kt @@ -4,7 +4,6 @@ import dev.usbharu.hideout.domain.model.ap.Follow import dev.usbharu.hideout.domain.model.hideout.dto.SendFollowDto import dev.usbharu.hideout.plugins.postAp import io.ktor.client.* -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -12,7 +11,6 @@ interface APSendFollowService { suspend fun sendFollow(sendFollowDto: SendFollowDto) } -@Single @Service class APSendFollowServiceImpl(private val httpClient: HttpClient) : APSendFollowService { override suspend fun sendFollow(sendFollowDto: SendFollowDto) { diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APService.kt index 4c93439d..29b51e15 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APService.kt @@ -9,7 +9,6 @@ import dev.usbharu.hideout.domain.model.job.* import dev.usbharu.hideout.exception.JsonParseException import kjob.core.dsl.JobContextWithProps import kjob.core.job.JobProps -import org.koin.core.annotation.Single import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Service @@ -174,7 +173,6 @@ enum class ExtendedVocabulary { Emoji } -@Single @Service class APServiceImpl( private val apReceiveFollowService: APReceiveFollowService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APUndoService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APUndoService.kt index 03bb22f4..39c23be2 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APUndoService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APUndoService.kt @@ -8,7 +8,6 @@ import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.service.core.Transaction import dev.usbharu.hideout.service.user.UserService import io.ktor.http.* -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -16,7 +15,6 @@ interface APUndoService { suspend fun receiveUndo(undo: Undo): ActivityPubResponse } -@Single @Service @Suppress("UnsafeCallOnNullableType") class APUndoServiceImpl( diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APUserService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APUserService.kt index 6e6e11bc..4266db9d 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APUserService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APUserService.kt @@ -18,7 +18,6 @@ import io.ktor.client.* import io.ktor.client.request.* import io.ktor.client.statement.* import io.ktor.http.* -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -37,7 +36,6 @@ interface APUserService { suspend fun fetchPersonWithEntity(url: String, targetActor: String? = null): Pair } -@Single @Service class APUserServiceImpl( private val userService: UserService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/api/PostApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/PostApiService.kt index 71a904f0..92d2d292 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/PostApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/PostApiService.kt @@ -12,7 +12,6 @@ import dev.usbharu.hideout.service.core.Transaction import dev.usbharu.hideout.service.post.PostService import dev.usbharu.hideout.service.reaction.ReactionService import dev.usbharu.hideout.util.AcctUtil -import org.koin.core.annotation.Single import org.springframework.stereotype.Service import java.time.Instant @@ -45,7 +44,6 @@ interface PostApiService { suspend fun removeReaction(userId: Long, postId: Long) } -@Single @Service class PostApiServiceImpl( private val postService: PostService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt index 935cad11..5bc9df7a 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt @@ -9,7 +9,6 @@ import dev.usbharu.hideout.query.FollowerQueryService import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.service.core.Transaction import dev.usbharu.hideout.service.user.UserService -import org.koin.core.annotation.Single import org.springframework.stereotype.Service import kotlin.math.min @@ -38,7 +37,6 @@ interface UserApiService { suspend fun follow(targetAcct: Acct, sourceId: Long): Boolean } -@Single @Service class UserApiServiceImpl( private val userQueryService: UserQueryService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/api/UserAuthApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/UserAuthApiService.kt index fd8e64b3..d700f50e 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/UserAuthApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/UserAuthApiService.kt @@ -8,7 +8,6 @@ import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.service.auth.JwtService import dev.usbharu.hideout.service.core.Transaction import dev.usbharu.hideout.service.user.UserAuthServiceImpl -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -17,7 +16,6 @@ interface UserAuthApiService { suspend fun refreshToken(refreshToken: RefreshToken): JwtToken } -@Single @Service class UserAuthApiServiceImpl( private val userAuthService: UserAuthServiceImpl, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/api/WebFingerApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/WebFingerApiService.kt index f2ff9f81..e12a596c 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/WebFingerApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/WebFingerApiService.kt @@ -3,7 +3,6 @@ package dev.usbharu.hideout.service.api import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.service.core.Transaction -import org.koin.core.annotation.Single import org.springframework.stereotype.Service @Service @@ -11,7 +10,6 @@ interface WebFingerApiService { suspend fun findByNameAndDomain(name: String, domain: String): User } -@Single @Service class WebFingerApiServiceImpl(private val transaction: Transaction, private val userQueryService: UserQueryService) : WebFingerApiService { diff --git a/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyService.kt b/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyService.kt index e7697992..fd4a26c3 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyService.kt @@ -4,7 +4,6 @@ import dev.usbharu.hideout.plugins.KtorKeyMap import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.service.core.Transaction import io.ktor.http.* -import org.koin.core.annotation.Single import org.springframework.stereotype.Service import tech.barbero.http.message.signing.SignatureHeaderVerifier @@ -13,7 +12,6 @@ interface HttpSignatureVerifyService { fun verify(headers: Headers): Boolean } -@Single @Service class HttpSignatureVerifyServiceImpl( private val userQueryService: UserQueryService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/auth/JwtService.kt b/src/main/kotlin/dev/usbharu/hideout/service/auth/JwtService.kt index 53dc2ae4..f2985001 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/auth/JwtService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/auth/JwtService.kt @@ -14,7 +14,6 @@ import dev.usbharu.hideout.repository.JwtRefreshTokenRepository import dev.usbharu.hideout.service.core.MetaService import dev.usbharu.hideout.util.RsaUtil import kotlinx.coroutines.runBlocking -import org.koin.core.annotation.Single import org.springframework.stereotype.Service import java.time.Instant import java.time.temporal.ChronoUnit @@ -31,7 +30,6 @@ interface JwtService { } @Suppress("InjectDispatcher") -@Single @Service class JwtServiceImpl( private val metaService: MetaService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/core/ExposedTransaction.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/ExposedTransaction.kt index 283fa7c8..54252131 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/core/ExposedTransaction.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/ExposedTransaction.kt @@ -1,10 +1,8 @@ package dev.usbharu.hideout.service.core import org.jetbrains.exposed.sql.transactions.experimental.newSuspendedTransaction -import org.koin.core.annotation.Single import org.springframework.stereotype.Service -@Single @Service class ExposedTransaction : Transaction { override suspend fun transaction(block: suspend () -> T): T { diff --git a/src/main/kotlin/dev/usbharu/hideout/service/core/MetaServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/MetaServiceImpl.kt index 1492c7a8..cab68f79 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/core/MetaServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/MetaServiceImpl.kt @@ -4,10 +4,8 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Jwt import dev.usbharu.hideout.domain.model.hideout.entity.Meta import dev.usbharu.hideout.exception.NotInitException import dev.usbharu.hideout.repository.MetaRepository -import org.koin.core.annotation.Single import org.springframework.stereotype.Service -@Single @Service class MetaServiceImpl(private val metaRepository: MetaRepository, private val transaction: Transaction) : MetaService { diff --git a/src/main/kotlin/dev/usbharu/hideout/service/core/ServerInitialiseServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/ServerInitialiseServiceImpl.kt index 2917b15b..fa3d1b9b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/core/ServerInitialiseServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/ServerInitialiseServiceImpl.kt @@ -4,14 +4,12 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Jwt import dev.usbharu.hideout.domain.model.hideout.entity.Meta import dev.usbharu.hideout.repository.MetaRepository import dev.usbharu.hideout.util.ServerUtil -import org.koin.core.annotation.Single import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.security.KeyPairGenerator import java.util.* -@Single @Service class ServerInitialiseServiceImpl( private val metaRepository: MetaRepository, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt index 2e81aeef..0ba6b536 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt @@ -6,12 +6,10 @@ import dev.usbharu.hideout.exception.UserNotFoundException import dev.usbharu.hideout.repository.PostRepository import dev.usbharu.hideout.repository.UserRepository import dev.usbharu.hideout.service.ap.APNoteService -import org.koin.core.annotation.Single import org.springframework.stereotype.Service import java.time.Instant @Service -@Single class PostServiceImpl( private val postRepository: PostRepository, private val userRepository: UserRepository, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/reaction/ReactionServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/reaction/ReactionServiceImpl.kt index cc822a18..312c182b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/reaction/ReactionServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/reaction/ReactionServiceImpl.kt @@ -4,10 +4,8 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Reaction import dev.usbharu.hideout.query.ReactionQueryService import dev.usbharu.hideout.repository.ReactionRepository import dev.usbharu.hideout.service.ap.APReactionService -import org.koin.core.annotation.Single import org.springframework.stereotype.Service -@Single @Service class ReactionServiceImpl( private val reactionRepository: ReactionRepository, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/user/UserAuthServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/user/UserAuthServiceImpl.kt index 547aa367..3c0a2ffe 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/user/UserAuthServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/user/UserAuthServiceImpl.kt @@ -2,13 +2,11 @@ package dev.usbharu.hideout.service.user import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.query.UserQueryService -import org.koin.core.annotation.Single import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder import org.springframework.stereotype.Service import java.security.* import java.util.* -@Single @Service class UserAuthServiceImpl( val userQueryService: UserQueryService diff --git a/src/main/kotlin/dev/usbharu/hideout/service/user/UserServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/user/UserServiceImpl.kt index 22cc6001..d3611586 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/user/UserServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/user/UserServiceImpl.kt @@ -10,11 +10,9 @@ import dev.usbharu.hideout.query.FollowerQueryService import dev.usbharu.hideout.query.UserQueryService import dev.usbharu.hideout.repository.UserRepository import dev.usbharu.hideout.service.ap.APSendFollowService -import org.koin.core.annotation.Single import org.springframework.stereotype.Service import java.time.Instant -@Single @Service class UserServiceImpl( private val userRepository: UserRepository, diff --git a/src/test/kotlin/dev/usbharu/hideout/Empty.kt b/src/test/kotlin/dev/usbharu/hideout/Empty.kt deleted file mode 100644 index c5282364..00000000 --- a/src/test/kotlin/dev/usbharu/hideout/Empty.kt +++ /dev/null @@ -1,6 +0,0 @@ -package dev.usbharu.hideout - -import io.ktor.server.application.* - -fun Application.empty() { -}