package com.qmth.sop.common.enums;

import java.util.Objects;

/**
 * @Description: 登录类型 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/4/26
 */
public enum LoginTypeEnum {

    ACCOUNT("账号登录"),

    PHONE("手机验证码登录");

    LoginTypeEnum(String title) {
        this.title = title;
    }

    private String title;

    public String getTitle() {
        return title;
    }

    /**
     * 状态转换 toName
     *
     * @param value
     * @return
     */
    public static String convertToName(String value) {
        for (LoginTypeEnum e : LoginTypeEnum.values()) {
            if (Objects.equals(value.trim(), e.getTitle())) {
                return e.name();
            }
        }
        return null;
    }
}
