use of com.google.gson.Gson in project weiciyuan by qii.
the class EditMyProfileDao method update.
public UserBean update() throws WeiboException {
String apiUrl = URLHelper.MYPROFILE_EDIT;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("screen_name", screen_name);
map.put("url", url);
map.put("description", description);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, apiUrl, map);
Gson gson = new Gson();
UserBean value = null;
try {
value = gson.fromJson(jsonData, UserBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
if (this.avatar != null) {
UploadAvatarDao uploadAvatarDao = new UploadAvatarDao(access_token, avatar);
uploadAvatarDao.upload();
}
return value;
}
use of com.google.gson.Gson in project weiciyuan by qii.
the class FriendListDao method getGSONMsgList.
public UserListBean getGSONMsgList() throws WeiboException {
String url = URLHelper.FRIENDS_LIST_BYID;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("uid", uid);
map.put("cursor", cursor);
map.put("trim_status", trim_status);
map.put("count", count);
map.put("screen_name", screen_name);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
Gson gson = new Gson();
UserListBean value = null;
try {
value = gson.fromJson(jsonData, UserListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
use of com.google.gson.Gson in project weiciyuan by qii.
the class RemarkDao method updateRemark.
public UserBean updateRemark() throws WeiboException {
String url = URLHelper.REMARK_UPDATE;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("uid", uid);
map.put("remark", remark);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, 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 ShareShortUrlTimeLineDao method getGSONMsgList.
public ShareListBean getGSONMsgList() throws WeiboException {
String json = getMsgListJson();
Gson gson = new Gson();
ShareListBean value = null;
try {
value = gson.fromJson(json, ShareListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
if (value != null) {
Iterator<MessageBean> iterator = value.getItemList().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 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;
}
Aggregations