package com.ywt.outpatient.domain.models.enums;


/**
 * 短信验证码类型枚举
 *
 */
public enum SmsCodeTypeEnum {

    Login("登录", 1),

    Register("注册", 2),

    Create_Patient("添加患者", 3),

    WeChat_Mobile("微信账号关联用户", 4),

    Medical_Card_Bind("绑定诊疗卡", 5),

    Forget_Password("忘记密码", 6),

    LOGIN_REGISTER("登录/注册", 7),

    UPDATE_MOBILE("修改手机号", 8),

    MgAdmin_Bind_User("后台用户绑定用户", 9);

    private final String displayName;
    private int value = 0;

    SmsCodeTypeEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return this.value;
    }

    /**
     * 将 int 值转换为对应的 SmsCodeTypeEnum 枚举值
     * @param value
     * @return
     */
    public static SmsCodeTypeEnum valueOf(int value) {
        switch (value) {
            case 1:
                return Login;
            case 2:
                return Register;
            case 3:
                return Create_Patient;
            case 4:
                return WeChat_Mobile;
            case 5:
                return Medical_Card_Bind;
            case 6:
                return Forget_Password;
            case 7:
                return LOGIN_REGISTER;
            case 8:
                return UPDATE_MOBILE;
            case 9:
                return MgAdmin_Bind_User;
            default:
                return null;
        }
    }

}