diff --git a/src/main/kotlin/dev/usbharu/hideout/Application.kt b/src/main/kotlin/dev/usbharu/hideout/Application.kt index bd2d6774..5b2a1acb 100644 --- a/src/main/kotlin/dev/usbharu/hideout/Application.kt +++ b/src/main/kotlin/dev/usbharu/hideout/Application.kt @@ -25,11 +25,6 @@ import io.ktor.client.* import io.ktor.client.engine.cio.* import io.ktor.client.plugins.logging.* import io.ktor.server.application.* -import kjob.core.Job -import kjob.core.KJob -import kjob.core.dsl.JobContextWithProps -import kjob.core.dsl.JobRegisterContext -import kjob.core.dsl.KJobFunctions import kjob.core.kjob import org.jetbrains.exposed.sql.Database import org.koin.ktor.ext.inject @@ -76,15 +71,16 @@ fun Application.parent() { logger = Logger.DEFAULT level = LogLevel.ALL } - install(httpSignaturePlugin){ + install(httpSignaturePlugin) { keyMap = KtorKeyMap(get()) } } } - single { ActivityPubFollowServiceImpl(get(), get(), get(),get()) } - single { ActivityPubServiceImpl(get()) } + single { ActivityPubFollowServiceImpl(get(), get(), get(), get()) } + single { ActivityPubServiceImpl(get(), get()) } single { UserService(get()) } single { ActivityPubUserServiceImpl(get(), get(), get()) } + single { ActivityPubNoteServiceImpl(get(), get(), get()) } } @@ -101,6 +97,7 @@ fun Application.parent() { inject().value ) } + @Suppress("unused") fun Application.worker() { val kJob = kjob(ExposedKJob) { @@ -109,9 +106,9 @@ fun Application.worker() { val activityPubService = inject().value - kJob.register(ReceiveFollowJob){ + kJob.register(ReceiveFollowJob) { execute { - activityPubService.processActivity(this,it) + activityPubService.processActivity(this, it) } } } diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt index 7ec43b22..34ec97ae 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/PostRepositoryImpl.kt @@ -39,6 +39,7 @@ class PostRepositoryImpl(database: Database, private val idGenerateService: IdGe } return@query PostEntity( generateId, + post.userId, post.overview, post.text, post.createdAt,