using static ZelWiki.Caching.WikiCache;

namespace ZelWiki.Caching
{
    /// <summary>
    /// 包含逐字缓存键
    /// </summary>
    /// <param name="key"></param>
    public class WikiCacheKey(string key) : IWikiCacheKey
    {
        public string Key { get; set; } = key;

        public static WikiCacheKey Build(Category category, object?[] segments)
            => new($"[{category}]:[{string.Join("]:[", segments)}]");

        public static WikiCacheKey Build(Category category)
            => new($"[{category}]");
    }
}
