zmd50 4 years ago
parent 6da5e5e1c4
commit 3a036b1410

@ -47,7 +47,22 @@ public class OrderController {
return res;
}
//更新订单
//更新订单状态
@ResponseBody
@GetMapping("/updateorder")
public Result updateOrder(@RequestParam("orderid")String orderid,@RequestParam("state")int states){
int state=orderMapper.updateOrder(orderid,states);
if(state>0){
res.setCode(0);
res.setMsg("更新订单成功");
}
else{
res.setCode(-1);
res.setMsg("更新订单失败");
}
res.data=null;
return res;
}
//生成订单>>主键设为自增state默认设为0
@ResponseBody
@ -68,5 +83,20 @@ public class OrderController {
return res;
}
//删除订单
//删除订单>>根据订单号删除对应订单
@ResponseBody
@GetMapping("/deleteorder")
public Result deleteOrder(@RequestParam("orderid")String orderid){
int state=orderMapper.deleteOrder(orderid);
if(state>0){
res.setCode(0);
res.setMsg("删除订单成功");
}
else{
res.setCode(-1);
res.setMsg("删除订单失败");
}
res.data=null;
return res;
}
}

@ -1,4 +1,4 @@
server.port=8090
server.port=8099
spring.datasource.url=jdbc:mysql://localhost:3306/bookstore?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8

Loading…
Cancel
Save