package cn.qinys.platform.base.redis;

import lombok.Getter;

/**
 * Description:
 *
 * @author tanlie
 * Date: 2024/1/9 9:12
 */
@Getter
public enum RedisKeyEnum {

    //登录相关
    CAPTCHA("captcha:", "验证码", 300),

    CURRENT_USER("current_user:", "当前用户", 3600 * 12),
    CURRENT_USER_TOKEN("current_user_token:", "当前用户token", 3600 * 12),

    LOGIN_FAIL("login_fail:", "登录错误尝试", 3600 * 24),

    DICTIONARY("dictionary", "字典", 2 * 3600),

    USER_REQUEST_LIMIT("USER_REQUEST_LIMIT:", "用户请求限制", 12 * 3600),
    // 验证码相关
    SMS_COUNT("sms_count:", "每半个小时发送的短信数量", 1800),
    SMS_VALIDATE("sms_validate:", "短信验证码", 300);

    RedisKeyEnum(String code, String msg, Integer expireTime) {
        this.code = code;
        this.msg = msg;
        this.expireTime = expireTime;
    }

    private final String code;
    private final String msg;
    private final Integer expireTime;
}
