fix🛠️: 修改bill api
This commit is contained in:
parent
7e3e2ff227
commit
7c41b42fb1
|
@ -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("/") {
|
||||||
val bill = call.receive<BillVO>().bill()
|
runCatching {
|
||||||
val count = billService.updateOneBill(bill)
|
val bill = call.receive<BillVO>().bill()
|
||||||
call.respond(status = HttpStatusCode.OK, Resp.Ok(count).json())
|
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