package com.trade.client.enterprise.customer.enums;

/**
 * @description: 短信发送验证码类型常量
 * @Author: wanglang
 * @Date: 2024/5/28 9:50
 * @Version: 1.0
 */
public enum SmsCodeTypeEnum {

    REGISTER("SMS_473905179", "register"), SETPASSWORD("SMS_473820256", "setPassword"),
    CHANGE_NEW("SMS_473855198", "changeNew"), CHANGE_OLD("SMS_473900233", "changeOld"),
    BINDING_EMAIL("SMS_473965148", "bindingEmail"), AUTHENTICATION("SMS_473905179", "authentication"), UNKNOWN("SMS_UNKNOWN", "unknown");

    SmsCodeTypeEnum(String code, String type){
        this.code = code;
        this.type = type;
    }

    public static SmsCodeTypeEnum getByType(String type) {
        for (SmsCodeTypeEnum smsCodeTypeEnum : SmsCodeTypeEnum.values()) {
            if (smsCodeTypeEnum.getType().equals(type)) {
                return smsCodeTypeEnum;
            }
        }
        return SmsCodeTypeEnum.UNKNOWN;
    }

    /**
     * 模板
     */
    private final String code;
    /**
     * 类型
     */
    private final String type;

    public String getCode() {
        return code;
    }

    public String getType() {
        return type;
    }
}
