package com.ruoyi.enums.process;

import java.util.Arrays;

/**
 * 审核状态枚举
 * @Author liwenlong
 */
public enum ProcessResultEnums {

    PENDING(1, "待审核"),

    APPROVED(2, "审核通过"),

    REJECTED(3, "审核拒绝"),

    IN_PROGRESS(4, "审核中"),

    CANCELLED(5, "已取消"),



    ;

    private final Integer code;
    private final String name;

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


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

    ProcessResultEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


}
