Merge pull request #325 from StarryKira/v1.0.9

fix get_image
This commit is contained in:
伏秋洛 2024-06-06 12:44:10 +08:00 committed by GitHub
commit be9ff46134
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)
} }