/// <summary> /// 下载代理数据 /// </summary> /// <returns></returns> private ProxyItems DownloadProxyList(int sinceId, int count) { //创建一个BmobQuery查询对象 BmobQuery query = new BmobQuery(); //查询playerName的值为bmob的记录 query.WhereEqualTo("isvip", false); query.Limit(count); query.Skip(sinceId); ProxyItems items = new ProxyItems(); var future = Bmob.FindTaskAsync <ProxyServers>(ProxyServers.TABLE_NAME, query); //对返回结果进行处理 var list = future.Result.results; if (list != null && list.Count > 0) { items.items = new List <ProxyServer>(); foreach (var model in list) { var proxy = model.Get(); items.items.Add(proxy); } } else { items = null; } return(items); }
/// <summary> /// 分页查询记录 /// </summary> /// <param name="skip"></param> /// <param name="limit"></param> /// <param name="callback"></param> public void Query(int skip, int limit, Action<QueryCallbackData<LogModel>, BmobException> callback) { BmobQuery query = new BmobQuery(); query.Skip(skip).Limit(limit); this.Query(query, callback); }
/// <summary> /// 分页查询记录 /// </summary> /// <param name="skip"></param> /// <param name="limit"></param> /// <param name="callback"></param> public void Query(int skip, int limit, Action <QueryCallbackData <LogModel>, BmobException> callback) { BmobQuery query = new BmobQuery(); query.Skip(skip).Limit(limit); this.Query(query, callback); }
public void querySubCategoryNative(int skip) { var bmobQuery = new BmobQuery(); bmobQuery.Skip(skip); bmobQuery.Limit(100); _bmobWindows.Find <SubCategory>("SubCategory", bmobQuery, (resp, ex) => { if (ex != null) { Debug.WriteLine("查询出错:" + ex.Message); return; } var commodities = resp.results; Debug.WriteLine("数量:" + commodities.Count); commodities.ForEach(subCategory => { subCategory.photoUrl = PresetInfo.UrlBase + subCategory.photoName; batchDownloadPhoto(subCategory.photoUrl, subCategory.photoName); // _bmobWindows.Update(subCategory, (responseInfo, exception) => // { // if (exception != null) // { // Debug.WriteLine("修改失败: " + exception.Message); // return; // } // Debug.WriteLine("修改成功: " + subCategory.photoUrl); // }); }); if (commodities.Count > 0) { querySubCategoryNative(skip + 100); } }); }