fix get_image

This commit is contained in:
Elysia 2024-06-06 12:32:59 +08:00
parent 2db187e3d5
commit 1d6ac3e022

View File

@ -21,19 +21,19 @@ private fun formatFileName(file: String): String = file
fun Routing.fetchRes() { fun Routing.fetchRes() {
getOrPost("/get_record") { getOrPost("/get_record") {
val file = formatFileName( fetchGetOrThrow("file") ) val file = formatFileName( fetchOrThrow("file") )
val format = fetchOrThrow("out_format") val format = fetchOrThrow("out_format")
call.respondText(GetRecord(file, format), ContentType.Application.Json) call.respondText(GetRecord(file, format), ContentType.Application.Json)
} }
getOrPost("/get_file") { getOrPost("/get_file") {
val file = formatFileName( fetchGetOrThrow("file") ) val file = formatFileName( fetchOrThrow("file") )
val fileType = fetchOrThrow("file_type") val fileType = fetchOrThrow("file_type")
call.respondText(GetFile(file, fileType), ContentType.Application.Json) call.respondText(GetFile(file, fileType), ContentType.Application.Json)
} }
getOrPost("/get_image") { getOrPost("/get_image") {
val file = formatFileName( fetchGetOrThrow("file") ) val file = formatFileName( fetchOrThrow("file") )
call.respondText(GetImage(file), ContentType.Application.Json) call.respondText(GetImage(file), ContentType.Application.Json)
} }