use of com.google.gson.Gson in project weiciyuan by qii.
the class ShowUserDao method getUserInfo.
public UserBean getUserInfo() throws WeiboException {
String url = (!TextUtils.isEmpty(domain) ? URLHelper.USER_DOMAIN_SHOW : URLHelper.USER_SHOW);
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("uid", uid);
map.put("screen_name", screen_name);
map.put("domain", domain);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
Gson gson = new Gson();
UserBean value = null;
try {
value = gson.fromJson(jsonData, UserBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
use of com.google.gson.Gson in project weiciyuan by qii.
the class RepostsTimeLineByIdDao method getGSONMsgList.
public RepostListBean getGSONMsgList() throws WeiboException {
String url = URLHelper.REPOSTS_TIMELINE_BY_MSGID;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("id", id);
map.put("since_id", since_id);
map.put("max_id", max_id);
map.put("count", count);
map.put("page", page);
map.put("filter_by_author", filter_by_author);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
Gson gson = new Gson();
RepostListBean value = null;
try {
value = gson.fromJson(jsonData, RepostListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
if (value != null && value.getItemList().size() > 0) {
List<MessageBean> msgList = value.getItemList();
Iterator<MessageBean> iterator = msgList.iterator();
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
if (msg.getUser() == null) {
iterator.remove();
} else {
msg.getListViewSpannableString();
TimeUtility.dealMills(msg);
}
}
}
return value;
}
use of com.google.gson.Gson in project weiciyuan by qii.
the class DestroyStatusDao method destroy.
public boolean destroy() throws WeiboException {
String url = URLHelper.STATUSES_DESTROY;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("id", id);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, url, map);
Gson gson = new Gson();
try {
MessageBean value = gson.fromJson(jsonData, MessageBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
return false;
}
return true;
}
use of com.google.gson.Gson in project weiciyuan by qii.
the class DMConversationDao method getConversationList.
public DMListBean getConversationList() throws WeiboException {
String url = URLHelper.DM_CONVERSATION;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("uid", uid);
map.put("page", page);
map.put("count", count);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
DMListBean value = null;
try {
value = new Gson().fromJson(jsonData, DMListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
use of com.google.gson.Gson in project weiciyuan by qii.
the class FavDao method executeTask.
private FavBean executeTask(String url) throws WeiboException {
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("id", id);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, url, map);
try {
FavBean value = new Gson().fromJson(jsonData, FavBean.class);
if (value != null) {
return value;
}
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return null;
}
Aggregations