using IM_API.Models;
namespace IM_API.Interface.Services
{
public interface ICacheService
{
///
/// 设置缓存
///
/// 缓存对象类型
/// 缓存索引值
/// 要缓存的对象
/// 过期时间
///
Task SetAsync(string key, T value, TimeSpan? expiration = null);
///
/// 获取缓存
///
///
/// 缓存索引
///
Task GetAsync(string key);
///
/// 删除缓存
///
/// 缓存索引
///
Task RemoveAsync(string key);
///
/// 设置用户缓存
///
///
///
Task SetUserCacheAsync(User user);
///
/// 通过用户名获取用户缓存
///
///
///
Task GetUserCacheAsync(string username);
///
/// 删除用户缓存
///
///
///
///
Task RemoveUserCacheAsync(string username);
}
}