package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: 部门类型设置 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/7/29
 */
public enum DepartmentTypeEnum {

    MANAGER("主管"),

    MEMBER("成员");

    private String title;

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

    public String getTitle() {
        return title;
    }

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