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

public enum UserLoginTypeEnum {

    //登录类型 1-验证码登录 2-密码登录

    SMSCODE_LOGIN(1, "1-验证码登录"),
    PASSWORD_LOGIN(2, "2-密码登录"),
    ;
    private int code;
    private String text;

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

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

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

}
