using Newtonsoft.Json; using StackExchange.Redis; namespace YLErp.Cache { public interface IYLCache { /// /// 缓存是否可用 /// /// bool CacheEnable(); /// /// 删除缓存 /// /// /// bool DeleteKey(string key); /// /// Hash数据类型的保存 /// /// /// /// /// /// bool HashSet(string key, string hashKey, T value); /// /// 字符串数据类型的保存 /// /// /// /// bool StringSet(string key,string value); /// /// 字符串数据类型的查询 /// /// /// string StringGet(string key); /// /// 字符串数据类型的保存 /// /// /// /// bool StringSet(string key, object value); /// /// 字符串数据类型的查询 /// /// /// /// T StringGet(string key) where T : class; bool StringSetWithNoPrefix(string key, object value, TimeSpan? timeSpan) where T : class; T StringGetWithNoPrefix(string key) where T : class; #region Batch Operate /// /// 批量增加 /// /// /// /// /// Task BatchAdd(string preKey, List values, int listSize = 1000); /// /// 批量删除 /// /// /// bool BatchDelete(string pattern); /// /// 批量查询 /// /// /// /// List BatchQuery(string pattern); /// /// 模糊查询 /// /// IEnumerable QueryKeys(string pattern); #endregion } }