From 7ad7905f32ef6b2d67bbd45260a0413be904fa8d Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期五, 20 九月 2019 14:33:08 +0800 Subject: [PATCH] 品牌 、金币任务bug --- fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java | 40 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 39 insertions(+), 1 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 c294d5a..136122b 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 @@ -21,6 +21,8 @@ import com.yeshi.fanli.dto.pdd.PDDOrderResult; import com.yeshi.fanli.dto.pdd.PDDPromotionUrl; import com.yeshi.fanli.dto.pdd.PDDSearchFilter; +import com.yeshi.fanli.dto.pdd.PDDShopDetail; +import com.yeshi.fanli.dto.pdd.PDDShopResult; import com.yeshi.fanli.entity.pdd.PDDOrder; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; @@ -98,7 +100,8 @@ map.put("keyword", sf.getKw()); if (sf.getGoodsIdList() != null) map.put("goods_id_list", "[" + StringUtil.concat(sf.getGoodsIdList(), ",") + "]"); - + if (sf.getMerchantType() != null) + map.put("merchant_type", sf.getMerchantType() + ""); map.put("pid", PID_FANLI); String result = baseRequest(map); JSONObject json = JSONObject.fromObject(result); @@ -432,4 +435,39 @@ return null; } + + /** + * 鑾峰彇鍟嗗搧璇︽儏 + * + * @param goodsId + */ + public static PDDShopResult getShopList(Integer page,Long catId) { + JSONArray arrayType = new JSONArray(); + arrayType.add(3); + + Map<String, String> map = new HashMap<>(); + map.put("type", "pdd.ddk.merchant.list.get"); + if (catId != null) + map.put("cat_id", catId +""); + if (page != null) + map.put("page_number", page +""); + + if (page != null) + map.put("page_number", page +""); + + map.put("merchant_type_list", arrayType.toString()); + + String result = baseRequest(map); + JSONObject resultJson = JSONObject.fromObject(result); + JSONObject root = resultJson.optJSONObject("merchant_list_response"); + if (root != null) { + int totalCount = root.optInt("total"); + + JSONArray array = root.optJSONArray("mall_search_info_vo_list"); + Type type = new TypeToken<List<PDDShopDetail>>() {}.getType(); + List<PDDShopDetail> listShop = new Gson().fromJson(array.toString(), type); + return new PDDShopResult(totalCount, listShop); + } + return null; + } } -- Gitblit v1.8.0