Add response type
This commit is contained in:
parent
e95f73d94d
commit
17d681bd42
@ -1,5 +1,6 @@
|
||||
package ru.inr.mass.data.server
|
||||
|
||||
import io.ktor.http.ContentType
|
||||
import io.ktor.http.HttpStatusCode
|
||||
import io.ktor.server.application.Application
|
||||
import io.ktor.server.application.call
|
||||
@ -86,7 +87,7 @@ public fun Application.numassModule() {
|
||||
}
|
||||
|
||||
get("/repository") {
|
||||
call.respondText {
|
||||
call.respondText(ContentType.Application.Json) {
|
||||
visionManager.encodeToString(VisionOfNumassRepository(Name.EMPTY, repository))
|
||||
}
|
||||
}
|
||||
@ -106,7 +107,7 @@ public fun Application.numassModule() {
|
||||
return@get
|
||||
}
|
||||
|
||||
call.respondText {
|
||||
call.respondText(ContentType.Application.Json) {
|
||||
visionManager.encodeToString(VisionOfNumassSet(setName, set))
|
||||
}
|
||||
}
|
||||
@ -135,7 +136,7 @@ public fun Application.numassModule() {
|
||||
call.respondText(status = HttpStatusCode.NotFound) { "A point with name $setName/$pointIndex not found in the repository" }
|
||||
return@get
|
||||
}
|
||||
call.respondText {
|
||||
call.respondText(ContentType.Application.Json) {
|
||||
visionManager.encodeToString(point.toVision())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user