using System.Threading.Tasks; using System.Collections; using System.Collections.ObjectModel; using LeanCloud.Storage.Internal.Query; namespace LeanCloud.Realtime { public class LCIMConversationQuery { internal LCCompositionalCondition Condition { get; private set; } private readonly LCIMClient client; public LCIMConversationQuery(LCIMClient client) { Condition = new LCCompositionalCondition(); this.client = client; } /// /// 等于 /// /// /// /// public LCIMConversationQuery WhereEqualTo(string key, object value) { Condition.WhereEqualTo(key, value); return this; } /// /// 不等于 /// /// /// /// public LCIMConversationQuery WhereNotEqualTo(string key, object value) { Condition.WhereNotEqualTo(key, value); return this; } /// /// 包含 /// /// /// /// public LCIMConversationQuery WhereContainedIn(string key, IEnumerable values) { Condition.WhereContainedIn(key, values); return this; } /// /// 包含全部 /// /// /// /// public LCIMConversationQuery WhereContainsAll(string key, IEnumerable values) { Condition.WhereContainsAll(key, values); return this; } /// /// 存在 /// /// /// public LCIMConversationQuery WhereExists(string key) { Condition.WhereExists(key); return this; } /// /// 不存在 /// /// /// public LCIMConversationQuery WhereDoesNotExist(string key) { Condition.WhereDoesNotExist(key); return this; } /// /// 长度等于 /// /// /// /// public LCIMConversationQuery WhereSizeEqualTo(string key, int size) { Condition.WhereSizeEqualTo(key, size); return this; } /// /// 大于 /// /// /// /// public LCIMConversationQuery WhereGreaterThan(string key, object value) { Condition.WhereGreaterThan(key, value); return this; } /// /// 大于等于 /// /// /// /// public LCIMConversationQuery WhereGreaterThanOrEqualTo(string key, object value) { Condition.WhereGreaterThanOrEqualTo(key, value); return this; } /// /// 小于 /// /// /// /// public LCIMConversationQuery WhereLessThan(string key, object value) { Condition.WhereLessThan(key, value); return this; } /// /// 小于等于 /// /// /// /// public LCIMConversationQuery WhereLessThanOrEqualTo(string key, object value) { Condition.WhereLessThanOrEqualTo(key, value); return this; } /// /// 前缀 /// /// /// /// public LCIMConversationQuery WhereStartsWith(string key, string prefix) { Condition.WhereStartsWith(key, prefix); return this; } /// /// 后缀 /// /// /// /// public LCIMConversationQuery WhereEndsWith(string key, string suffix) { Condition.WhereEndsWith(key, suffix); return this; } /// /// 字符串包含 /// /// /// /// public LCIMConversationQuery WhereContains(string key, string subString) { Condition.WhereContains(key, subString); return this; } /// /// 按 key 升序 /// /// /// public LCIMConversationQuery OrderBy(string key) { Condition.OrderBy(key); return this; } /// /// 按 key 降序 /// /// /// public LCIMConversationQuery OrderByDescending(string key) { Condition.OrderByDescending(key); return this; } /// /// 拉取 key 的完整对象 /// /// /// public LCIMConversationQuery Include(string key) { Condition.Include(key); return this; } /// /// 包含 key /// /// /// public LCIMConversationQuery Select(string key) { Condition.Select(key); return this; } /// /// 跳过 /// /// /// public LCIMConversationQuery Skip(int value) { Condition.Skip = value; return this; } /// /// 限制数量 /// /// /// public LCIMConversationQuery Limit(int value) { Condition.Limit = value; return this; } public bool WithLastMessageRefreshed { get; set; } /// /// 查找 /// /// public async Task> Find() { return await client.ConversationController.Find(this); } } }