admin
2024-04-26 5e7b0ed4a154ad067cbcf4aa1a1c7cce32f9864c
fanli/src/main/java/com/yeshi/fanli/util/vipshop/VipShopApiUtil.java
@@ -6,6 +6,7 @@
import java.net.URLEncoder;
import java.util.*;
import com.yeshi.fanli.util.Constant;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.PostMethod;
@@ -26,7 +27,7 @@
/**
 * TODO 未完成 唯品会接口
 *
 * 商品接口链接:https://vop.vip.com/home#/api/method/detail/com.vip.adp.api.open.service.UnionGoodsService-1.3.0/getByGoodsIds
 * @author Administrator
 */
public class VipShopApiUtil {
@@ -40,7 +41,8 @@
    /**
     * 获取签名
     *
     * @param params
     * @param systemParams
     * @param taskParams
     * @return
     */
    private static String getSign(Map<String, String> systemParams, JSONObject taskParams) {
@@ -141,6 +143,14 @@
        if (searchFilter.getFieldName() != null)
            taskParams.put("fieldName", searchFilter.getFieldName() + "");
        //新增参数
        taskParams.put("chanTag", "default_pid");
        taskParams.put("openId", "default_open_id");
        taskParams.put("realCall", "true");
        JSONObject root = new JSONObject();
        root.put("request", JSONObject.fromObject(taskParams));
        String result = baseRequest("com.vip.adp.api.open.service.UnionGoodsService", "query", root);
@@ -177,6 +187,11 @@
        taskParams.put("page", page + "");
        taskParams.put("pageSize", 20 + "");
        taskParams.put("requestId", System.currentTimeMillis() + "_" + UUID.randomUUID());
        //新增参数
        taskParams.put("chanTag", "default_pid");
        taskParams.put("openId", "default_open_id");
        taskParams.put("realCall", "true");
        JSONObject root = new JSONObject();
@@ -263,6 +278,13 @@
        JSONObject params = new JSONObject();
        params.put("goodsIdList", goodsIdList);
        params.put("requestId", UUID.randomUUID());
        //新增参数
        params.put("chanTag", "default_pid");
        JSONObject request = new JSONObject();
        request.put("openId", "default_open_id");
        request.put("realCall", "true");
        params.put("request", request);
        String result = baseRequest("com.vip.adp.api.open.service.UnionGoodsService", "getByGoodsIds",
                JSONObject.fromObject(params));
        System.out.println(result);
@@ -319,9 +341,17 @@
    }
    public static void main(String[] args) {
//        VIPSearchFilter sf=new VIPSearchFilter();
//        sf.setKeyword("花卉");
//        sf.setPage(1);
//        sf.setPageSize(Constant.PAGE_SIZE);
//        search(sf);
        getGoodsDetail("6920553939593155215");
//        convertLinkByUrl("https://t.vip.com/T7RyKKCJLj9", "437032");
//        convertLink("560392904","437032");
        getOrderList(VipShopOrderQueryModel.createOrderSn(Arrays.asList(new String[]{"23090254293903"}),1));
//        getOrderList(VipShopOrderQueryModel.createOrderSn(Arrays.asList(new String[]{"23090254293903"}),1));
    }
}