Search in sources :

Example 1 with RepostListBean

use of org.qii.weiciyuan.bean.RepostListBean 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;
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) JsonSyntaxException(com.google.gson.JsonSyntaxException) RepostListBean(org.qii.weiciyuan.bean.RepostListBean) HashMap(java.util.HashMap) Gson(com.google.gson.Gson)

Example 2 with RepostListBean

use of org.qii.weiciyuan.bean.RepostListBean in project weiciyuan by qii.

the class RepostByIdMsgLoader method loadData.

public RepostListBean loadData() throws WeiboException {
    RepostsTimeLineByIdDao dao = new RepostsTimeLineByIdDao(token, id);
    dao.setSince_id(sinceId);
    dao.setMax_id(maxId);
    RepostListBean result = null;
    lock.lock();
    try {
        result = dao.getGSONMsgList();
    } finally {
        lock.unlock();
    }
    return result;
}
Also used : RepostListBean(org.qii.weiciyuan.bean.RepostListBean) RepostsTimeLineByIdDao(org.qii.weiciyuan.dao.timeline.RepostsTimeLineByIdDao)

Aggregations

RepostListBean (org.qii.weiciyuan.bean.RepostListBean)2 Gson (com.google.gson.Gson)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 HashMap (java.util.HashMap)1 MessageBean (org.qii.weiciyuan.bean.MessageBean)1 RepostsTimeLineByIdDao (org.qii.weiciyuan.dao.timeline.RepostsTimeLineByIdDao)1