mirror of https://github.com/usbharu/Hideout.git
style: fix lint
This commit is contained in:
parent
c0dffe7c98
commit
e5d1a8d4a6
|
@ -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<Unit> {
|
||||
|
||||
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)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
@file:Suppress("Filename")
|
||||
|
||||
package dev.usbharu.hideout.core.domain.model.instance
|
||||
|
||||
@Suppress("ClassNaming")
|
||||
|
|
|
@ -23,8 +23,10 @@ class KJobMongoJobQueueWorkerService(private val mongoClient: MongoClient) : Job
|
|||
}.start()
|
||||
}
|
||||
|
||||
override fun <T, R : HideoutJob<T, R>> init(defines:
|
||||
List<Pair<R, JobRegisterContext<R, JobContextWithProps<R>>.(R) -> KJobFunctions<R, JobContextWithProps<R>>>>) {
|
||||
override fun <T, R : HideoutJob<T, R>> init(
|
||||
defines:
|
||||
List<Pair<R, JobRegisterContext<R, JobContextWithProps<R>>.(R) -> KJobFunctions<R, JobContextWithProps<R>>>>
|
||||
) {
|
||||
defines.forEach { job ->
|
||||
kjob.register(job.first, job.second)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package dev.usbharu.hideout.core.service.job
|
|||
|
||||
import dev.usbharu.hideout.core.external.job.HideoutJob
|
||||
|
||||
interface JobProcessor<out T, out R : HideoutJob<T, R>> {
|
||||
interface JobProcessor<in T, out R : HideoutJob<@UnsafeVariance T, R>> {
|
||||
suspend fun process(param: @UnsafeVariance T)
|
||||
fun job(): R
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue