using DocumentServiceAPI.Services.IService; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Furion.DependencyInjection; namespace DocumentServiceAPI.Services { /// /// redis缓存服务 /// public class RedisCacheScService: IRedisCacheService, IScoped { /// /// 设置一个键值 /// /// /// /// /// public bool Add(string key, T value, int expireSeconds = -1) { return RedisHelper.Set(key, value, expireSeconds); } public T? Get(string key) { return RedisHelper.Get(key); } /// /// 获取秒级过期时间 /// /// /// public long GetTtl(string key) { return RedisHelper.Ttl(key); } } }