package com.ruoyi.enums.process;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 审批流程配置类型枚举
 * @Author liwenlong
 */
public enum ProcessConfigEnums {

    /**
     * 测试审核
     */
    Test(false,1, "测试审核"),

    /**
     * 提现申请
     */
    WITHDRAWAL_PROCESS(false,2, "提现申请"),


    ;

    /**
     * 是否是后台
     */
    private final Boolean isBackend;
    private final Integer code;
    private final String name;

    public static String getName(Integer code) {
        return getProcessConfigEnums(code).name;
    }


    public static List<ProcessConfigEnums> getProcessConfigEnumsList() {
        return Arrays.stream(ProcessConfigEnums.values()).collect(Collectors.toList());
    }

    public static ProcessConfigEnums getProcessConfigEnums(Integer code) {
        return Arrays.stream(ProcessConfigEnums.values()).filter(c->c.getCode().equals(code)).findFirst().get();
    }

    ProcessConfigEnums(Boolean isBackend, Integer code, String name) {
        this.isBackend = isBackend;
        this.code = code;
        this.name = name;
    }


    public Boolean getIsBackend() {
        return isBackend;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }




}
