| | |
| | | import net.sf.json.JSONObject; |
| | | |
| | | public class PinDuoDuoApiUtil { |
| | | public final static String PID_FANLI = "8590899_72067894"; |
| | | public final static String PID_SHARE = "8590899_72067895"; |
| | | public final static String PID_COUPON = "8590899_102657575"; |
| | | // public final static String PID_FANLI = "8590899_72067894"; |
| | | // public final static String PID_SHARE = "8590899_72067895"; |
| | | // public final static String PID_COUPON = "8590899_102657575"; |
| | | |
| | | public final static String PID_DEFAULT = "8590899_72067894"; |
| | | |
| | | private final static String CLIENT_ID = "9f6ee5ebd3b94c2080c4d51c2427e9fa"; |
| | | private final static String CLIENT_SECRET = "95e1f1904385664bf4b87d4b34de12f9f31c505d"; |
| | |
| | | map.put("range_list", gson.toJson(sf.getRangeList()).toString()); |
| | | } |
| | | |
| | | map.put("pid", PID_FANLI); |
| | | map.put("pid", PID_DEFAULT); |
| | | String result = baseRequest(map); |
| | | System.out.println(result); |
| | | JSONObject json = JSONObject.fromObject(result); |
| | |
| | | map.put("activity_tags", JSONArray.fromObject(Arrays.asList(activityTags)).toString()); |
| | | } |
| | | |
| | | map.put("pid", PID_FANLI); |
| | | map.put("pid", PID_DEFAULT); |
| | | String result = baseRequest(map); |
| | | |
| | | JSONObject json = JSONObject.fromObject(result); |
| | |
| | | */ |
| | | public static PDDGoodsDetail getGoodsDetail(Long goodsId) { |
| | | try { |
| | | return getGoodsDetail(goodsId, PID_FANLI, "437032"); |
| | | return getGoodsDetail(goodsId, PID_DEFAULT, "437032"); |
| | | } catch (PDDApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("type", "pdd.ddk.phrase.generate"); |
| | | map.put("goods_id_list", array.toString()); |
| | | map.put("p_id", PID_FANLI); |
| | | map.put("p_id", PID_DEFAULT); |
| | | String result = baseRequest(map); |
| | | JSONObject resultJson = JSONObject.fromObject(result); |
| | | JSONObject root = resultJson.optJSONObject("ddk_phrase_generate_response"); |
| | |
| | | PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(227873724698L); |
| | | |
| | | |
| | | PinDuoDuoApiUtil.convert(goods.getGoodsSign(), PID_FANLI + "","437032", false); |
| | | PinDuoDuoApiUtil.convert(goods.getGoodsSign(), PID_DEFAULT + "","437032", false); |
| | | } |
| | | } |