| | |
| | | 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);
|