|
@@ -89,14 +89,13 @@ public class GWHttpUtilsTest65 {
|
|
|
|
|
|
|
|
|
public static String encrypt(String path, String orderCode) {
|
|
|
+ log.info("******* ENCRYPT START *******");
|
|
|
+ System.out.println("=========path=====:" + path);
|
|
|
// 请求参数
|
|
|
- String json = "{\n" +
|
|
|
- " \"fileUrls\": [\n\"" +
|
|
|
-// " \"/15000000005/ThirdAlarm/pic/ZGTT-1717140001_d9b78c489b0f4263b2accee140f12d83a8e66c4bc69c4d70b929762f033c63d5_02_001.jpg\",\n" +
|
|
|
- path +
|
|
|
- "\" ]\n" +
|
|
|
- "}";
|
|
|
- return callServer(json, orderCode);
|
|
|
+ String[] files = path.split(",");
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("fileUrls", files);
|
|
|
+ return callServer(json.toJSONString(), orderCode);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -115,7 +114,6 @@ public class GWHttpUtilsTest65 {
|
|
|
// 大部分报错 signature value is error! 都是加密失败造成的,请仔细检查 AK, SK, path 是否正确
|
|
|
String signContext = getSignContext(servicePath, AK, msgId, requestTime, customer, userCode);
|
|
|
String sign = getGenerateSign(SK, signContext);
|
|
|
- System.out.println("=========sign=====:" + sign);
|
|
|
|
|
|
// ********模拟请求头参数,以下参数为通用必填参数************
|
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
@@ -127,6 +125,17 @@ public class GWHttpUtilsTest65 {
|
|
|
headerMap.put("X-UserCode", userCode);
|
|
|
headerMap.put("X-AppCode", appCode);
|
|
|
headerMap.put("X-OrderCode", orderCode);
|
|
|
+
|
|
|
+ log.info("=========AppKey=====:" + AK);
|
|
|
+ log.info("=========Signature=====:" + sign);
|
|
|
+ log.info("=========MsgId=====:" + msgId);
|
|
|
+ log.info("=========RequestTime=====:" + requestTime);
|
|
|
+ log.info("=========CustomerCode=====:" + customer);
|
|
|
+ log.info("=========UserCode=====:" + userCode);
|
|
|
+ log.info("=========AppCode=====:" + appCode);
|
|
|
+ log.info("=========OrderCode=====:" + orderCode);
|
|
|
+ log.info("=========params=====:" + json);
|
|
|
+ log.info("******* ENCRYPT END *******");
|
|
|
HttpResponse response = postObject(url, json, headerMap);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(response.body());
|
|
|
return jsonObject.getJSONArray("data").getJSONObject(0).getString("encryptUrl");
|