package com.trade.client.consumer.enums;

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

    REGISTER("SMS_175475369", "register"), SETPASSWORD("SMS_175485401", "setPassword"), CHANGE("SMS_175485401",
            "change"), AUTHENTICATION("SMS_175485401", "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;
    }
}
