fix🛠️: 修改bill api
This commit is contained in:
parent
7e3e2ff227
commit
7c41b42fb1
|
@ -40,7 +40,6 @@ fun Route.billRoute() {
|
|||
}.onSuccess {
|
||||
call.respond(Resp.Ok(it).json())
|
||||
}.onFailure {
|
||||
it.printStackTrace()
|
||||
call.respond(Resp.Error(it.message, code = -1).json())
|
||||
}
|
||||
}
|
||||
|
@ -57,9 +56,14 @@ fun Route.billRoute() {
|
|||
}
|
||||
|
||||
put("/") {
|
||||
val bill = call.receive<BillVO>().bill()
|
||||
val count = billService.updateOneBill(bill)
|
||||
call.respond(status = HttpStatusCode.OK, Resp.Ok(count).json())
|
||||
runCatching {
|
||||
val bill = call.receive<BillVO>().bill()
|
||||
billService.updateOneBill(bill)
|
||||
}.onSuccess {
|
||||
call.respond(status = HttpStatusCode.OK, Resp.Ok(it).json())
|
||||
}.onFailure {
|
||||
call.respond(Resp.Error(it.message).json())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user