package com.ywt.alipaympapi.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);

    private final String displayName;
    private final int value;

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

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    /**
     * 将 int 值转换为对应的 SmsCodeTypeEnum 枚举值
     *
     * @param value
     * @return
     */
    public static SmsCodeTypeEnum valueOf(int value) {
        for (SmsCodeTypeEnum typeEnum : SmsCodeTypeEnum.values()) {
            if (typeEnum.getValue() == value) {
                return typeEnum;
            }
        }

        return null;
    }
}