Browse Source

打印log

Gaosheng 2 days ago
parent
commit
908768d82b

+ 5 - 6
xinkeaboard-server/b2b2c-core/src/main/java/com/slodon/b2b2c/core/util/HttpClientUtil.java

@@ -1,7 +1,8 @@
 package com.slodon.b2b2c.core.util;
 
-import cn.hutool.core.io.FileUtil;
 import cn.hutool.http.HttpRequest;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpStatus;
 import org.apache.http.NameValuePair;
@@ -14,8 +15,6 @@ import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
-import org.apache.http.entity.mime.content.FileBody;
-import org.apache.http.entity.mime.content.StringBody;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.message.BasicNameValuePair;
@@ -28,11 +27,10 @@ import java.nio.charset.UnsupportedCharsetException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-
 /**
  * http请求工具类
  */
+@Slf4j
 public class HttpClientUtil {
 
     /**
@@ -188,8 +186,9 @@ public class HttpClientUtil {
             StringEntity stringEntity = new StringEntity(params, StandardCharsets.UTF_8);
             httpPost.setEntity(stringEntity);
         }
-
+        log.info("httpPost201 request:{}", JSONObject.toJSONString(httpPost));
         CloseableHttpResponse response = httpClient.execute(httpPost);
+        log.info("httpPost201 response:{}", JSONObject.toJSONString(response));
 
         try {
             if (response.getStatusLine().getStatusCode() == HttpStatus.SC_CREATED) {

+ 0 - 1
xinkeaboard-server/b2b2c-web/src/main/java/com/slodon/b2b2c/model/seller/StoreModel.java

@@ -444,7 +444,6 @@ public class StoreModel {
         try {
             result = HttpClientUtil.httpPost201(storeConfig.getUrl(), param.toString(), headers);
         } catch (Exception e) {
-            log.error(e.getMessage(), "获取店铺url信息表出错");
             throw new MallException("获取店铺url信息表失败,请重试");
         }
         JSONObject jsonObject = JSONUtil.parseObj(result);