一、流程分析
二、接口实现
OrderService:
public interface OrderService { public Map<String,String> addOrder(String cids, Orders order) throws sqlException; public int updateOrderStatus(String orderId,String status); public ResultVO GetorderById(String orderId); }
OrderServiceImpl:
@Override public ResultVO GetorderById(String orderId) { Orders orders = ordersMapper.selectByPrimaryKey(orderId); return new ResultVO(Resstatus.OK,"success", orders.getStatus()); }
OrderController:
@GetMapping("/status/{oid}") public ResultVO getorderStatus(@PathVariable("oid") String orderId,@RequestHeader("token")String token){ ResultVO resultVO = orderService.GetorderById(orderId); return resultVO; }
三、接口测试