From 51225c91befb3dae4d70e05622ba4dd60e291f71 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 3 Jun 2023 11:28:05 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20service=E3=81=AE=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=82=92=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/dev/usbharu/hideout/Application.kt | 13 ++++++++++--- .../dev/usbharu/hideout/plugins/ActivityPub.kt | 2 +- .../kotlin/dev/usbharu/hideout/plugins/Routing.kt | 8 ++++---- .../kotlin/dev/usbharu/hideout/plugins/Security.kt | 6 +++--- .../repository/JwtRefreshTokenRepositoryImpl.kt | 6 +++--- .../hideout/repository/PostRepositoryImpl.kt | 2 +- .../usbharu/hideout/repository/UserRepository.kt | 2 +- .../dev/usbharu/hideout/routing/RegisterRouting.kt | 2 +- .../hideout/routing/activitypub/InboxRouting.kt | 2 +- .../hideout/routing/activitypub/UserRouting.kt | 2 +- .../hideout/routing/api/internal/v1/Posts.kt | 2 +- .../hideout/routing/api/internal/v1/Users.kt | 4 ++-- .../hideout/routing/api/mastodon/v1/Statuses.kt | 2 +- .../hideout/routing/wellknown/WebfingerRouting.kt | 2 +- .../activitypub/ActivityPubAcceptServiceImpl.kt | 2 +- .../activitypub/ActivityPubNoteServiceImpl.kt | 2 +- .../ActivityPubReceiveFollowServiceImpl.kt | 2 +- .../activitypub/ActivityPubUndoServiceImpl.kt | 2 +- .../activitypub/ActivityPubUserServiceImpl.kt | 2 +- .../hideout/service/{ => api}/IUserApiService.kt | 2 +- .../hideout/service/{ => api}/UserApiServiceImpl.kt | 4 ++-- .../HttpSignatureVerifyService.kt | 2 +- .../HttpSignatureVerifyServiceImpl.kt | 2 +- .../hideout/service/{ => auth}/IJwtService.kt | 2 +- .../hideout/service/{ => auth}/JwtServiceImpl.kt | 5 +++-- .../hideout/service/{ => core}/IMetaService.kt | 2 +- .../service/{ => core}/IServerInitialiseService.kt | 2 +- .../hideout/service/{ => core}/IdGenerateService.kt | 2 +- .../hideout/service/{ => core}/MetaServiceImpl.kt | 2 +- .../{ => core}/ServerInitialiseServiceImpl.kt | 2 +- .../{ => core}/SnowflakeIdGenerateService.kt | 2 +- .../{ => core}/TwitterSnowflakeIdGenerateService.kt | 2 +- .../hideout/service/{ => post}/IPostService.kt | 2 +- .../hideout/service/{impl => post}/PostService.kt | 4 ++-- .../hideout/service/{ => user}/IUserAuthService.kt | 2 +- .../hideout/service/{impl => user}/IUserService.kt | 2 +- .../service/{impl => user}/UserAuthService.kt | 3 +-- .../hideout/service/{impl => user}/UserService.kt | 3 +-- .../usbharu/hideout/plugins/ActivityPubKtTest.kt | 2 +- .../dev/usbharu/hideout/plugins/KtorKeyMapTest.kt | 2 +- .../dev/usbharu/hideout/plugins/SecurityKtTest.kt | 6 +++--- .../repository/JwtRefreshTokenRepositoryImplTest.kt | 2 +- .../hideout/repository/UserRepositoryTest.kt | 2 +- .../routing/activitypub/InboxRoutingKtTest.kt | 4 ++-- .../hideout/routing/activitypub/UsersAPTest.kt | 2 +- .../hideout/routing/api/internal/v1/PostsTest.kt | 2 +- .../hideout/routing/api/internal/v1/UsersTest.kt | 4 ++-- .../usbharu/hideout/service/JwtServiceImplTest.kt | 4 +++- .../usbharu/hideout/service/MetaServiceImplTest.kt | 1 + .../service/ServerInitialiseServiceImplTest.kt | 1 + .../TwitterSnowflakeIdGenerateServiceTest.kt | 1 + .../activitypub/ActivityPubNoteServiceImplTest.kt | 2 +- .../ActivityPubReceiveFollowServiceImplTest.kt | 2 +- .../usbharu/hideout/service/impl/PostServiceTest.kt | 3 ++- .../usbharu/hideout/service/impl/UserServiceTest.kt | 4 +++- 55 files changed, 85 insertions(+), 71 deletions(-) rename src/main/kotlin/dev/usbharu/hideout/service/{ => api}/IUserApiService.kt (94%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => api}/UserApiServiceImpl.kt (94%) rename src/main/kotlin/dev/usbharu/hideout/service/{signature => auth}/HttpSignatureVerifyService.kt (69%) rename src/main/kotlin/dev/usbharu/hideout/service/{signature => auth}/HttpSignatureVerifyServiceImpl.kt (95%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => auth}/IJwtService.kt (91%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => auth}/JwtServiceImpl.kt (95%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => core}/IMetaService.kt (86%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => core}/IServerInitialiseService.kt (60%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => core}/IdGenerateService.kt (62%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => core}/MetaServiceImpl.kt (93%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => core}/ServerInitialiseServiceImpl.kt (98%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => core}/SnowflakeIdGenerateService.kt (97%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => core}/TwitterSnowflakeIdGenerateService.kt (77%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => post}/IPostService.kt (97%) rename src/main/kotlin/dev/usbharu/hideout/service/{impl => post}/PostService.kt (97%) rename src/main/kotlin/dev/usbharu/hideout/service/{ => user}/IUserAuthService.kt (87%) rename src/main/kotlin/dev/usbharu/hideout/service/{impl => user}/IUserService.kt (97%) rename src/main/kotlin/dev/usbharu/hideout/service/{impl => user}/UserAuthService.kt (94%) rename src/main/kotlin/dev/usbharu/hideout/service/{impl => user}/UserService.kt (98%) diff --git a/src/main/kotlin/dev/usbharu/hideout/Application.kt b/src/main/kotlin/dev/usbharu/hideout/Application.kt index 7b3c4fbf..c8bfc06e 100644 --- a/src/main/kotlin/dev/usbharu/hideout/Application.kt +++ b/src/main/kotlin/dev/usbharu/hideout/Application.kt @@ -12,13 +12,20 @@ import dev.usbharu.hideout.domain.model.job.ReceiveFollowJob import dev.usbharu.hideout.plugins.* import dev.usbharu.hideout.repository.IUserRepository import dev.usbharu.hideout.routing.register -import dev.usbharu.hideout.service.* import dev.usbharu.hideout.service.activitypub.ActivityPubService import dev.usbharu.hideout.service.activitypub.ActivityPubUserService -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.api.IUserApiService +import dev.usbharu.hideout.service.auth.HttpSignatureVerifyService +import dev.usbharu.hideout.service.auth.IJwtService +import dev.usbharu.hideout.service.core.IMetaService +import dev.usbharu.hideout.service.core.IServerInitialiseService +import dev.usbharu.hideout.service.core.IdGenerateService +import dev.usbharu.hideout.service.core.TwitterSnowflakeIdGenerateService import dev.usbharu.hideout.service.job.JobQueueParentService import dev.usbharu.hideout.service.job.KJobJobQueueParentService -import dev.usbharu.hideout.service.signature.HttpSignatureVerifyService +import dev.usbharu.hideout.service.post.IPostService +import dev.usbharu.hideout.service.user.IUserAuthService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.kjob.exposed.ExposedKJob import io.ktor.client.* import io.ktor.client.engine.cio.* diff --git a/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt b/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt index 1a720bf9..f2eb9f85 100644 --- a/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt +++ b/src/main/kotlin/dev/usbharu/hideout/plugins/ActivityPub.kt @@ -3,7 +3,7 @@ package dev.usbharu.hideout.plugins import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.domain.model.ap.JsonLd import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.impl.UserAuthService +import dev.usbharu.hideout.service.user.UserAuthService import dev.usbharu.hideout.util.HttpUtil.Activity import io.ktor.client.* import io.ktor.client.plugins.api.* diff --git a/src/main/kotlin/dev/usbharu/hideout/plugins/Routing.kt b/src/main/kotlin/dev/usbharu/hideout/plugins/Routing.kt index 2e0c6b1a..a424a5fa 100644 --- a/src/main/kotlin/dev/usbharu/hideout/plugins/Routing.kt +++ b/src/main/kotlin/dev/usbharu/hideout/plugins/Routing.kt @@ -7,12 +7,12 @@ import dev.usbharu.hideout.routing.api.internal.v1.posts import dev.usbharu.hideout.routing.api.internal.v1.users import dev.usbharu.hideout.routing.api.mastodon.v1.statuses import dev.usbharu.hideout.routing.wellknown.webfinger -import dev.usbharu.hideout.service.IPostService -import dev.usbharu.hideout.service.IUserApiService import dev.usbharu.hideout.service.activitypub.ActivityPubService import dev.usbharu.hideout.service.activitypub.ActivityPubUserService -import dev.usbharu.hideout.service.impl.IUserService -import dev.usbharu.hideout.service.signature.HttpSignatureVerifyService +import dev.usbharu.hideout.service.api.IUserApiService +import dev.usbharu.hideout.service.auth.HttpSignatureVerifyService +import dev.usbharu.hideout.service.post.IPostService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.server.application.* import io.ktor.server.plugins.autohead.* import io.ktor.server.routing.* diff --git a/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt b/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt index b6170270..a98eee18 100644 --- a/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt +++ b/src/main/kotlin/dev/usbharu/hideout/plugins/Security.kt @@ -6,9 +6,9 @@ import dev.usbharu.hideout.domain.model.hideout.form.RefreshToken import dev.usbharu.hideout.domain.model.hideout.form.UserLogin import dev.usbharu.hideout.exception.UserNotFoundException import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.IJwtService -import dev.usbharu.hideout.service.IMetaService -import dev.usbharu.hideout.service.IUserAuthService +import dev.usbharu.hideout.service.auth.IJwtService +import dev.usbharu.hideout.service.core.IMetaService +import dev.usbharu.hideout.service.user.IUserAuthService import dev.usbharu.hideout.util.JsonWebKeyUtil import io.ktor.http.* import io.ktor.server.application.* diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt index fccc8c38..32657d10 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImpl.kt @@ -1,7 +1,7 @@ package dev.usbharu.hideout.repository import dev.usbharu.hideout.domain.model.hideout.entity.JwtRefreshToken -import dev.usbharu.hideout.service.IdGenerateService +import dev.usbharu.hideout.service.core.IdGenerateService import kotlinx.coroutines.Dispatchers import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq @@ -71,7 +71,7 @@ class JwtRefreshTokenRepositoryImpl( override suspend fun delete(token: JwtRefreshToken) { return query { - JwtRefreshTokens.deleteWhere { JwtRefreshTokens.id eq token.id } + JwtRefreshTokens.deleteWhere { id eq token.id } } } @@ -83,7 +83,7 @@ class JwtRefreshTokenRepositoryImpl( override suspend fun deleteByToken(token: String) { return query { - JwtRefreshTokens.deleteWhere { JwtRefreshTokens.refreshToken eq token } + JwtRefreshTokens.deleteWhere { refreshToken eq token } } } diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt index 2d7d59a1..b547f446 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt @@ -2,7 +2,7 @@ package dev.usbharu.hideout.repository import dev.usbharu.hideout.domain.model.hideout.entity.Post import dev.usbharu.hideout.domain.model.hideout.entity.Visibility -import dev.usbharu.hideout.service.IdGenerateService +import dev.usbharu.hideout.service.core.IdGenerateService import kotlinx.coroutines.Dispatchers import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt b/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt index 6bfa4449..9bc60ffd 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt @@ -1,7 +1,7 @@ package dev.usbharu.hideout.repository import dev.usbharu.hideout.domain.model.hideout.entity.User -import dev.usbharu.hideout.service.IdGenerateService +import dev.usbharu.hideout.service.core.IdGenerateService import kotlinx.coroutines.Dispatchers import org.jetbrains.exposed.dao.id.LongIdTable import org.jetbrains.exposed.sql.* diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/RegisterRouting.kt b/src/main/kotlin/dev/usbharu/hideout/routing/RegisterRouting.kt index 28468a66..ced130c3 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/RegisterRouting.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/RegisterRouting.kt @@ -1,7 +1,7 @@ package dev.usbharu.hideout.routing import dev.usbharu.hideout.domain.model.hideout.dto.UserCreateDto -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.http.* import io.ktor.server.application.* import io.ktor.server.auth.* diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRouting.kt b/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRouting.kt index ea646104..92a216bb 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRouting.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRouting.kt @@ -4,7 +4,7 @@ import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.domain.model.ActivityPubObjectResponse import dev.usbharu.hideout.domain.model.ActivityPubStringResponse import dev.usbharu.hideout.exception.HttpSignatureVerifyException -import dev.usbharu.hideout.service.signature.HttpSignatureVerifyService +import dev.usbharu.hideout.service.auth.HttpSignatureVerifyService import io.ktor.http.* import io.ktor.server.application.* import io.ktor.server.request.* diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt b/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt index a22dc3cc..deca6e5e 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt @@ -3,7 +3,7 @@ package dev.usbharu.hideout.routing.activitypub import dev.usbharu.hideout.exception.ParameterNotExistException import dev.usbharu.hideout.plugins.respondAp import dev.usbharu.hideout.service.activitypub.ActivityPubUserService -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.util.HttpUtil.Activity import dev.usbharu.hideout.util.HttpUtil.JsonLd import io.ktor.http.* diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Posts.kt b/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Posts.kt index e91c5b93..34772aff 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Posts.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Posts.kt @@ -6,7 +6,7 @@ import dev.usbharu.hideout.domain.model.hideout.form.Post import dev.usbharu.hideout.exception.ParameterNotExistException import dev.usbharu.hideout.exception.PostNotFoundException import dev.usbharu.hideout.plugins.TOKEN_AUTH -import dev.usbharu.hideout.service.IPostService +import dev.usbharu.hideout.service.post.IPostService import dev.usbharu.hideout.util.AcctUtil import dev.usbharu.hideout.util.InstantParseUtil import io.ktor.http.* diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Users.kt b/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Users.kt index 20d7481a..b9a8b068 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Users.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/api/internal/v1/Users.kt @@ -5,8 +5,8 @@ import dev.usbharu.hideout.domain.model.hideout.dto.UserCreateDto import dev.usbharu.hideout.domain.model.hideout.form.UserCreate import dev.usbharu.hideout.exception.ParameterNotExistException import dev.usbharu.hideout.plugins.TOKEN_AUTH -import dev.usbharu.hideout.service.IUserApiService -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.api.IUserApiService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.util.AcctUtil import io.ktor.http.* import io.ktor.server.application.* diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/api/mastodon/v1/Statuses.kt b/src/main/kotlin/dev/usbharu/hideout/routing/api/mastodon/v1/Statuses.kt index 2bd31725..5d83463e 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/api/mastodon/v1/Statuses.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/api/mastodon/v1/Statuses.kt @@ -1,6 +1,6 @@ package dev.usbharu.hideout.routing.api.mastodon.v1 -import dev.usbharu.hideout.service.IPostService +import dev.usbharu.hideout.service.post.IPostService import io.ktor.server.routing.* @Suppress("UnusedPrivateMember") diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/wellknown/WebfingerRouting.kt b/src/main/kotlin/dev/usbharu/hideout/routing/wellknown/WebfingerRouting.kt index e5bd34bf..9106d6bd 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/wellknown/WebfingerRouting.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/wellknown/WebfingerRouting.kt @@ -4,7 +4,7 @@ import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.domain.model.wellknown.WebFinger import dev.usbharu.hideout.exception.IllegalParameterException import dev.usbharu.hideout.exception.ParameterNotExistException -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.util.HttpUtil.Activity import io.ktor.http.* import io.ktor.server.application.* diff --git a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubAcceptServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubAcceptServiceImpl.kt index f37428c2..2e4b212a 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubAcceptServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubAcceptServiceImpl.kt @@ -5,7 +5,7 @@ import dev.usbharu.hideout.domain.model.ActivityPubStringResponse import dev.usbharu.hideout.domain.model.ap.Accept import dev.usbharu.hideout.domain.model.ap.Follow import dev.usbharu.hideout.exception.ap.IllegalActivityPubObjectException -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.http.* import org.koin.core.annotation.Single diff --git a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImpl.kt index 15259d37..cfbb564b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImpl.kt @@ -11,8 +11,8 @@ import dev.usbharu.hideout.exception.ap.IllegalActivityPubObjectException import dev.usbharu.hideout.plugins.getAp import dev.usbharu.hideout.plugins.postAp import dev.usbharu.hideout.repository.IPostRepository -import dev.usbharu.hideout.service.impl.IUserService import dev.usbharu.hideout.service.job.JobQueueParentService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.client.* import io.ktor.client.call.* import kjob.core.job.JobProps diff --git a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImpl.kt index da036de7..e7c3d132 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImpl.kt @@ -8,8 +8,8 @@ import dev.usbharu.hideout.domain.model.ap.Accept import dev.usbharu.hideout.domain.model.ap.Follow import dev.usbharu.hideout.domain.model.job.ReceiveFollowJob import dev.usbharu.hideout.plugins.postAp -import dev.usbharu.hideout.service.impl.IUserService import dev.usbharu.hideout.service.job.JobQueueParentService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.client.* import io.ktor.http.* import kjob.core.job.JobProps diff --git a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUndoServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUndoServiceImpl.kt index ab6c32fd..03daa340 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUndoServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUndoServiceImpl.kt @@ -4,7 +4,7 @@ import dev.usbharu.hideout.domain.model.ActivityPubResponse import dev.usbharu.hideout.domain.model.ActivityPubStringResponse import dev.usbharu.hideout.domain.model.ap.Follow import dev.usbharu.hideout.domain.model.ap.Undo -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.http.* import org.koin.core.annotation.Single diff --git a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUserServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUserServiceImpl.kt index fc90ac97..6c05fddf 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUserServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubUserServiceImpl.kt @@ -9,7 +9,7 @@ import dev.usbharu.hideout.domain.model.hideout.dto.RemoteUserCreateDto import dev.usbharu.hideout.exception.UserNotFoundException import dev.usbharu.hideout.exception.ap.IllegalActivityPubObjectException import dev.usbharu.hideout.plugins.getAp -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.util.HttpUtil.Activity import io.ktor.client.* import io.ktor.client.request.* diff --git a/src/main/kotlin/dev/usbharu/hideout/service/IUserApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/IUserApiService.kt similarity index 94% rename from src/main/kotlin/dev/usbharu/hideout/service/IUserApiService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/api/IUserApiService.kt index dd79e471..17d548f1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/IUserApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/IUserApiService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.api import dev.usbharu.hideout.domain.model.Acct import dev.usbharu.hideout.domain.model.hideout.dto.UserResponse diff --git a/src/main/kotlin/dev/usbharu/hideout/service/UserApiServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiServiceImpl.kt similarity index 94% rename from src/main/kotlin/dev/usbharu/hideout/service/UserApiServiceImpl.kt rename to src/main/kotlin/dev/usbharu/hideout/service/api/UserApiServiceImpl.kt index f3e70e10..b5347983 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/UserApiServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiServiceImpl.kt @@ -1,9 +1,9 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.api import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.domain.model.Acct import dev.usbharu.hideout.domain.model.hideout.dto.UserResponse -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import org.koin.core.annotation.Single @Single diff --git a/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureVerifyService.kt b/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyService.kt similarity index 69% rename from src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureVerifyService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyService.kt index daa2043d..ad326e3b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureVerifyService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service.signature +package dev.usbharu.hideout.service.auth import io.ktor.http.* diff --git a/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureVerifyServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyServiceImpl.kt similarity index 95% rename from src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureVerifyServiceImpl.kt rename to src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyServiceImpl.kt index d44c4326..4acb9aab 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureVerifyServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/auth/HttpSignatureVerifyServiceImpl.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service.signature +package dev.usbharu.hideout.service.auth import dev.usbharu.hideout.plugins.KtorKeyMap import dev.usbharu.hideout.repository.IUserRepository diff --git a/src/main/kotlin/dev/usbharu/hideout/service/IJwtService.kt b/src/main/kotlin/dev/usbharu/hideout/service/auth/IJwtService.kt similarity index 91% rename from src/main/kotlin/dev/usbharu/hideout/service/IJwtService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/auth/IJwtService.kt index f722517f..e1976818 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/IJwtService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/auth/IJwtService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.auth import dev.usbharu.hideout.domain.model.hideout.dto.JwtToken import dev.usbharu.hideout.domain.model.hideout.entity.User diff --git a/src/main/kotlin/dev/usbharu/hideout/service/JwtServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/auth/JwtServiceImpl.kt similarity index 95% rename from src/main/kotlin/dev/usbharu/hideout/service/JwtServiceImpl.kt rename to src/main/kotlin/dev/usbharu/hideout/service/auth/JwtServiceImpl.kt index 4dea9bb1..97fd4505 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/JwtServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/auth/JwtServiceImpl.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.auth import com.auth0.jwt.JWT import com.auth0.jwt.algorithms.Algorithm @@ -9,7 +9,8 @@ import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.domain.model.hideout.form.RefreshToken import dev.usbharu.hideout.exception.InvalidRefreshTokenException import dev.usbharu.hideout.repository.IJwtRefreshTokenRepository -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.core.IMetaService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.util.RsaUtil import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/src/main/kotlin/dev/usbharu/hideout/service/IMetaService.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/IMetaService.kt similarity index 86% rename from src/main/kotlin/dev/usbharu/hideout/service/IMetaService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/core/IMetaService.kt index 84c59d60..763dc96a 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/IMetaService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/IMetaService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.core import dev.usbharu.hideout.domain.model.hideout.entity.Jwt import dev.usbharu.hideout.domain.model.hideout.entity.Meta diff --git a/src/main/kotlin/dev/usbharu/hideout/service/IServerInitialiseService.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/IServerInitialiseService.kt similarity index 60% rename from src/main/kotlin/dev/usbharu/hideout/service/IServerInitialiseService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/core/IServerInitialiseService.kt index 49a613fd..c54eaccc 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/IServerInitialiseService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/IServerInitialiseService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.core interface IServerInitialiseService { suspend fun init() diff --git a/src/main/kotlin/dev/usbharu/hideout/service/IdGenerateService.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/IdGenerateService.kt similarity index 62% rename from src/main/kotlin/dev/usbharu/hideout/service/IdGenerateService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/core/IdGenerateService.kt index b27cef4c..2962f4e3 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/IdGenerateService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/IdGenerateService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.core interface IdGenerateService { suspend fun generateId(): Long diff --git a/src/main/kotlin/dev/usbharu/hideout/service/MetaServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/MetaServiceImpl.kt similarity index 93% rename from src/main/kotlin/dev/usbharu/hideout/service/MetaServiceImpl.kt rename to src/main/kotlin/dev/usbharu/hideout/service/core/MetaServiceImpl.kt index db9412e4..9e922312 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/MetaServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/MetaServiceImpl.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.core import dev.usbharu.hideout.domain.model.hideout.entity.Jwt import dev.usbharu.hideout.domain.model.hideout.entity.Meta diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ServerInitialiseServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/ServerInitialiseServiceImpl.kt similarity index 98% rename from src/main/kotlin/dev/usbharu/hideout/service/ServerInitialiseServiceImpl.kt rename to src/main/kotlin/dev/usbharu/hideout/service/core/ServerInitialiseServiceImpl.kt index 13fabeaf..ea9b5099 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ServerInitialiseServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/ServerInitialiseServiceImpl.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.core import dev.usbharu.hideout.domain.model.hideout.entity.Jwt import dev.usbharu.hideout.domain.model.hideout.entity.Meta diff --git a/src/main/kotlin/dev/usbharu/hideout/service/SnowflakeIdGenerateService.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/SnowflakeIdGenerateService.kt similarity index 97% rename from src/main/kotlin/dev/usbharu/hideout/service/SnowflakeIdGenerateService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/core/SnowflakeIdGenerateService.kt index 6e95140a..e90ea2d6 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/SnowflakeIdGenerateService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/SnowflakeIdGenerateService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.core import kotlinx.coroutines.delay import kotlinx.coroutines.sync.Mutex diff --git a/src/main/kotlin/dev/usbharu/hideout/service/TwitterSnowflakeIdGenerateService.kt b/src/main/kotlin/dev/usbharu/hideout/service/core/TwitterSnowflakeIdGenerateService.kt similarity index 77% rename from src/main/kotlin/dev/usbharu/hideout/service/TwitterSnowflakeIdGenerateService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/core/TwitterSnowflakeIdGenerateService.kt index 2902a044..35a9cd14 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/TwitterSnowflakeIdGenerateService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/core/TwitterSnowflakeIdGenerateService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.core // 2010-11-04T01:42:54.657 @Suppress("MagicNumber") diff --git a/src/main/kotlin/dev/usbharu/hideout/service/IPostService.kt b/src/main/kotlin/dev/usbharu/hideout/service/post/IPostService.kt similarity index 97% rename from src/main/kotlin/dev/usbharu/hideout/service/IPostService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/post/IPostService.kt index e4a33550..af290950 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/IPostService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/post/IPostService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.post import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.domain.model.hideout.dto.PostCreateDto diff --git a/src/main/kotlin/dev/usbharu/hideout/service/impl/PostService.kt b/src/main/kotlin/dev/usbharu/hideout/service/post/PostService.kt similarity index 97% rename from src/main/kotlin/dev/usbharu/hideout/service/impl/PostService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/post/PostService.kt index cbb7a3bb..3ec2b071 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/impl/PostService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/post/PostService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service.impl +package dev.usbharu.hideout.service.post import dev.usbharu.hideout.domain.model.hideout.dto.PostCreateDto import dev.usbharu.hideout.domain.model.hideout.entity.Post @@ -7,8 +7,8 @@ import dev.usbharu.hideout.repository.IPostRepository import dev.usbharu.hideout.repository.Posts import dev.usbharu.hideout.repository.UsersFollowers import dev.usbharu.hideout.repository.toPost -import dev.usbharu.hideout.service.IPostService import dev.usbharu.hideout.service.activitypub.ActivityPubNoteService +import dev.usbharu.hideout.service.user.IUserService import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq import org.jetbrains.exposed.sql.SqlExpressionBuilder.inSubQuery import org.jetbrains.exposed.sql.and diff --git a/src/main/kotlin/dev/usbharu/hideout/service/IUserAuthService.kt b/src/main/kotlin/dev/usbharu/hideout/service/user/IUserAuthService.kt similarity index 87% rename from src/main/kotlin/dev/usbharu/hideout/service/IUserAuthService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/user/IUserAuthService.kt index 102db32e..35896355 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/IUserAuthService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/user/IUserAuthService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service +package dev.usbharu.hideout.service.user import java.security.KeyPair diff --git a/src/main/kotlin/dev/usbharu/hideout/service/impl/IUserService.kt b/src/main/kotlin/dev/usbharu/hideout/service/user/IUserService.kt similarity index 97% rename from src/main/kotlin/dev/usbharu/hideout/service/impl/IUserService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/user/IUserService.kt index b83911ba..eb806eb1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/impl/IUserService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/user/IUserService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service.impl +package dev.usbharu.hideout.service.user import dev.usbharu.hideout.domain.model.hideout.dto.RemoteUserCreateDto import dev.usbharu.hideout.domain.model.hideout.dto.UserCreateDto diff --git a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserAuthService.kt b/src/main/kotlin/dev/usbharu/hideout/service/user/UserAuthService.kt similarity index 94% rename from src/main/kotlin/dev/usbharu/hideout/service/impl/UserAuthService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/user/UserAuthService.kt index 4450fe4e..a8b6e6f2 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserAuthService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/user/UserAuthService.kt @@ -1,8 +1,7 @@ -package dev.usbharu.hideout.service.impl +package dev.usbharu.hideout.service.user import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.IUserAuthService import io.ktor.util.* import org.koin.core.annotation.Single import java.security.* diff --git a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserService.kt b/src/main/kotlin/dev/usbharu/hideout/service/user/UserService.kt similarity index 98% rename from src/main/kotlin/dev/usbharu/hideout/service/impl/UserService.kt rename to src/main/kotlin/dev/usbharu/hideout/service/user/UserService.kt index 43a3a2dd..bf531e74 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/impl/UserService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/user/UserService.kt @@ -1,4 +1,4 @@ -package dev.usbharu.hideout.service.impl +package dev.usbharu.hideout.service.user import dev.usbharu.hideout.config.Config import dev.usbharu.hideout.domain.model.hideout.dto.RemoteUserCreateDto @@ -7,7 +7,6 @@ import dev.usbharu.hideout.domain.model.hideout.dto.UserCreateDto import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.exception.UserNotFoundException import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.IUserAuthService import dev.usbharu.hideout.service.activitypub.ActivityPubSendFollowService import org.koin.core.annotation.Single import java.lang.Integer.min diff --git a/src/test/kotlin/dev/usbharu/hideout/plugins/ActivityPubKtTest.kt b/src/test/kotlin/dev/usbharu/hideout/plugins/ActivityPubKtTest.kt index c00503c6..fc830bf2 100644 --- a/src/test/kotlin/dev/usbharu/hideout/plugins/ActivityPubKtTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/plugins/ActivityPubKtTest.kt @@ -3,7 +3,7 @@ package dev.usbharu.hideout.plugins import dev.usbharu.hideout.domain.model.ap.JsonLd import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.impl.toPem +import dev.usbharu.hideout.service.user.toPem import io.ktor.client.* import io.ktor.client.engine.mock.* import io.ktor.client.plugins.logging.* diff --git a/src/test/kotlin/dev/usbharu/hideout/plugins/KtorKeyMapTest.kt b/src/test/kotlin/dev/usbharu/hideout/plugins/KtorKeyMapTest.kt index 1a737b4b..70343bc4 100644 --- a/src/test/kotlin/dev/usbharu/hideout/plugins/KtorKeyMapTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/plugins/KtorKeyMapTest.kt @@ -2,7 +2,7 @@ package dev.usbharu.hideout.plugins import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.impl.toPem +import dev.usbharu.hideout.service.user.toPem import org.junit.jupiter.api.Test import java.security.KeyPairGenerator import java.time.Instant diff --git a/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt b/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt index 9346fa27..9da64ff0 100644 --- a/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt @@ -15,9 +15,9 @@ import dev.usbharu.hideout.domain.model.hideout.form.RefreshToken import dev.usbharu.hideout.domain.model.hideout.form.UserLogin import dev.usbharu.hideout.exception.InvalidRefreshTokenException import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.IJwtService -import dev.usbharu.hideout.service.IMetaService -import dev.usbharu.hideout.service.IUserAuthService +import dev.usbharu.hideout.service.auth.IJwtService +import dev.usbharu.hideout.service.core.IMetaService +import dev.usbharu.hideout.service.user.IUserAuthService import dev.usbharu.hideout.util.Base64Util import dev.usbharu.hideout.util.JsonWebKeyUtil import io.ktor.client.request.* diff --git a/src/test/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImplTest.kt index ce44343f..00666e9d 100644 --- a/src/test/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/repository/JwtRefreshTokenRepositoryImplTest.kt @@ -3,7 +3,7 @@ package dev.usbharu.hideout.repository import dev.usbharu.hideout.domain.model.hideout.entity.JwtRefreshToken -import dev.usbharu.hideout.service.IdGenerateService +import dev.usbharu.hideout.service.core.IdGenerateService import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.jetbrains.exposed.sql.Database diff --git a/src/test/kotlin/dev/usbharu/hideout/repository/UserRepositoryTest.kt b/src/test/kotlin/dev/usbharu/hideout/repository/UserRepositoryTest.kt index 8fb127f7..244ff004 100644 --- a/src/test/kotlin/dev/usbharu/hideout/repository/UserRepositoryTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/repository/UserRepositoryTest.kt @@ -3,7 +3,7 @@ package dev.usbharu.hideout.repository import dev.usbharu.hideout.domain.model.hideout.entity.User -import dev.usbharu.hideout.service.IdGenerateService +import dev.usbharu.hideout.service.core.IdGenerateService import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.jetbrains.exposed.sql.Database diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt index d1096731..9260848c 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt @@ -5,8 +5,8 @@ import dev.usbharu.hideout.plugins.configureSerialization import dev.usbharu.hideout.plugins.configureStatusPages import dev.usbharu.hideout.service.activitypub.ActivityPubService import dev.usbharu.hideout.service.activitypub.ActivityPubUserService -import dev.usbharu.hideout.service.impl.IUserService -import dev.usbharu.hideout.service.signature.HttpSignatureVerifyService +import dev.usbharu.hideout.service.auth.HttpSignatureVerifyService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.client.request.* import io.ktor.http.* import io.ktor.server.config.* diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt index 736ea065..b0eb28dd 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt @@ -12,7 +12,7 @@ import dev.usbharu.hideout.domain.model.ap.Person import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.plugins.configureSerialization import dev.usbharu.hideout.service.activitypub.ActivityPubUserService -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.util.HttpUtil.Activity import dev.usbharu.hideout.util.HttpUtil.JsonLd import io.ktor.client.request.* diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt index 5b878534..af38a764 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt @@ -10,7 +10,7 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Visibility import dev.usbharu.hideout.plugins.TOKEN_AUTH import dev.usbharu.hideout.plugins.configureSecurity import dev.usbharu.hideout.plugins.configureSerialization -import dev.usbharu.hideout.service.IPostService +import dev.usbharu.hideout.service.post.IPostService import io.ktor.client.request.* import io.ktor.client.statement.* import io.ktor.http.* diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt index dffe7ab8..ea9d703b 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt @@ -10,8 +10,8 @@ import dev.usbharu.hideout.domain.model.hideout.form.UserCreate import dev.usbharu.hideout.plugins.TOKEN_AUTH import dev.usbharu.hideout.plugins.configureSecurity import dev.usbharu.hideout.plugins.configureSerialization -import dev.usbharu.hideout.service.IUserApiService -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.api.IUserApiService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.client.request.* import io.ktor.client.statement.* import io.ktor.http.* diff --git a/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt index 7c4f90bb..ee52c03f 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt @@ -13,7 +13,9 @@ import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.domain.model.hideout.form.RefreshToken import dev.usbharu.hideout.exception.InvalidRefreshTokenException import dev.usbharu.hideout.repository.IJwtRefreshTokenRepository -import dev.usbharu.hideout.service.impl.IUserService +import dev.usbharu.hideout.service.auth.JwtServiceImpl +import dev.usbharu.hideout.service.core.IMetaService +import dev.usbharu.hideout.service.user.IUserService import dev.usbharu.hideout.util.Base64Util import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest diff --git a/src/test/kotlin/dev/usbharu/hideout/service/MetaServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/MetaServiceImplTest.kt index f484d51f..90534a60 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/MetaServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/MetaServiceImplTest.kt @@ -6,6 +6,7 @@ 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.IMetaRepository +import dev.usbharu.hideout.service.core.MetaServiceImpl import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/dev/usbharu/hideout/service/ServerInitialiseServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/ServerInitialiseServiceImplTest.kt index 3b6e34c0..b19b9f8b 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/ServerInitialiseServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/ServerInitialiseServiceImplTest.kt @@ -5,6 +5,7 @@ package dev.usbharu.hideout.service import dev.usbharu.hideout.domain.model.hideout.entity.Jwt import dev.usbharu.hideout.domain.model.hideout.entity.Meta import dev.usbharu.hideout.repository.IMetaRepository +import dev.usbharu.hideout.service.core.ServerInitialiseServiceImpl import dev.usbharu.hideout.util.ServerUtil import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest diff --git a/src/test/kotlin/dev/usbharu/hideout/service/TwitterSnowflakeIdGenerateServiceTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/TwitterSnowflakeIdGenerateServiceTest.kt index e1aab2f3..7d1969f4 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/TwitterSnowflakeIdGenerateServiceTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/TwitterSnowflakeIdGenerateServiceTest.kt @@ -1,6 +1,7 @@ package dev.usbharu.hideout.service // import kotlinx.coroutines.NonCancellable.message +import dev.usbharu.hideout.service.core.TwitterSnowflakeIdGenerateService import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch diff --git a/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImplTest.kt index f4a9f206..eed2c9a2 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubNoteServiceImplTest.kt @@ -9,8 +9,8 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Post import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.domain.model.hideout.entity.Visibility import dev.usbharu.hideout.domain.model.job.DeliverPostJob -import dev.usbharu.hideout.service.impl.IUserService import dev.usbharu.hideout.service.job.JobQueueParentService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.client.* import io.ktor.client.engine.mock.* import kjob.core.job.JobProps diff --git a/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImplTest.kt index b58068f3..5d15c039 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/activitypub/ActivityPubReceiveFollowServiceImplTest.kt @@ -9,8 +9,8 @@ import dev.usbharu.hideout.config.ConfigData import dev.usbharu.hideout.domain.model.ap.* import dev.usbharu.hideout.domain.model.hideout.entity.User import dev.usbharu.hideout.domain.model.job.ReceiveFollowJob -import dev.usbharu.hideout.service.impl.IUserService import dev.usbharu.hideout.service.job.JobQueueParentService +import dev.usbharu.hideout.service.user.IUserService import io.ktor.client.* import io.ktor.client.engine.mock.* import kjob.core.dsl.ScheduleContext diff --git a/src/test/kotlin/dev/usbharu/hideout/service/impl/PostServiceTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/impl/PostServiceTest.kt index 47ea8518..938f7aac 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/impl/PostServiceTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/impl/PostServiceTest.kt @@ -6,7 +6,8 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Post import dev.usbharu.hideout.domain.model.hideout.entity.Visibility import dev.usbharu.hideout.repository.Posts import dev.usbharu.hideout.repository.UsersFollowers -import dev.usbharu.hideout.service.TwitterSnowflakeIdGenerateService +import dev.usbharu.hideout.service.core.TwitterSnowflakeIdGenerateService +import dev.usbharu.hideout.service.post.PostService import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.jetbrains.exposed.sql.Database diff --git a/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt index 3b182e3b..8bf83071 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/impl/UserServiceTest.kt @@ -7,7 +7,9 @@ import dev.usbharu.hideout.config.ConfigData import dev.usbharu.hideout.domain.model.hideout.dto.RemoteUserCreateDto import dev.usbharu.hideout.domain.model.hideout.dto.UserCreateDto import dev.usbharu.hideout.repository.IUserRepository -import dev.usbharu.hideout.service.IUserAuthService +import dev.usbharu.hideout.service.user.IUserAuthService +import dev.usbharu.hideout.service.user.UserService +import dev.usbharu.hideout.service.user.toPem import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test