| | |
| | | import com.yeshi.fanli.dto.suning.SuningQueryModel;
|
| | | import com.yeshi.fanli.entity.suning.SuningOrderInfo;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import org.yeshi.utils.TimeUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | public final static String PID_SHARE = "666527";
|
| | | public final static String PID_BUY = "666526";
|
| | | public final static String PID_COUPON = "666528";
|
| | |
|
| | | private static String post(String url, String entity, Map<String, String> headers) {
|
| | | String charset = "utf-8";
|
| | |
| | | String result = baseRequest("suning.netalliance.commoditydetail.query", key, model);
|
| | | System.out.println(result);
|
| | | JSONObject resultJSON = JSONObject.fromObject(result);
|
| | | |
| | | if( resultJSON.optJSONObject("sn_responseContent")==null)
|
| | | return null;
|
| | | if(resultJSON.optJSONObject("sn_responseContent").optJSONObject("sn_body")==null)
|
| | | return null;
|
| | | |
| | | JSONArray array = resultJSON.optJSONObject("sn_responseContent").optJSONObject("sn_body").optJSONArray(key);
|
| | | if (array != null && array.size() > 0) {
|
| | | return new Gson().fromJson(array.optJSONObject(0).toString(), SuningGoodsInfo.class);
|