package com.qmth.teachcloud.exchange.common.enums.flow;

import java.util.Objects;

/**
 * @Description: 自定义流程审核用户类型
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/1/21
 */
public enum CustomFlowApproveUserTypeEnum {

    USER("成员"),

    ROLE("角色");

    private String title;

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

    public String getTitle() {
        return title;
    }

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