package com.m2pool.lease.redis;

/**
 * @Description 用户权限redis
 * @Date 2025/12/23 16:19
 * @Author yyb
 */
public class RedisAuthKey {

    private static final String LOGIN_CODE_KEY= "login:code";

    private static final String REGISTER_CODE_KEY= "register:code";

    private static final String UPDATE_PASSWORD_CODE_KEY= "update:password:code";

    private static final String USER_LOCK_KEY= "user:lock";

    private static final String PASSWORD_ERROR_COUNT_KEY= "password:error:count";

    private static final String USER_LOGIN_KEY= "user:login";


    private static final String GOOGLE_OPEN_CODE_KEY= "google:open:code";

    private static final String GOOGLE_CLOSE_CODE_KEY= "google:close:code";

    /**
     * 获取登录验证码key
     * @param email
     * @return
     */
    public static String getLoginCodeKey(String email) {
        return LOGIN_CODE_KEY + ":" + email;
    }

    /**
     * 获取注册验证码key
     * @param email
     * @return
     */
    public static String getRegisterCodeKey(String email) {
        return REGISTER_CODE_KEY + ":" + email;
    }

    /**
     * 获取修改密码验证码key
     * @param email
     * @return
     */
    public static String getUpdatePasswordCodeKey(String email) {
        return UPDATE_PASSWORD_CODE_KEY + ":" + email;
    }

    /**
     * 获取用户密码输入次数过多 禁止登录 key
     * @param email
     * @return
     */
    public static String getUserLockKey(String email) {
        return USER_LOCK_KEY + ":" + email;
    }

    /**
     * 获取用户密码输入次数 key
     * @param email
     * @return
     */
    public static String getPasswordErrorCountKey(String email) {
        return PASSWORD_ERROR_COUNT_KEY + ":" + email;
    }

    /**
     * 获取用户登录信息 key
     * @param email
     * @return
     */
    public static String getUserLoginKey(String email) {
        return USER_LOGIN_KEY + ":" + email;
    }


    /**
     * 获取用户谷歌验证码 key
     * @param email
     * @return
     */
    public static String getGoogleOpenCodeKey(String email) {
        return GOOGLE_OPEN_CODE_KEY + ":" + email;
    }

    /**
     * 获取用户谷歌关闭验证码 key
     * @param email
     * @return
     */
    public static String getGoogleCloseCodeKey(String email) {
        return GOOGLE_CLOSE_CODE_KEY + ":" + email;
    }
}
