From a21a4d7d96de4df74d75acfa3a539387caa8942f Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 30 Sep 2023 11:19:06 +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 --- .../controller/mastodon/MastodonStatusesApiContoller.kt | 2 +- .../usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt | 4 +--- .../dev/usbharu/hideout/repository/MongoTimelineRepository.kt | 1 + .../hideout/repository/MongoTimelineRepositoryWrapper.kt | 1 + .../kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt | 1 + .../hideout/service/api/mastodon/TimelineApiService.kt | 2 +- .../usbharu/hideout/service/post/GenerateTimelineService.kt | 2 +- .../hideout/service/post/MongoGenerateTimelineService.kt | 2 -- 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/controller/mastodon/MastodonStatusesApiContoller.kt b/src/main/kotlin/dev/usbharu/hideout/controller/mastodon/MastodonStatusesApiContoller.kt index 0d40471e..d5111577 100644 --- a/src/main/kotlin/dev/usbharu/hideout/controller/mastodon/MastodonStatusesApiContoller.kt +++ b/src/main/kotlin/dev/usbharu/hideout/controller/mastodon/MastodonStatusesApiContoller.kt @@ -22,5 +22,5 @@ class MastodonStatusesApiContoller(private val statusesApiService: StatusesApiSe statusesApiService.postStatus(statusesRequest, jwt.getClaim("uid").toLong()), HttpStatus.OK ) - } + } } diff --git a/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt index 09d0c4a5..71d3e0e1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/mastodon/StatusQueryServiceImpl.kt @@ -11,8 +11,8 @@ import java.time.Instant @Repository class StatusQueryServiceImpl : StatusQueryService { + @Suppress("LongMethod") override suspend fun findByPostIds(ids: List): List { - val pairs = Posts.innerJoin(Users, onColumn = { userId }, otherColumn = { id }) .select { Posts.id inList ids } .map { @@ -98,7 +98,5 @@ class StatusQueryServiceImpl : StatusQueryService { it } } - - } } diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt b/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt index 96a69f36..3dcd35b1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepository.kt @@ -4,6 +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") 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 98674637..d4908948 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepositoryWrapper.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/MongoTimelineRepositoryWrapper.kt @@ -7,6 +7,7 @@ import kotlinx.coroutines.withContext import org.springframework.stereotype.Repository @Repository +@Suppress("InjectDispatcher") class MongoTimelineRepositoryWrapper( private val mongoTimelineRepository: MongoTimelineRepository, private val idGenerateService: IdGenerateService 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 c417a861..b4c260e1 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt @@ -38,6 +38,7 @@ interface APNoteService { } @Service +@Suppress("LongParameterList") class APNoteServiceImpl( private val httpClient: HttpClient, private val jobQueueParentService: JobQueueParentService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/TimelineApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/TimelineApiService.kt index 677b65ba..2dfc1f24 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/TimelineApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/mastodon/TimelineApiService.kt @@ -5,6 +5,7 @@ import dev.usbharu.hideout.service.core.Transaction import dev.usbharu.hideout.service.post.GenerateTimelineService import org.springframework.stereotype.Service +@Suppress("LongParameterList") interface TimelineApiService { suspend fun publicTimeline( localOnly: Boolean = false, @@ -25,7 +26,6 @@ interface TimelineApiService { ): List } - @Service class TimelineApiServiceImpl( private val generateTimelineService: GenerateTimelineService, diff --git a/src/main/kotlin/dev/usbharu/hideout/service/post/GenerateTimelineService.kt b/src/main/kotlin/dev/usbharu/hideout/service/post/GenerateTimelineService.kt index ea1a26a4..34f42678 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/post/GenerateTimelineService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/post/GenerateTimelineService.kt @@ -4,6 +4,7 @@ import dev.usbharu.hideout.domain.mastodon.model.generated.Status import org.springframework.stereotype.Service @Service +@Suppress("LongParameterList") interface GenerateTimelineService { suspend fun getTimeline( forUserId: Long? = null, @@ -14,5 +15,4 @@ interface GenerateTimelineService { sinceId: Long? = null, limit: Int = 20 ): List - } diff --git a/src/main/kotlin/dev/usbharu/hideout/service/post/MongoGenerateTimelineService.kt b/src/main/kotlin/dev/usbharu/hideout/service/post/MongoGenerateTimelineService.kt index 4c4a3808..fa5c9800 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/post/MongoGenerateTimelineService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/post/MongoGenerateTimelineService.kt @@ -23,8 +23,6 @@ class MongoGenerateTimelineService( sinceId: Long?, limit: Int ): List { - - val query = Query() if (forUserId != null) { val criteria = Criteria.where("userId").`is`(forUserId)