document
API test

更新订单状态

POST

Description or Example

# 核心代码 ```java @RequestMapping("/updateStatus/byOrderSn/{orderSn}") public R updateOrderStatus(@PathVariable String orderSn) { try { Boolean isSuccess = orderService.updateOrderStatusByOrderSn(orderSn); if (isSuccess) return R.ok(); return R.error("更新失败"); }catch (Exception e) { return R.error("更新失败"); } } ``` ```java public Boolean updateOrderStatusByOrderSn(String orderSn) { LambdaUpdateWrapper<OrderEntity> updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.eq(OrderEntity::getOrderSn, orderSn).set(OrderEntity::getStatus, OrderStatusEnum.CANCLED.getCode()); return this.update(updateWrapper); } ```