From bf2c50c44530baf79027bdb29e346d5f5cd40fbd Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:14:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB?= =?UTF-8?q?=E6=8A=95=E7=A8=BF=E5=89=8A=E9=99=A4=E3=81=AE=E9=85=8D=E9=80=81?= =?UTF-8?q?=E3=81=8C=E8=A1=8C=E3=82=8F=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usbharu/hideout/core/service/post/PostServiceImpl.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 fcd44f67..f6fc8471 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 @@ -1,6 +1,7 @@ package dev.usbharu.hideout.core.service.post import dev.usbharu.hideout.activitypub.service.activity.create.ApSendCreateService +import dev.usbharu.hideout.activitypub.service.activity.delete.APSendDeleteService import dev.usbharu.hideout.core.domain.exception.UserNotFoundException import dev.usbharu.hideout.core.domain.exception.resource.DuplicateException import dev.usbharu.hideout.core.domain.exception.resource.PostNotFoundException @@ -21,7 +22,8 @@ class PostServiceImpl( private val timelineService: TimelineService, private val postBuilder: Post.PostBuilder, private val apSendCreateService: ApSendCreateService, - private val reactionRepository: ReactionRepository + private val reactionRepository: ReactionRepository, + private val apSendDeleteService: APSendDeleteService ) : PostService { override suspend fun createLocal(post: PostCreateDto): Post { @@ -50,6 +52,8 @@ class PostServiceImpl( val actor = actorRepository.findById(post.actorId) ?: throw IllegalStateException("actor: ${post.actorId} was not found.") + apSendDeleteService.sendDeleteNote(post) + actorRepository.save(actor.decrementPostsCount()) }