|
|
@ -87,7 +87,6 @@ public class RegionTest { |
|
|
|
tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA"); |
|
|
|
tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA"); |
|
|
|
tokenMap.put("appSecret", "R7yJjinikdPhOlTrVgmdS7cblWMMOf99zEJkfPgaTIoDtKGlX51JKueLV725a6S4"); |
|
|
|
tokenMap.put("appSecret", "R7yJjinikdPhOlTrVgmdS7cblWMMOf99zEJkfPgaTIoDtKGlX51JKueLV725a6S4"); |
|
|
|
JSONObject jsonObject = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/api/open/merchant/token", JSON.toJSONString(tokenMap)); |
|
|
|
JSONObject jsonObject = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/api/open/merchant/token", JSON.toJSONString(tokenMap)); |
|
|
|
System.out.println(jsonObject.toJSONString()); |
|
|
|
|
|
|
|
if (jsonObject != null && jsonObject.getBoolean("success") == true) { |
|
|
|
if (jsonObject != null && jsonObject.getBoolean("success") == true) { |
|
|
|
JSONObject data = jsonObject.getJSONObject("data"); |
|
|
|
JSONObject data = jsonObject.getJSONObject("data"); |
|
|
|
String token = data.getString("token"); |
|
|
|
String token = data.getString("token"); |
|
|
@ -98,20 +97,21 @@ public class RegionTest { |
|
|
|
bodyMap.put("pageSize", 10); |
|
|
|
bodyMap.put("pageSize", 10); |
|
|
|
bodyMap.put("startTime", "2021-3-31 00:00:00"); |
|
|
|
bodyMap.put("startTime", "2021-3-31 00:00:00"); |
|
|
|
bodyMap.put("endTime", "2021-3-31 23:00:00"); |
|
|
|
bodyMap.put("endTime", "2021-3-31 23:00:00"); |
|
|
|
bodyMap.put("customerCode", "48464274"); |
|
|
|
//bodyMap.put("customerCode", "48464274");
|
|
|
|
|
|
|
|
bodyMap.put("customerCode", "hAFO76ZqXmIqosNw3PTAP4wxGJTN7MPawSU0QFDzzNioLjKMEaVFDlNKRIQX6n0DgyoVMy170T0b13P8uUTAQsbk9UNRPFO5i0fWp1hHOhNdaaQ2BdC0WXQz5QQ5epyK"); |
|
|
|
|
|
|
|
|
|
|
|
String signature = "hAFO76ZqXmIqosNw3PTAP4wxGJTN7MPawSU0QFDzzNioLjKMEaVFDlNKRIQX6n0DgyoVMy170T0b13P8uUTAQsbk9UNRPFO5i0fWp1hHOhNdaaQ2BdC0WXQz5QQ5epyK"; |
|
|
|
String signature = "hAFO76ZqXmIqosNw3PTAP4wxGJTN7MPawSU0QFDzzNioLjKMEaVFDlNKRIQX6n0DgyoVMy170T0b13P8uUTAQsbk9UNRPFO5i0fWp1hHOhNdaaQ2BdC0WXQz5QQ5epyK"; |
|
|
|
|
|
|
|
|
|
|
|
Long date = new Date().getTime(); |
|
|
|
Long date = new Date().getTime(); |
|
|
|
String sha256 = encodeBySHA256(signature + JSON.toJSONString(bodyMap) + date); |
|
|
|
String sha256 = encodeBySHA256(signature + JSON.toJSONString(bodyMap) + date); |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> headerMap = new HashMap<>(); |
|
|
|
/* Map<String,Object> headerMap = new HashMap<>(); |
|
|
|
headerMap.put("token", token); |
|
|
|
headerMap.put("token", token); |
|
|
|
headerMap.put("sign", sha256); |
|
|
|
headerMap.put("sign", sha256); |
|
|
|
headerMap.put("ts", date); |
|
|
|
headerMap.put("ts", date);*/ |
|
|
|
//map2.put("sign", sha256);
|
|
|
|
//map2.put("sign", sha256);
|
|
|
|
HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token,sha256 ,date); |
|
|
|
JSONObject object = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token, sha256, date); |
|
|
|
//System.out.println(jsonObject.toJSONString());
|
|
|
|
System.out.println(JSON.toJSONString(object)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|