using TakeoutSaaS.Application.Dictionary.Models;

namespace TakeoutSaaS.Application.Dictionary.Abstractions;

/// <summary>
/// 字典缓存读写接口。
/// </summary>
public interface IDictionaryCache
{
    /// <summary>
    /// 获取缓存。
    /// </summary>
    Task<IReadOnlyList<DictionaryItemDto>?> GetAsync(long tenantId, string code, CancellationToken cancellationToken = default);

    /// <summary>
    /// 写入缓存。
    /// </summary>
    Task SetAsync(long tenantId, string code, IReadOnlyList<DictionaryItemDto> items, CancellationToken cancellationToken = default);

    /// <summary>
    /// 移除缓存。
    /// </summary>
    Task RemoveAsync(long tenantId, string code, CancellationToken cancellationToken = default);
}
