package com.dcsoft.common.core.enums;

/**
 * 审批状态集合
 */
public enum ExamineEnum {

    ALL("3", "全部","#607D8B"),
    IN_REVIEW("2", "审核中","#2d82fb"),
    PASSED("0", "已通过","#17b26a"),
    REJECTED("1", "已驳回","#ff1100"),
    ;

    ExamineEnum(String code, String name, String color) {
        this.code = code;
        this.name = name;
        this.color = color;
    }

    public static String getByCode(String code) {
        for (ExamineEnum examine : ExamineEnum.values()) {
            if (examine.code.equals(code)) {
                return examine.name;
            }
        }
        return null;
    }

    public static String getColorByCode(String code) {
        for (ExamineEnum examine : ExamineEnum.values()) {
            if (examine.code.equals(code)) {
                return examine.color;
            }
        }
        return null;
    }

    private String code;
    private String name;
    private String color;

    public String getCode() {
        return code;
    }

    public String getValue() {
        return name;
    }

    public String getColor() {
        return color;
    }
}
