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

import java.util.Objects;

/**
 * @Description: 自定义流程类型enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/1/24
 */
public enum TFCustomTypeEnum {

    ELECTRON_FLOW("电子交卷审核", "exam_task"),

    QUESTION_ELECTRON_FLOW("题库试题提交审核", null),

    PAPER_ELECTRON_FLOW("题库试卷审核", null);

    private String title;

    private String table;

    private TFCustomTypeEnum(String title, String table) {
        this.title = title;
        this.table = table;
    }

    public String getTable() {
        return table;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 状态转换 toName
     *
     * @param table
     * @return
     */
    public static TFCustomTypeEnum convertToEnum(String table) {
        for (TFCustomTypeEnum e : TFCustomTypeEnum.values()) {
            if (Objects.equals(table, e.getTable())) {
                return e;
            }
        }
        return null;
    }
}
