style: fix lint

This commit is contained in:
usbharu 2023-11-27 15:52:49 +09:00
parent c0dffe7c98
commit e5d1a8d4a6
4 changed files with 12 additions and 7 deletions

View File

@ -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)

View File

@ -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")

View File

@ -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)
} }

View File

@ -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
} }