mirror of https://github.com/usbharu/Hideout.git
style: スタイルを修正
This commit is contained in:
parent
16fd6a017e
commit
6e6e2a911c
|
@ -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
|
||||
|
|
|
@ -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<UserResponse>
|
||||
|
||||
|
|
Loading…
Reference in New Issue