package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: 流程审批操作 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/2
 */
public enum FlowApprovePassEnum {

    PASS("通过"),

    REJECT("驳回"),

    CANCEL("撤销"),

    RESTART("重启流程");

    private String title;

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

    public String getTitle() {
        return title;
    }

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