From 403930ee12b6ba8d48b8d7e463365a01750302fe Mon Sep 17 00:00:00 2001 From: usbharu Date: Thu, 2 Nov 2023 17:42:52 +0900 Subject: [PATCH] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../hideout/activitypub/service/objects/note/APNoteService.kt | 2 -- .../activitypub/service/objects/note/ApNoteJobServiceImpl.kt | 1 - .../dev/usbharu/hideout/core/service/post/PostServiceImpl.kt | 2 -- 3 files changed, 5 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt index b01a6f76..c221e9fb 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/APNoteService.kt @@ -56,7 +56,6 @@ class APNoteServiceImpl( ) : APNoteService { - private val logger = LoggerFactory.getLogger(APNoteServiceImpl::class.java) override suspend fun fetchNote(url: String, targetActor: String?): Note { @@ -144,7 +143,6 @@ class APNoteServiceImpl( override suspend fun fetchNote(note: Note, targetActor: String?): Note = saveIfMissing(note, targetActor, note.id ?: throw IllegalArgumentException("note.id is null")) - companion object { const val public: String = "https://www.w3.org/ns/activitystreams#Public" } diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/ApNoteJobServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/ApNoteJobServiceImpl.kt index 14f773b0..1e3dc801 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/ApNoteJobServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/objects/note/ApNoteJobServiceImpl.kt @@ -20,7 +20,6 @@ class ApNoteJobServiceImpl( private val transaction: Transaction ) : ApNoteJobService { override suspend fun createNoteJob(props: JobProps) { - val actor = props[DeliverPostJob.actor] val create = objectMapper.readValue(props[DeliverPostJob.create]) transaction.transaction { diff --git a/src/main/kotlin/dev/usbharu/hideout/core/service/post/PostServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/core/service/post/PostServiceImpl.kt index 242f6eba..c1f21f21 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/service/post/PostServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/service/post/PostServiceImpl.kt @@ -22,7 +22,6 @@ class PostServiceImpl( private val apSendCreateService: ApSendCreateService ) : PostService { - override suspend fun createLocal(post: PostCreateDto): Post { logger.info("START Create Local Post user: {}, media: {}", post.userId, post.mediaIds.size) val create = internalCreate(post, true) @@ -38,7 +37,6 @@ class PostServiceImpl( return createdPost } - private suspend fun internalCreate(post: Post, isLocal: Boolean): Post { val save = try { postRepository.save(post)