diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/interfaces/api/inbox/InboxControllerImpl.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/interfaces/api/inbox/InboxControllerImpl.kt index fc8acf7f..1ad9062c 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/interfaces/api/inbox/InboxControllerImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/interfaces/api/inbox/InboxControllerImpl.kt @@ -13,14 +13,12 @@ import org.springframework.web.context.request.RequestContextHolder import org.springframework.web.context.request.ServletRequestAttributes import java.net.URL - @RestController class InboxControllerImpl(private val apService: APService) : InboxController { @Suppress("TooGenericExceptionCaught") override suspend fun inbox( @RequestBody string: String ): ResponseEntity { - val request = (requireNotNull(RequestContextHolder.getRequestAttributes()) as ServletRequestAttributes).request val parseActivity = try { @@ -48,11 +46,14 @@ class InboxControllerImpl(private val apService: APService) : InboxController { println(headers) apService.processActivity( - string, parseActivity, HttpRequest( + string, + parseActivity, + HttpRequest( URL(url + request.queryString.orEmpty()), HttpHeaders(headers), method - ), headers + ), + headers ) } catch (e: Exception) { LOGGER.warn("FAILED Process Activity $parseActivity", e) diff --git a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/instance/Nodeinfo2_0.kt b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/instance/Nodeinfo2_0.kt index fcd99c73..53479eee 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/domain/model/instance/Nodeinfo2_0.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/domain/model/instance/Nodeinfo2_0.kt @@ -1,3 +1,5 @@ +@file:Suppress("Filename") + package dev.usbharu.hideout.core.domain.model.instance @Suppress("ClassNaming") diff --git a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobmongodb/KJobMongoJobQueueWorkerService.kt b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobmongodb/KJobMongoJobQueueWorkerService.kt index 5017fd0d..bb48b08b 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobmongodb/KJobMongoJobQueueWorkerService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/kjobmongodb/KJobMongoJobQueueWorkerService.kt @@ -23,8 +23,10 @@ class KJobMongoJobQueueWorkerService(private val mongoClient: MongoClient) : Job }.start() } - override fun > init(defines: - List>.(R) -> KJobFunctions>>>) { + override fun > init( + defines: + List>.(R) -> KJobFunctions>>> + ) { defines.forEach { job -> kjob.register(job.first, job.second) } diff --git a/src/main/kotlin/dev/usbharu/hideout/core/service/job/JobProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/core/service/job/JobProcessor.kt index f6adc74b..7d38449f 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/service/job/JobProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/service/job/JobProcessor.kt @@ -2,7 +2,7 @@ package dev.usbharu.hideout.core.service.job import dev.usbharu.hideout.core.external.job.HideoutJob -interface JobProcessor> { +interface JobProcessor> { suspend fun process(param: @UnsafeVariance T) fun job(): R }