package com.njcn.common.pojo.enums.auth;

import lombok.Getter;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2021年12月15日 15:55
 */
@Getter
public enum AuthenticationMethodEnum {

    /**
     * 认证的方式
     */
    USERNAME("username", "用户名"),
    MOBILE("mobile", "手机号"),
    OPENID("openId", "开放式认证系统唯一身份标识");

    private final String value;

    private final String label;

    AuthenticationMethodEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    public static AuthenticationMethodEnum getByValue(String value) {
        AuthenticationMethodEnum authenticationMethodEnum = null;
        for (AuthenticationMethodEnum item : values()) {
            if (item.getValue().equals(value)) {
                authenticationMethodEnum = item;
            }
        }
        return authenticationMethodEnum;
    }

}
