mirror of https://github.com/usbharu/Hideout.git
refactor: tmpから正式なパッケージに移動
This commit is contained in:
parent
9171e3a063
commit
14998f514d
|
@ -1,11 +1,11 @@
|
|||
package dev.usbharu.hideout.activitypub.service.tmp.impl
|
||||
package dev.usbharu.hideout.activitypub.service.activity.create
|
||||
|
||||
import dev.usbharu.hideout.activitypub.domain.model.Create
|
||||
import dev.usbharu.hideout.activitypub.domain.model.Note
|
||||
import dev.usbharu.hideout.activitypub.service.common.AbstractActivityPubProcessor
|
||||
import dev.usbharu.hideout.activitypub.service.common.ActivityPubProcessContext
|
||||
import dev.usbharu.hideout.activitypub.service.common.ActivityType
|
||||
import dev.usbharu.hideout.activitypub.service.objects.note.APNoteService
|
||||
import dev.usbharu.hideout.activitypub.service.tmp.AbstractActivityPubProcessor
|
||||
import dev.usbharu.hideout.activitypub.service.tmp.ActivityPubProcessContext
|
||||
import dev.usbharu.hideout.application.external.Transaction
|
||||
import org.springframework.stereotype.Service
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package dev.usbharu.hideout.activitypub.service.tmp
|
||||
package dev.usbharu.hideout.activitypub.service.common
|
||||
|
||||
import dev.usbharu.hideout.activitypub.domain.exception.ActivityPubProcessException
|
||||
import dev.usbharu.hideout.activitypub.domain.exception.FailedProcessException
|
|
@ -1,4 +1,4 @@
|
|||
package dev.usbharu.hideout.activitypub.service.tmp
|
||||
package dev.usbharu.hideout.activitypub.service.common
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode
|
||||
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
|
|
@ -1,7 +1,6 @@
|
|||
package dev.usbharu.hideout.activitypub.service.tmp
|
||||
package dev.usbharu.hideout.activitypub.service.common
|
||||
|
||||
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
|
||||
import dev.usbharu.hideout.activitypub.service.common.ActivityType
|
||||
|
||||
interface ActivityPubProcessor<T : Object> {
|
||||
suspend fun process(activity: ActivityPubProcessContext<T>)
|
|
@ -3,8 +3,8 @@ package dev.usbharu.hideout.activitypub.service.common
|
|||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import dev.usbharu.hideout.activitypub.service.activity.follow.APReceiveFollowJobService
|
||||
import dev.usbharu.hideout.activitypub.service.activity.like.ApReactionJobService
|
||||
import dev.usbharu.hideout.activitypub.service.inbox.InboxJobProcessor
|
||||
import dev.usbharu.hideout.activitypub.service.objects.note.ApNoteJobService
|
||||
import dev.usbharu.hideout.activitypub.service.tmp.InboxJobProcessor
|
||||
import dev.usbharu.hideout.core.external.job.*
|
||||
import kjob.core.dsl.JobContextWithProps
|
||||
import kjob.core.job.JobProps
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package dev.usbharu.hideout.activitypub.service.tmp
|
||||
package dev.usbharu.hideout.activitypub.service.inbox
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.fasterxml.jackson.module.kotlin.readValue
|
||||
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
|
||||
import dev.usbharu.hideout.activitypub.service.common.ActivityPubProcessContext
|
||||
import dev.usbharu.hideout.activitypub.service.common.ActivityPubProcessor
|
||||
import dev.usbharu.hideout.activitypub.service.common.ActivityType
|
||||
import dev.usbharu.hideout.activitypub.service.objects.user.APUserService
|
||||
import dev.usbharu.hideout.application.external.Transaction
|
||||
import dev.usbharu.hideout.core.domain.exception.FailedToGetResourcesException
|
||||
import dev.usbharu.hideout.core.external.job.InboxJob
|
||||
import dev.usbharu.hideout.core.external.job.InboxJobParam
|
||||
|
@ -28,7 +31,8 @@ class InboxJobProcessor(
|
|||
private val signatureHeaderParser: SignatureHeaderParser,
|
||||
private val signatureVerifier: HttpSignatureVerifier,
|
||||
private val userQueryService: UserQueryService,
|
||||
private val apUserService: APUserService
|
||||
private val apUserService: APUserService,
|
||||
private val transaction: Transaction
|
||||
) : JobProcessor<InboxJobParam, InboxJob> {
|
||||
suspend fun process(props: JobProps<InboxJob>) {
|
||||
|
||||
|
@ -92,7 +96,7 @@ class InboxJobProcessor(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun process(param: InboxJobParam) {
|
||||
override suspend fun process(param: InboxJobParam) = transaction.transaction {
|
||||
val jsonNode = objectMapper.readTree(param.json)
|
||||
|
||||
logger.info("START Process inbox. type: {}", param.type)
|
Loading…
Reference in New Issue