Orders { public List<Order> query(Integer status, Date start, Date end) { String url = WxEndpoint.get("shop.order.query"); Map<String, Object> map = new HashMap<>(); if (status != null) map.put("status", status); if (start != null) map.put("begintime", start.getTime() / 1000); if (end != null) map.put("endtime", start.getTime() / 1000); String body = JsonMapper.defaultMapper().toJson(map); logger.debug("shop: query orders: {}", body); String response = wxClient.post(url, body); OrderList orderList = JsonMapper.defaultMapper().fromJson(response, OrderList.class); return orderList.getOrders(); }  static Orders defaultOrders(); static Orders with(AppSetting appSetting); void setWxClient(WxClient wxClient); Order get(String id); List<Order> query(Integer status, Date start, Date end);  }
@Test public void testQuery(){ Calendar end = Calendar.getInstance(); Calendar start = Calendar.getInstance(); start.add(Calendar.MONTH, -1); List<Order> orders = Orders.defaultOrders().query(null, start.getTime(), null); }