package com.ningdatech.pmapi.sms.utils;

import cn.hutool.core.text.StrPool;
import com.ningdatech.pmapi.sms.constant.VerificationCodeType;

/**
 * <p>
 * SmsRedisKeyUtils
 * </p>
 *
 * @author WendyYang
 * @since 11:21 2022/7/25
 */
public class SmsRedisKeyUtils {

    private SmsRedisKeyUtils() {
    }

    private static final String SMS_CODE_VERIFY_PREFIX = "sms:verify:";
    private static final String SMS_SEND_LIMIT = "sms:limit:";
    private static final String SMS_SEND_LOCK = "sms:lock:";

    public static String smsCodeVerifyKey(VerificationCodeType type, String mobile) {
        return SMS_CODE_VERIFY_PREFIX + StrPool.COLON + type.name() + StrPool.COLON + mobile;
    }

    public static String smsSendLimitKey(VerificationCodeType type, String mobile) {
        return SMS_SEND_LIMIT + StrPool.COLON + type.name() + StrPool.COLON + mobile;
    }

    public static String smsSendLockKey(VerificationCodeType type, String mobile) {
        return SMS_SEND_LOCK + StrPool.COLON + type.name() + StrPool.COLON + mobile;
    }

}
