use of cn.eoe.app.entity.WikiMoreResponse in project android-app by eoecn.
the class WikiDao method getMore.
public WikiMoreResponse getMore(String more_url) {
WikiMoreResponse response;
try {
String result = RequestCacheUtil.getRequestContent(mActivity, more_url + Utility.getScreenParams(mActivity), Constants.WebSourceType.Json, Constants.DBContentType.Content_list, true);
response = mObjectMapper.readValue(result, new TypeReference<WikiMoreResponse>() {
});
return response;
} catch (JsonParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JsonMappingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
use of cn.eoe.app.entity.WikiMoreResponse in project android-app by eoecn.
the class TopDao method mapperJson.
public List<Object> mapperJson(boolean useCache) {
List<Object> topCategorys = new ArrayList<Object>();
tabs.clear();
try {
String resultNews = RequestCacheUtil.getRequestContent(mActivity, Urls.TOP_NEWS_URL + Utility.getScreenParams(mActivity), Constants.WebSourceType.Json, Constants.DBContentType.Content_list, useCache);
NewsMoreResponse newsMoreResponse = mObjectMapper.readValue(resultNews, new TypeReference<NewsMoreResponse>() {
});
if (newsMoreResponse != null) {
this.newsCategorys = newsMoreResponse.getResponse();
}
String resultBlogs = RequestCacheUtil.getRequestContent(mActivity, Urls.TOP_BLOG_URL + Utility.getScreenParams(mActivity), Constants.WebSourceType.Json, Constants.DBContentType.Content_list, useCache);
BlogsMoreResponse blogsMoreResponse = mObjectMapper.readValue(resultBlogs, new TypeReference<BlogsMoreResponse>() {
});
if (blogsMoreResponse != null) {
this.blogsCategorys = blogsMoreResponse.getResponse();
}
String resultWiki = RequestCacheUtil.getRequestContent(mActivity, Urls.TOP_WIKI_URL + Utility.getScreenParams(mActivity), Constants.WebSourceType.Json, Constants.DBContentType.Content_list, useCache);
WikiMoreResponse wikiMoreResponse = mObjectMapper.readValue(resultWiki, new TypeReference<WikiMoreResponse>() {
});
if (wikiMoreResponse != null) {
this.wikiCategorys = wikiMoreResponse.getResponse();
}
Collections.addAll(topCategorys, newsCategorys, blogsCategorys, wikiCategorys);
return topCategorys;
} catch (JsonParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JsonMappingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Aggregations