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)