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 org.springframework.web.context.request.ServletRequestAttributes
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
class InboxControllerImpl(private val apService: APService) : InboxController {
|
class InboxControllerImpl(private val apService: APService) : InboxController {
|
||||||
@Suppress("TooGenericExceptionCaught")
|
@Suppress("TooGenericExceptionCaught")
|
||||||
override suspend fun inbox(
|
override suspend fun inbox(
|
||||||
@RequestBody string: String
|
@RequestBody string: String
|
||||||
): ResponseEntity<Unit> {
|
): ResponseEntity<Unit> {
|
||||||
|
|
||||||
val request = (requireNotNull(RequestContextHolder.getRequestAttributes()) as ServletRequestAttributes).request
|
val request = (requireNotNull(RequestContextHolder.getRequestAttributes()) as ServletRequestAttributes).request
|
||||||
|
|
||||||
val parseActivity = try {
|
val parseActivity = try {
|
||||||
|
@ -48,11 +46,14 @@ class InboxControllerImpl(private val apService: APService) : InboxController {
|
||||||
println(headers)
|
println(headers)
|
||||||
|
|
||||||
apService.processActivity(
|
apService.processActivity(
|
||||||
string, parseActivity, HttpRequest(
|
string,
|
||||||
|
parseActivity,
|
||||||
|
HttpRequest(
|
||||||
URL(url + request.queryString.orEmpty()),
|
URL(url + request.queryString.orEmpty()),
|
||||||
HttpHeaders(headers),
|
HttpHeaders(headers),
|
||||||
method
|
method
|
||||||
), headers
|
),
|
||||||
|
headers
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
LOGGER.warn("FAILED Process Activity $parseActivity", e)
|
LOGGER.warn("FAILED Process Activity $parseActivity", e)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@file:Suppress("Filename")
|
||||||
|
|
||||||
package dev.usbharu.hideout.core.domain.model.instance
|
package dev.usbharu.hideout.core.domain.model.instance
|
||||||
|
|
||||||
@Suppress("ClassNaming")
|
@Suppress("ClassNaming")
|
||||||
|
|
|
@ -23,8 +23,10 @@ class KJobMongoJobQueueWorkerService(private val mongoClient: MongoClient) : Job
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun <T, R : HideoutJob<T, R>> init(defines:
|
override fun <T, R : HideoutJob<T, R>> init(
|
||||||
List<Pair<R, JobRegisterContext<R, JobContextWithProps<R>>.(R) -> KJobFunctions<R, JobContextWithProps<R>>>>) {
|
defines:
|
||||||
|
List<Pair<R, JobRegisterContext<R, JobContextWithProps<R>>.(R) -> KJobFunctions<R, JobContextWithProps<R>>>>
|
||||||
|
) {
|
||||||
defines.forEach { job ->
|
defines.forEach { job ->
|
||||||
kjob.register(job.first, job.second)
|
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
|
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)
|
suspend fun process(param: @UnsafeVariance T)
|
||||||
fun job(): R
|
fun job(): R
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue