@Test public void testGetMerchantUsers() { BCQueryMerchantBuyerResult result = userService.getMerchantBuyers("test@beecloud.cn", null, null); Assert.assertTrue(result.getResultCode() == 0); if (result.getUsers() != null && result.getUsers().size() != 0) { System.out.println(result.getUsers().get(0).getBuyerId()); } }
public BCQueryMerchantBuyerResult getMerchantBuyers(String merchant, Long startTime, Long endTime) { Map<String, Object> reqMap = new HashMap<>(); if (merchant != null) { reqMap.put("email", merchant); } if (startTime != null) { reqMap.put("start_time", startTime); } if (endTime != null) { reqMap.put("end_time", endTime); } BCHttpClientUtil.attachAppSign(reqMap); Gson gson = new Gson(); String paramStr = null; try { paramStr = URLEncoder.encode(gson.toJson(reqMap), "UTF-8"); } catch (UnsupportedEncodingException ex) { Log.e("MerchantUser", "unexpected exception: " + ex.getMessage()); } String url = BCHttpClientUtil.BEECLOUD_HOST + "/2/rest/users?para=" + paramStr; BCHttpClientUtil.Response response = BCHttpClientUtil.httpGet(url); return (BCQueryMerchantBuyerResult) BCHttpClientUtil.dealWithResult(response, BCQueryMerchantBuyerResult.class); }
BCMerchantBuyerService { public BCQueryMerchantBuyerResult getMerchantBuyers(String merchant, Long startTime, Long endTime) { Map<String, Object> reqMap = new HashMap<>(); if (merchant != null) { reqMap.put("email", merchant); } if (startTime != null) { reqMap.put("start_time", startTime); } if (endTime != null) { reqMap.put("end_time", endTime); } BCHttpClientUtil.attachAppSign(reqMap); Gson gson = new Gson(); String paramStr = null; try { paramStr = URLEncoder.encode(gson.toJson(reqMap), "UTF-8"); } catch (UnsupportedEncodingException ex) { Log.e("MerchantUser", "unexpected exception: " + ex.getMessage()); } String url = BCHttpClientUtil.BEECLOUD_HOST + "/2/rest/users?para=" + paramStr; BCHttpClientUtil.Response response = BCHttpClientUtil.httpGet(url); return (BCQueryMerchantBuyerResult) BCHttpClientUtil.dealWithResult(response, BCQueryMerchantBuyerResult.class); } }
BCMerchantBuyerService { public BCQueryMerchantBuyerResult getMerchantBuyers(String merchant, Long startTime, Long endTime) { Map<String, Object> reqMap = new HashMap<>(); if (merchant != null) { reqMap.put("email", merchant); } if (startTime != null) { reqMap.put("start_time", startTime); } if (endTime != null) { reqMap.put("end_time", endTime); } BCHttpClientUtil.attachAppSign(reqMap); Gson gson = new Gson(); String paramStr = null; try { paramStr = URLEncoder.encode(gson.toJson(reqMap), "UTF-8"); } catch (UnsupportedEncodingException ex) { Log.e("MerchantUser", "unexpected exception: " + ex.getMessage()); } String url = BCHttpClientUtil.BEECLOUD_HOST + "/2/rest/users?para=" + paramStr; BCHttpClientUtil.Response response = BCHttpClientUtil.httpGet(url); return (BCQueryMerchantBuyerResult) BCHttpClientUtil.dealWithResult(response, BCQueryMerchantBuyerResult.class); }  }
BCMerchantBuyerService { public BCQueryMerchantBuyerResult getMerchantBuyers(String merchant, Long startTime, Long endTime) { Map<String, Object> reqMap = new HashMap<>(); if (merchant != null) { reqMap.put("email", merchant); } if (startTime != null) { reqMap.put("start_time", startTime); } if (endTime != null) { reqMap.put("end_time", endTime); } BCHttpClientUtil.attachAppSign(reqMap); Gson gson = new Gson(); String paramStr = null; try { paramStr = URLEncoder.encode(gson.toJson(reqMap), "UTF-8"); } catch (UnsupportedEncodingException ex) { Log.e("MerchantUser", "unexpected exception: " + ex.getMessage()); } String url = BCHttpClientUtil.BEECLOUD_HOST + "/2/rest/users?para=" + paramStr; BCHttpClientUtil.Response response = BCHttpClientUtil.httpGet(url); return (BCQueryMerchantBuyerResult) BCHttpClientUtil.dealWithResult(response, BCQueryMerchantBuyerResult.class); }  BCRestfulCommonResult addMerchantBuyer(String buyerId); BCRestfulCommonResult batchAddMerchantBuyers(String merchant, List<String> buyerIdList); BCQueryMerchantBuyerResult getMerchantBuyers(String merchant, Long startTime, Long endTime); }
BCMerchantBuyerService { public BCQueryMerchantBuyerResult getMerchantBuyers(String merchant, Long startTime, Long endTime) { Map<String, Object> reqMap = new HashMap<>(); if (merchant != null) { reqMap.put("email", merchant); } if (startTime != null) { reqMap.put("start_time", startTime); } if (endTime != null) { reqMap.put("end_time", endTime); } BCHttpClientUtil.attachAppSign(reqMap); Gson gson = new Gson(); String paramStr = null; try { paramStr = URLEncoder.encode(gson.toJson(reqMap), "UTF-8"); } catch (UnsupportedEncodingException ex) { Log.e("MerchantUser", "unexpected exception: " + ex.getMessage()); } String url = BCHttpClientUtil.BEECLOUD_HOST + "/2/rest/users?para=" + paramStr; BCHttpClientUtil.Response response = BCHttpClientUtil.httpGet(url); return (BCQueryMerchantBuyerResult) BCHttpClientUtil.dealWithResult(response, BCQueryMerchantBuyerResult.class); }  BCRestfulCommonResult addMerchantBuyer(String buyerId); BCRestfulCommonResult batchAddMerchantBuyers(String merchant, List<String> buyerIdList); BCQueryMerchantBuyerResult getMerchantBuyers(String merchant, Long startTime, Long endTime);  }