记得上下班打卡 | git大法好,push需谨慎

Commit ea50daca authored by anjiabin's avatar anjiabin

微信支付增加日志

parent fee1d2ba
...@@ -23,6 +23,7 @@ import org.apache.http.HttpEntity; ...@@ -23,6 +23,7 @@ import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -77,9 +78,15 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy { ...@@ -77,9 +78,15 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
HttpPost httpost = new HttpPost(this.getRequestUrl()); HttpPost httpost = new HttpPost(this.getRequestUrl());
httpost.setEntity(new StringEntity(data, "UTF-8")); httpost.setEntity(new StringEntity(data, "UTF-8"));
startTime = System.currentTimeMillis();
CloseableHttpClient httpClient = PayWepayUtils.getInstance().getHttpClient();
log.info("wepay-->request--> getHttpClient耗时:{}",(System.currentTimeMillis() - startTime)+"毫秒");
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
CloseableHttpResponse response = PayWepayUtils.getInstance().getHttpClient().execute(httpost); CloseableHttpResponse response = httpClient.execute(httpost);
log.info("wepay-->request--> 耗时:{}",(System.currentTimeMillis() - startTime)+"毫秒"); log.info("wepay-->request--> execute耗时:{}",(System.currentTimeMillis() - startTime)+"毫秒");
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
//接受到返回信息 //接受到返回信息
String xmlStr = EntityUtils.toString(response.getEntity(), "UTF-8"); String xmlStr = EntityUtils.toString(response.getEntity(), "UTF-8");
......
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