From b40b22a6e9092af2e2dcc74e825028dd6e13be17 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Tue, 15 Aug 2023 01:42:17 +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=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/dev/usbharu/hideout/domain/model/ap/Person.kt | 2 -- src/main/kotlin/dev/usbharu/hideout/plugins/StatusPages.kt | 1 - .../kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt | 1 - .../dev/usbharu/hideout/service/api/UserApiService.kt | 6 ++---- src/main/kotlin/dev/usbharu/hideout/util/CollectionUtil.kt | 3 +-- 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Person.kt b/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Person.kt index 93f3f4cf..5c7f1176 100644 --- a/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Person.kt +++ b/src/main/kotlin/dev/usbharu/hideout/domain/model/ap/Person.kt @@ -10,7 +10,6 @@ open class Person : Object { var publicKey: Key? = null var endpoints: Map = emptyMap() - protected constructor() : super() @Suppress("LongParameterList") @@ -66,5 +65,4 @@ open class Person : Object { result = 31 * result + endpoints.hashCode() return result } - } diff --git a/src/main/kotlin/dev/usbharu/hideout/plugins/StatusPages.kt b/src/main/kotlin/dev/usbharu/hideout/plugins/StatusPages.kt index 68b1f541..e0305692 100644 --- a/src/main/kotlin/dev/usbharu/hideout/plugins/StatusPages.kt +++ b/src/main/kotlin/dev/usbharu/hideout/plugins/StatusPages.kt @@ -7,7 +7,6 @@ import io.ktor.server.plugins.statuspages.* import io.ktor.server.response.* fun Application.configureStatusPages() { - install(StatusPages) { exception { call, cause -> call.respondText(text = "400: $cause", status = HttpStatusCode.BadRequest) 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 77d06bb5..255c9804 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt @@ -137,7 +137,6 @@ class APNoteServiceImpl( targetActor ) - val visibility = if (note.to.contains(public) && note.cc.contains(public)) { Visibility.PUBLIC diff --git a/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt b/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt index 4cdf8ac7..19636971 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt @@ -46,7 +46,6 @@ class UserApiServiceImpl( userQueryService.findAll(min(limit ?: 100, 100), offset).map { UserResponse.from(it) } } - override suspend fun findById(id: Long): UserResponse = transaction.transaction { UserResponse.from(userQueryService.findById(id)) } @@ -71,7 +70,6 @@ class UserApiServiceImpl( followerQueryService.findFollowersById(userId).map { UserResponse.from(it) } } - override suspend fun findFollowings(userId: Long): List = transaction.transaction { followerQueryService.findFollowingById(userId).map { UserResponse.from(it) } } @@ -86,7 +84,6 @@ class UserApiServiceImpl( .map { UserResponse.from(it) } } - override suspend fun createUser(username: String, password: String): UserResponse { return transaction.transaction { if (userQueryService.existByNameAndDomain(username, Config.configData.domain)) { @@ -108,7 +105,8 @@ class UserApiServiceImpl( userQueryService.findByNameAndDomain( targetAcct.username, targetAcct.domain ?: Config.configData.domain - ).id, sourceId + ).id, + sourceId ) } } diff --git a/src/main/kotlin/dev/usbharu/hideout/util/CollectionUtil.kt b/src/main/kotlin/dev/usbharu/hideout/util/CollectionUtil.kt index 6f418646..3c0f74ed 100644 --- a/src/main/kotlin/dev/usbharu/hideout/util/CollectionUtil.kt +++ b/src/main/kotlin/dev/usbharu/hideout/util/CollectionUtil.kt @@ -1,7 +1,6 @@ package dev.usbharu.hideout.util -class CollectionUtil { -} +class CollectionUtil fun Iterable.singleOr(block: (e: RuntimeException) -> Throwable): T { return try {