From 5969371a40d037cf6f18b5080e9bfda82316e8b0 Mon Sep 17 00:00:00 2001 From: usbharu Date: Thu, 12 Sep 2024 17:53:29 +0000 Subject: [PATCH] style: fix lint (CI) --- .../hideout/core/config/SpringMvcConfig.kt | 2 +- .../ApplicationRequestLogInterceptor.kt | 4 +- .../timeline/MastodonReadTimeline.kt | 4 +- .../MastodonReadTimelineApplicationService.kt | 135 +++++++++--------- .../interfaces/api/SpringTimelineApi.kt | 3 +- 5 files changed, 74 insertions(+), 74 deletions(-) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/SpringMvcConfig.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/SpringMvcConfig.kt index 0294603a..696e7fca 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/SpringMvcConfig.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/config/SpringMvcConfig.kt @@ -49,7 +49,7 @@ class MvcConfigurer( fun mdcFilter(): FilterRegistrationBean { val bean = FilterRegistrationBean() bean.filter = MDCInsertingServletFilter() - bean.addUrlPatterns("/*"); + bean.addUrlPatterns("/*") bean.order = Int.MIN_VALUE return bean } diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt index c6986456..9f42749b 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/ApplicationRequestLogInterceptor.kt @@ -30,8 +30,6 @@ class ApplicationRequestLogInterceptor : AsyncHandlerInterceptor { } } - - if (userDetailId != null) { MDC.put(userId, userDetailId.toString()) } @@ -69,4 +67,4 @@ class ApplicationRequestLogInterceptor : AsyncHandlerInterceptor { const val handler: String = "handler" private val logger = LoggerFactory.getLogger(ApplicationRequestLogInterceptor::class.java) } -} \ No newline at end of file +} diff --git a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimeline.kt b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimeline.kt index 4d76bda5..737cfabf 100644 --- a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimeline.kt +++ b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimeline.kt @@ -8,6 +8,4 @@ class MastodonReadTimeline( val localOnly: Boolean, val remoteOnly: Boolean, val page: Page -) { - -} +) diff --git a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimelineApplicationService.kt b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimelineApplicationService.kt index be0319c8..770cb239 100644 --- a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimelineApplicationService.kt +++ b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/application/timeline/MastodonReadTimelineApplicationService.kt @@ -38,75 +38,78 @@ class MastodonReadTimelineApplicationService( val readTimeline = timelineStore.readTimeline(timeline, readTimelineOption, command.page, principal) - return PaginationList(readTimeline.map { - Status( - it.postId.id.toString(), - it.post.url.toString(), - it.post.createdAt.toString(), - account = Account( - id = it.postActor.id.id.toString(), - username = it.postActor.name.name, - acct = Acct(it.postActor.name.name, it.postActor.domain.domain).toString(), - url = it.postActor.url.toString(), - displayName = it.postActor.screenName.screenName, - note = it.postActor.description.description, - avatar = it.postActorIconMedia?.url.toString(), - avatarStatic = it.postActorIconMedia?.thumbnailUrl.toString(), - header = "", - headerStatic = "", - locked = false, - fields = emptyList(), + return PaginationList( + readTimeline.map { + Status( + it.postId.id.toString(), + it.post.url.toString(), + it.post.createdAt.toString(), + account = Account( + id = it.postActor.id.id.toString(), + username = it.postActor.name.name, + acct = Acct(it.postActor.name.name, it.postActor.domain.domain).toString(), + url = it.postActor.url.toString(), + displayName = it.postActor.screenName.screenName, + note = it.postActor.description.description, + avatar = it.postActorIconMedia?.url.toString(), + avatarStatic = it.postActorIconMedia?.thumbnailUrl.toString(), + header = "", + headerStatic = "", + locked = false, + fields = emptyList(), + emojis = emptyList(), + bot = false, + group = false, + discoverable = true, + createdAt = it.postActor.createdAt.toString(), + statusesCount = it.postActor.postsCount.postsCount, + noindex = true, + moved = it.postActor.moveTo != null, + suspended = it.postActor.suspend, + limited = false, + lastStatusAt = it.postActor.lastPostAt?.toString(), + followersCount = it.postActor.followersCount?.relationshipCount, + followingCount = it.postActor.followingCount?.relationshipCount, + ), + content = it.post.content.content, + visibility = when (it.post.visibility) { + PUBLIC -> Status.Visibility.public + UNLISTED -> Status.Visibility.unlisted + FOLLOWERS -> Status.Visibility.private + DIRECT -> Status.Visibility.direct + }, + sensitive = it.post.sensitive, + spoilerText = it.post.overview?.overview.orEmpty(), + mediaAttachments = it.postMedias.map { MediaAttachment(it.id.id.toString()) }, + mentions = emptyList(), + tags = emptyList(), emojis = emptyList(), - bot = false, - group = false, - discoverable = true, - createdAt = it.postActor.createdAt.toString(), - statusesCount = it.postActor.postsCount.postsCount, - noindex = true, - moved = it.postActor.moveTo != null, - suspended = it.postActor.suspend, - limited = false, - lastStatusAt = it.postActor.lastPostAt?.toString(), - followersCount = it.postActor.followersCount?.relationshipCount, - followingCount = it.postActor.followingCount?.relationshipCount, - ), - content = it.post.content.content, - visibility = when (it.post.visibility) { - PUBLIC -> Status.Visibility.public - UNLISTED -> Status.Visibility.unlisted - FOLLOWERS -> Status.Visibility.private - DIRECT -> Status.Visibility.direct - }, - sensitive = it.post.sensitive, - spoilerText = it.post.overview?.overview.orEmpty(), - mediaAttachments = it.postMedias.map { MediaAttachment(it.id.id.toString()) }, - mentions = emptyList(), - tags = emptyList(), - emojis = emptyList(), - reblogsCount = 0, - favouritesCount = it.reactionsList.sumOf { it.count }, - repliesCount = 0, - url = it.post.url.toString(), - text = it.post.content.text, - application = null, - inReplyToId = it.replyPost?.id?.toString(), - inReplyToAccountId = it.replyPostActor?.id?.toString(), - reblog = null, - poll = null, - card = null, - language = null, - editedAt = null, - favourited = it.favourited, - reblogged = false, - muted = false, - bookmarked = false, - pinned = false, - filtered = emptyList(), - ) - }, readTimeline.next?.id, readTimeline.prev?.id) + reblogsCount = 0, + favouritesCount = it.reactionsList.sumOf { it.count }, + repliesCount = 0, + url = it.post.url.toString(), + text = it.post.content.text, + application = null, + inReplyToId = it.replyPost?.id?.toString(), + inReplyToAccountId = it.replyPostActor?.id?.toString(), + reblog = null, + poll = null, + card = null, + language = null, + editedAt = null, + favourited = it.favourited, + reblogged = false, + muted = false, + bookmarked = false, + pinned = false, + filtered = emptyList(), + ) + }, + readTimeline.next?.id, readTimeline.prev?.id + ) } companion object { private val logger = LoggerFactory.getLogger(MastodonReadTimelineApplicationService::class.java) } -} \ No newline at end of file +} diff --git a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringTimelineApi.kt b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringTimelineApi.kt index f3cc511c..081eae11 100644 --- a/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringTimelineApi.kt +++ b/hideout-mastodon/src/main/kotlin/dev/usbharu/hideout/mastodon/interfaces/api/SpringTimelineApi.kt @@ -68,7 +68,8 @@ class SpringTimelineApi( minId?.toLongOrNull(), limit ) - ), principal + ), + principal ).asFlow() ) }