From 4ca9fe6cfbf45317b57895b365883364848b0b2a Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 30 Sep 2023 11:25:31 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=82=92=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usbharu/hideout/repository/MongoTimelineRepository.kt | 2 +- .../hideout/repository/MongoTimelineRepositoryWrapper.kt | 5 ++--- .../dev/usbharu/hideout/service/ap/APNoteService.kt | 8 ++++---- .../dev/usbharu/hideout/service/post/PostServiceImpl.kt | 4 +--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt b/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt index 3dcd35b1..0b8937cf 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt @@ -4,7 +4,7 @@ import dev.usbharu.hideout.domain.model.hideout.entity.Timeline import org.springframework.data.domain.Pageable import org.springframework.data.mongodb.repository.MongoRepository -@Suppress("LongParameterList") +@Suppress("LongParameterList", "FunctionMaxLength") interface MongoTimelineRepository : MongoRepository { fun findByUserId(id: Long): List fun findByUserIdAndTimelineId(userId: Long, timelineId: Long): List diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepositoryWrapper.kt b/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepositoryWrapper.kt index d4908948..a3e31b6f 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepositoryWrapper.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepositoryWrapper.kt @@ -21,9 +21,8 @@ class MongoTimelineRepositoryWrapper( } } - override suspend fun saveAll(timelines: List): List { - return mongoTimelineRepository.saveAll(timelines) - } + override suspend fun saveAll(timelines: List): List = + mongoTimelineRepository.saveAll(timelines) override suspend fun findByUserId(id: Long): List { return withContext(Dispatchers.IO) { diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt index b4c260e1..2b6ce229 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt @@ -190,11 +190,11 @@ class APNoteServiceImpl( override suspend fun fetchNote(note: Note, targetActor: String?): Note = note(note, targetActor, note.id ?: throw IllegalArgumentException("note.id is null")) - companion object { - const val public: String = "https://www.w3.org/ns/activitystreams#Public" - } - override suspend fun run(post: Post) { createNote(post) } + + companion object { + const val public: String = "https://www.w3.org/ns/activitystreams#Public" + } } diff --git a/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt index 2fb9a1e4..a86c2227 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/post/PostServiceImpl.kt @@ -23,9 +23,7 @@ class PostServiceImpl( return create } - override suspend fun createRemote(post: Post): Post { - return internalCreate(post, false) - } + override suspend fun createRemote(post: Post): Post = internalCreate(post, false) override fun addInterceptor(postCreateInterceptor: PostCreateInterceptor) { interceptors.add(postCreateInterceptor)