fix🛠️: 修改bill api

This commit is contained in:
车厘子 2022-12-09 17:54:06 +08:00
parent 7e3e2ff227
commit 7c41b42fb1

View File

@ -40,7 +40,6 @@ fun Route.billRoute() {
}.onSuccess { }.onSuccess {
call.respond(Resp.Ok(it).json()) call.respond(Resp.Ok(it).json())
}.onFailure { }.onFailure {
it.printStackTrace()
call.respond(Resp.Error(it.message, code = -1).json()) call.respond(Resp.Error(it.message, code = -1).json())
} }
} }
@ -57,9 +56,14 @@ fun Route.billRoute() {
} }
put("/") { put("/") {
runCatching {
val bill = call.receive<BillVO>().bill() val bill = call.receive<BillVO>().bill()
val count = billService.updateOneBill(bill) billService.updateOneBill(bill)
call.respond(status = HttpStatusCode.OK, Resp.Ok(count).json()) }.onSuccess {
call.respond(status = HttpStatusCode.OK, Resp.Ok(it).json())
}.onFailure {
call.respond(Resp.Error(it.message).json())
}
} }
} }
} }