package org.springblade.modules.app.common.enums;

public enum SMSCodeTypeEnum {

    LOGIN_CODE(1, "登录验证码"),
    REGISTER_CODE(2, "注册验证码"),
    CHANGE_PHONE_OLD(3, "更换手机号码旧手机验证码"),
    CHANGE_PHONE_NEW(4, "更换手机号码新手机验证码"),
    ;
    private int code;
    private String text;

    SMSCodeTypeEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static SMSCodeTypeEnum findByCode(int code) {
        for (SMSCodeTypeEnum demoEnum : values()) {
            if (code == demoEnum.getCode()) {
                return demoEnum;
            }
        }
        return null;
    }

}
