Commit 9c36f6fc authored by 张庆's avatar 张庆

新增挡板规则

parent b8840859
......@@ -27,23 +27,26 @@ public class AbcHttpClient {
public JsonResult postRequest(String paramJson, String method) {
try {
final String url = posetUrl+method;
final String url = posetUrl + method;
AbcRequest request = AbcRsaUtil.encodeParam(paramJson, ypdPublicKey, appId, privateKey);
log.info("请求浙农request:{}, url:{}", JSON.toJSONString(request), url);
log.info("请求浙农未加密数据:{}", JSON.toJSONString(paramJson));
log.info("请求浙农加密数据:{}", JSON.toJSONString(request));
log.info("请求浙农url:{}", url);
HttpResponse response = HttpRequest.post(url).body(JSON.toJSONString(request)).setConnectionTimeout(5000).execute();
log.info("浙农加密返回数据:{}", JSON.toJSONString(response.body()));
if (response.getStatus() == 200 && StringUtils.isNotBlank(response.body())) {
final String body = response.body();
log.info("请求浙农response:{}", body);
JSONObject responseJson = JSONObject.parseObject(body);
String content = responseJson.getString("content");
String sign = responseJson.getString("sign");
String responseParam = AbcRsaUtil.decodeParam(content, sign, privateKey, ypdPublicKey);
log.info("浙农解密返回数据:{}", JSON.toJSONString(responseParam));
return JSONObject.parseObject(responseParam, JsonResult.class);
} else {
throw new Exception("请求异常");
}
} catch (Exception e) {
log.error("请求浙农异常:{}",e.getMessage(),e);
log.error("请求浙农异常:{}", e.getMessage(), e);
return null;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment