package com.ruoyi.web.modules.openstats.support;

/**
 * Redis 缓存 Key 规范
 */
public final class StatsCacheKeys
{
    private static final String PREFIX = "openstats:";

    private StatsCacheKeys()
    {
    }

    public static String categorySales(int statYear)
    {
        return PREFIX + "cat:sales:" + statYear;
    }

    public static String hotCategory(int statYear)
    {
        return PREFIX + "cat:hot:" + statYear;
    }

    public static String orderTrend(int statYear)
    {
        return PREFIX + "order:month:" + statYear;
    }

    public static String shopEntry(int statYear)
    {
        return PREFIX + "shop:month:" + statYear;
    }

    public static String regionRank(int statYear)
    {
        return PREFIX + "region:" + statYear;
    }

    public static String wordCloud()
    {
        return PREFIX + "wordcloud";
    }

    public static String[] yearlyStatKeys(int statYear)
    {
        return new String[] {
            categorySales(statYear),
            hotCategory(statYear),
            orderTrend(statYear),
            shopEntry(statYear),
            regionRank(statYear)
        };
    }
}
