mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
commit
be9ff46134
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user