use of org.qii.weiciyuan.bean.DMUserListBean in project weiciyuan by qii.
the class DMUserLoader method loadData.
public DMUserListBean loadData() throws WeiboException {
DMDao dao = new DMDao(token);
dao.setCursor(cursor);
DMUserListBean result = null;
lock.lock();
try {
result = dao.getUserList();
} finally {
lock.unlock();
}
return result;
}
use of org.qii.weiciyuan.bean.DMUserListBean in project weiciyuan by qii.
the class DMDBTask method get.
public static DMUserListBean get(String accountId) {
Gson gson = new Gson();
DMUserListBean result = new DMUserListBean();
String sql = "select * from " + DMTable.TABLE_NAME + " where " + DMTable.ACCOUNTID + " = " + accountId + " order by " + DMTable.MBLOGID + " desc limit 1";
Cursor c = getRsd().rawQuery(sql, null);
while (c.moveToNext()) {
String json = c.getString(c.getColumnIndex(DMTable.JSONDATA));
try {
DMUserListBean value = gson.fromJson(json, DMUserListBean.class);
for (DMUserBean b : value.getItemList()) {
if (!b.isMiddleUnreadItem()) {
b.getListViewSpannableString();
b.getListviewItemShowTime();
}
}
return value;
} catch (JsonSyntaxException ignored) {
}
}
c.close();
return result;
}
use of org.qii.weiciyuan.bean.DMUserListBean in project weiciyuan by qii.
the class DMDao method getUserList.
public DMUserListBean getUserList() throws WeiboException {
String url = URLHelper.DM_USERLIST;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("count", count);
map.put("cursor", cursor);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
DMUserListBean value = null;
try {
value = new Gson().fromJson(jsonData, DMUserListBean.class);
for (DMUserBean b : value.getItemList()) {
if (!b.isMiddleUnreadItem()) {
b.getListViewSpannableString();
b.getListviewItemShowTime();
}
}
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
Aggregations