| | |
| | | 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; |
| | |
| | | |
| | | /** |
| | | * 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 { |
| | |
| | | /** |
| | | * 获取签名 |
| | | * |
| | | * @param params |
| | | * @param systemParams |
| | | * @param taskParams |
| | | * @return |
| | | */ |
| | | private static String getSign(Map<String, String> systemParams, JSONObject taskParams) { |
| | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | 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); |
| | |
| | | } |
| | | |
| | | 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)); |
| | | } |
| | | |
| | | } |