admin
2020-11-28 dc5be7d38446f70e6ff86df311119c32b41fe7f8
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;
@@ -307,6 +309,18 @@
        return null;
    }
    public static PDDPromotionUrl convertResourceUrl(String pid) {
        Map<String, String> map = new HashMap<>();
        map.put("type", "pdd.ddk.resource.url.gen");
        map.put("pid", pid);
        map.put("resource_type", "39998");
        map.put("url", "https://mobile.yangkeduo.com/attendance.html?_pdd_fs=1&_pdd_tc=ffffff&_pdd_sbs=1&type=1&id=155075");
        String result = baseRequest(map);
        System.out.println(result);
        return null;
    }
    /**
     * 微信小程序转链 @Title: convertWXMP @Description: @param goodsId @param
     * pid @param customParams @return PDDPromotionUrl 返回类型 @throws
@@ -349,7 +363,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();
        }
@@ -386,6 +400,7 @@
        map.put("page", page + "");
        map.put("page_size", pageSize + "");
        String result = baseRequest(map);
        System.out.println(result);
        JSONObject json = JSONObject.fromObject(result);
        JSONObject root = json.optJSONObject("order_list_get_response");
        if (root != null) {