package com.lz.common.constant;

/**
 * @author yuzhong
 * @date 2017-12-20 10:46 AM
 */
public enum CacheConstants {

    KEY_SYS_CONFIG("sys_config_%s", CacheConstants.DEFAULT_EXPIRE_SECOND),
    KEY_QUOTA_MAX_CONFIG("quota_max_config_%s", CacheConstants.SECOND_OF_HALF_HOUR),
    KEY_RULE_GROUP("rule_group_%s", CacheConstants.SECOND_OF_HALF_HOUR),
    KEY_SCENE_OWN_TABLE("rule_scene_own_table_%s", CacheConstants.SECOND_OF_HALF_HOUR),
    KEY_RULE_ENGINE_INFO("rule_engine_info_%s", CacheConstants.SECOND_OF_HALF_HOUR),
    KEY_RULE_ENGINE_CONFIG("rule_engine_config_%s", CacheConstants.SECOND_OF_HALF_HOUR),
    KEY_QUOTA_MODEL("quota_model_%s_%s", CacheConstants.SECOND_OF_HALF_HOUR),
    KEY_QUOTA_BASE_CONFIG("quota_base_config_%s", CacheConstants.SECOND_OF_TEN_MINITS),
    KEY_FAMILY_USER_DIRECTORY("family_user_directory_%s", CacheConstants.SECOND_OF_TWO_DAY),
    KEY_EVENT_MANAGE_DTO("event_manage_%s", CacheConstants.SECOND_OF_HALF_HOUR),
    HASH_KEY_RULE_RESULT("rule_result_%s", CacheConstants.SECOND_OF_ONE_WEEK),
    KEY_TEST_USER_STATUS("test_user_status_%s",CacheConstants.SECOND_OF_ONE_WEEK),
    KEY_PHONE_ADDR_BOOK("phone_addr_book_%s",CacheConstants.SECOND_OF_HALF_HOUR),
    KEY_USER_POOL_COUNT("user_pool_count",CacheConstants.SECOND_OF_AN_HOUR),//用户池用户数量
    KEY_FINAL_USER_POOL_COUNT("final_user_pool_count",CacheConstants.SECOND_OF_AN_HOUR),//最终用户池用户数量
    KEY_USER_POOL_COUNT_FOR_LIANTONG("user_pool_count_for_liantong",CacheConstants.SECOND_OF_AN_HOUR),//用户池用户数量（联通redis用）
    KEY_USER_POOL_COUNT_FOR_LZ("user_pool_count_for_linzi",CacheConstants.SECOND_OF_AN_HOUR),//用户池用户数量（LINZIredis用）
    KEY_FINAL_USER_POOL_COUNT_FOR_LZ("final_user_pool_count_for_linzi",CacheConstants.SECOND_OF_AN_HOUR),//最终用户池用户数量
    KEY_RULE_MODEL("rule_model_%s", CacheConstants.SECOND_OF_ONE_DAY),
    KEY_RULE_TREE("rule_tree_%s_%s", CacheConstants.SECOND_OF_ONE_DAY),
    KEY_XINSHEN_PERSON_TASK("xinshen_person_task_%s", CacheConstants.SECOND_OF_ONE_YEAR),
    KEY_XINSHEN_PERSON_COUNT("xinshen_person_count_%s", CacheConstants.SECOND_OF_ONE_YEAR),
    ;

    // 单位秒
    public static final long SECOND_OF_ONE_MINITS = 1 * 60l;
    public static final long SECOND_OF_ONE = 1L;
    public static final long FIVETY_MINITS = 1 * 50l;
    public static final long SECOND_OF_THREE_MINITS = 3 * 60l;
    public static final long SECOND_OF_TEN_MINITS = 10 * 60l;
    public static final long SECOND_OF_THREE = 30l;// 30秒
    public static final long SECOND_OF_HALF_HOUR = 30 * 60l;
    public static final long SECOND_OF_AN_HOUR = 60 * 60l;
    public static final long SECOND_OF_SIX_HOUR = 6 * 60 * 60l;
    public static final long SECOND_OF_ONE_DAY = 24 * 60 * 60l;
    public static final long SECOND_OF_TWO_DAY = 2 * 24 * 60 * 60l;
    public static final long SECOND_OF_ONE_WEEK = 7 * 24 * 60 * 60l;
    public static final long SECOND_OF_TWO_WEEK = 14 * 24 * 60 * 60l;
    public static final long SECOND_OF_ONE_MONTH = 30 * 24 * 60 * 60l;
    public static final long SECOND_OF_ONE_YEAR = 12 * 30 * 24 * 60 * 60l;
    public static final long DEFAULT_EXPIRE_SECOND = SECOND_OF_SIX_HOUR;

    private String key;

    private long expire;

    private CacheConstants(String key, long expire) {
        this.key = key;
        this.expire = expire;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public long getExpire() {
        return expire;
    }

    public void setExpire(long expire) {
        this.expire = expire;
    }
}
