From 1c23d47c352ef57bbd4a59e00d4d5b4585853f1e Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 15 十月 2020 09:53:25 +0800
Subject: [PATCH] 拼多多搜索bug

---
 fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
index a9c442d..2c838e0 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -79,10 +79,11 @@
      * @param sf
      * @return
      */
-    public static PDDGoodsResult searchGoods(PDDSearchFilter sf) {
+    public static PDDGoodsResult searchGoods(PDDSearchFilter sf, String customerParamters) {
         Gson gson = new GsonBuilder().disableHtmlEscaping().create();
         Map<String, String> map = new HashMap<>();
         map.put("type", "pdd.ddk.goods.search");
+        map.put("custom_parameters", customerParamters);
         if (sf.getOptId() != null)
             map.put("opt_id", sf.getOptId() + "");
         if (sf.getPage() != null)
@@ -110,6 +111,7 @@
 
         map.put("pid", PID_FANLI);
         String result = baseRequest(map);
+        System.out.println(result);
         JSONObject json = JSONObject.fromObject(result);
         JSONObject root = json.optJSONObject("goods_search_response");
         if (root == null) {
@@ -134,7 +136,7 @@
         Long[] ids = new Long[goodsIds.size()];
         goodsIds.toArray(ids);
         filter.setGoodsIdList(ids);
-        PDDGoodsResult result = searchGoods(filter);
+        PDDGoodsResult result = searchGoods(filter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
         if (result != null)
             return result.getGoodsList();
         return null;
@@ -349,7 +351,7 @@
      * @return
      */
     public static String getPromotionUrl(Long goodsId, String pid, String customParams) {
-        PDDPromotionUrl promotion = convert(goodsId, pid, customParams,false);
+        PDDPromotionUrl promotion = convert(goodsId, pid, customParams, false);
         if (promotion != null) {
             return promotion.getShortUrl();
         }

--
Gitblit v1.8.0