using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EzCoreNet.Redis { /// /// ezcore 对redis 封装 /// public interface IEzCoreNetRedisService { /// /// 设置一个键值 /// /// /// /// /// /// bool Add(string key, object value, int expireSeconds); /// /// 获取一个键值 /// /// /// /// T? Get(string key); /// /// 获取键值剩余过时间 秒级 /// /// /// long GetTtl(string key); /// /// 删除键值 /// /// /// bool DelKey(string key); /// /// 给key设置 有效时间 /// /// /// /// bool SetTtl(string key, int ttl); /// /// 设置一个键值 /// /// /// /// /// /// bool Add(string key, T value, int expireSeconds); /// /// 获取一个缓存,如果不存在,者根据DataFormSql 在数据库中获取缓存,并保存expireSeconds 时间, /// /// 类型 /// Key /// 读取数据函数 /// 过期时间,为空表示永不过期,默认为3600 /// T? GetAndRefCacheKey(string key, Func DataFormSql, ISqlSugarClient? dc = null, int? expireSeconds = 3600); /// /// 删除以开头的所有组件,主要用于操作目录 /// /// /// Task delegateAllKeyWith(string Prefix); /// /// 加一 /// /// long Incrby(string key); /// /// 获取32位sn /// string Get32sn(); } }