package com.sqx.common.utils;

import cn.hutool.core.date.DateUtil;

/**
 * Redis所有Keys
 *
 */
public class RedisKeys {

    public static final String FREE_WATCH_KEY = "free:watch:";

    public static String getSysConfigKey(String key){
        return "sys:config:" + key;
    }

    public static String getDateKey(String key){
        return "date:" + key;
    }

    public static String getFreeWatchKey(Long userId, boolean isPermanently) {
        if (isPermanently) {
            return FREE_WATCH_KEY + userId;
        }
        return FREE_WATCH_KEY + DateUtil.today() + ":" + userId;
    }

    public static void main(String[] args) {
        System.out.println(DateUtil.today());
    }
}
