package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: 系统鉴权属性 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/3/25
 */
public enum PrivilegePropertyEnum {

    NO_AUTH("无需鉴权"),

    AUTH("鉴权"),

    SYS("系统公用");

    private String title;

    private PrivilegePropertyEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

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