| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | import org.fanli.TaoKeTest;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | map.put("method", "taobao.tbk.item.info.get");
|
| | | map.put("num_iids", id + "");
|
| | | String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true);
|
| | | // System.out.println(resultStr);
|
| | | JSONObject data = JSONObject.fromObject(resultStr);
|
| | | // 商品下架
|
| | | if (data.optJSONObject("error_response") != null && data.optJSONObject("error_response").optInt("code") == 15
|
| | |
| | |
|
| | | if (item.optBoolean("free_shipment"))
|
| | | goods.setFreeShipment(1);
|
| | | |
| | | System.out.println(item.optString("material_lib_type"));
|
| | |
|
| | | return goods;
|
| | | }
|
| | |
| | |
|
| | | if (item.optBoolean("free_shipment"))
|
| | | goods.setFreeShipment(1);
|
| | |
|
| | | |
| | | if("1".equalsIgnoreCase(item.optString("material_lib_type")))
|
| | | TaoKeTest.count++;
|
| | | goodsList.add(goods);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 从淘宝链接中解析商品ID(高级接口)
|
| | | * |
| | | * @param link
|
| | | * @return
|
| | | */
|
| | |
| | | }
|
| | | if (resultJSON == null)
|
| | | return null;
|
| | | |
| | | |
| | |
|
| | | return null;
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 渠道邀请码
|
| | | * |
| | | * @param relationId
|
| | | * @return
|
| | | */
|
| | | public static String getInviteCode(Long relationId, String accessToken) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.sc.invitecode.get");
|
| | | map.put("session", accessToken);
|
| | | map.put("relation_id", relationId + "");
|
| | | map.put("code_type", "2");
|
| | | map.put("relation_app", "返利券");
|
| | | JSONObject resultJSON = null;
|
| | | try {
|
| | | TaoKeAppInfo app=new TaoKeAppInfo();
|
| | | app.setAppKey("24567001");
|
| | | app.setAppSecret("e26a8d0f8726883d44bf04742829b533");
|
| | | app.setAdzoneId("123123");
|
| | | resultJSON = TaoKeBaseUtil.baseRequest(map, app);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (resultJSON == null)
|
| | | return null;
|
| | |
|
| | | return null;
|
| | |
|
| | | }
|