diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt b/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt index 8543e9a7..0d0dbea5 100644 --- a/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt +++ b/src/main/kotlin/dev/usbharu/hideout/routing/activitypub/UserRouting.kt @@ -28,10 +28,7 @@ fun Routing.usersAP( val name = call.parameters["name"] ?: throw ParameterNotExistException("Parameter(name='name') does not exist.") val person = apUserService.getPersonByName(name) - return@handle call.respondAp( - person, - HttpStatusCode.OK - ) + return@handle call.respondAp(person, HttpStatusCode.OK) } get { // TODO: 暫定処置なので治す @@ -43,7 +40,8 @@ fun Routing.usersAP( ) val personByName = apUserService.getPersonByName(userEntity.name) call.respondText( - userEntity.toString() + "\n" + followerQueryService.findFollowersById(userEntity.id) + "\n" + Config.configData.objectMapper.writeValueAsString( + userEntity.toString() + "\n" + followerQueryService.findFollowersById(userEntity.id) + + "\n" + Config.configData.objectMapper.writeValueAsString( personByName ) ) @@ -56,9 +54,7 @@ class ContentTypeRouteSelector(private vararg val contentType: ContentType) : Ro override fun evaluate(context: RoutingResolveContext, segmentIndex: Int): RouteSelectorEvaluation { context.call.application.log.debug("Accept: ${context.call.request.accept()}") val requestContentType = context.call.request.accept() ?: return RouteSelectorEvaluation.FailedParameter - return if (requestContentType.split(",") - .any { contentType.any { contentType -> contentType.match(it) } } - ) { + return if (requestContentType.split(",").any { contentType.any { contentType -> contentType.match(it) } }) { RouteSelectorEvaluation.Constant } else { RouteSelectorEvaluation.FailedParameter 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 19636971..8fed3222 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/api/UserApiService.kt @@ -12,6 +12,7 @@ import dev.usbharu.hideout.service.user.UserService import org.koin.core.annotation.Single import kotlin.math.min +@Suppress("TooManyFunctions") interface UserApiService { suspend fun findAll(limit: Int? = 100, offset: Long = 0): List