mirror of https://github.com/usbharu/Hideout.git
feat: ユーザーページに仮の情報を表示するように
This commit is contained in:
parent
7a11f3cd46
commit
48d49fe18d
|
@ -25,10 +25,10 @@ fun Application.configureRouting(
|
|||
routing {
|
||||
inbox(httpSignatureVerifyService, activityPubService)
|
||||
outbox()
|
||||
usersAP(activityPubUserService)
|
||||
usersAP(activityPubUserService,userService)
|
||||
webfinger(userService)
|
||||
|
||||
route("api/v1") {
|
||||
route("/api/v1") {
|
||||
statuses(postService)
|
||||
}
|
||||
|
||||
|
|
|
@ -3,14 +3,16 @@ package dev.usbharu.hideout.routing.activitypub
|
|||
import dev.usbharu.hideout.exception.ParameterNotExistException
|
||||
import dev.usbharu.hideout.plugins.respondAp
|
||||
import dev.usbharu.hideout.service.activitypub.ActivityPubUserService
|
||||
import dev.usbharu.hideout.service.impl.UserService
|
||||
import dev.usbharu.hideout.util.HttpUtil.Activity
|
||||
import dev.usbharu.hideout.util.HttpUtil.JsonLd
|
||||
import io.ktor.http.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.request.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
|
||||
fun Routing.usersAP(activityPubUserService: ActivityPubUserService) {
|
||||
fun Routing.usersAP(activityPubUserService: ActivityPubUserService,userService:UserService) {
|
||||
route("/users/{name}") {
|
||||
createChild(ContentTypeRouteSelector(ContentType.Application.Activity, ContentType.Application.JsonLd)).handle {
|
||||
val name =
|
||||
|
@ -21,6 +23,9 @@ fun Routing.usersAP(activityPubUserService: ActivityPubUserService) {
|
|||
HttpStatusCode.OK
|
||||
)
|
||||
}
|
||||
get {
|
||||
call.respondText(userService.findByName(call.parameters["name"]!!).toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import io.ktor.server.response.*
|
|||
import io.ktor.server.routing.*
|
||||
|
||||
fun Route.statuses(postService: IPostService) {
|
||||
route("statuses") {
|
||||
route("/statuses") {
|
||||
post {
|
||||
val status: StatusForPost = call.receive()
|
||||
val post = Post(
|
||||
|
|
Loading…
Reference in New Issue