use of cn.eoe.app.entity.UserJson in project android-app by eoecn.
the class UserDao method mapperJson.
public UserResponse mapperJson(String key) {
// TODO Auto-generated method stub
UserJson userJson;
try {
if (!key.contains(":")) {
return null;
}
String url = String.format(Urls.KEYBindURL, key) + Utility.getParams(key);
String result = HttpUtils.getByHttpClient(mContext, url);
userJson = mObjectMapper.readValue(result, new TypeReference<UserJson>() {
});
if (userJson == null) {
return null;
}
return userJson.getResponse();
} 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