<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
public JsonRespone alipayAesDecrypt(String response) {
Map<String, String> openapiResult = null;
try{
openapiResult = JSON.parseObject(response,new TypeReference<Map<String, String>>() {}, Feature.OrderedField);
} catch (Exception e){
logger.error("参数解析失败:"+e.getMessage());
}
String strJson = openapiResult.get("节点名称");
return strJson
}
public static String postReceive(HttpServletRequest request)throws IOException {
ByteArrayOutputStream inBuffer = new ByteArrayOutputStream();
InputStream input = request.getInputStream();
byte[] tmp = new byte[1024];
int len = 0;
while ((len = input.read(tmp)) > 0) {
inBuffer.write(tmp, 0, len);
}
byte[] buffer = inBuffer.toByteArray();
String requestJsonStr = new String(buffer, "UTF-8");
return requestJsonStr;
}