62,614
社区成员
发帖
与我相关
我的任务
分享
class result
{
public bool ValidResult;
public userInfo ResultUserLoginInfo;
//...
}
class userInfo
{
public int UserId;
//...
}
result result = fastCSharp.setup.cSharp.json.parse.Get<result>(json);
JSONArray jsonArrays = new JSONArray(buf);
for (int i = 0; i < jsonArrays.length(); i++) {
JSONObject obj = jsonArrays.getJSONObject(i);
long count = 0L;
String categoryType = "";
String catTypeToString = "";
String url = "";
if (obj.has("count")) {
count = Long.valueOf(obj.optString("count"));
}
if (obj.has("cateType")) {
categoryType = obj.optString("cateType");
}
String cateName = null;
if (obj.has("cateName")) {
cateName = obj.optString("cateName");
}
url = obj.optString("url");
if (QuhaoConstant.test) {
if(null != url &&!"".equals(url))
{
url = obj.getString("url").replace("http://localhost:9081/", QuhaoConstant.HTTP_URL);
}
// imgUrl = obj.getString("merchantImage").replace("http://localhost:9081/", "http://192.168.2.100:9081/");
System.out.println(url);
} else {
url = obj.getString("merchantImage");
}
Category category = new Category(count, categoryType, cateName, url);
categroys.add(category);
}