package com.diagbot.enums;

import com.diagbot.core.KeyedNamed;
import lombok.Setter;

/**
 * @Description: 审核状态枚举类
 * @author: wangyu
 * @time: 2018/9/25 16:51
 */
public enum AuditStatusEnum implements KeyedNamed {
    Veto(0, "不通过"),
    Adopt(1, "通过"),
    NotAudit(2, "待审核"),
    Adopt_Part(3, "部分通过"),
    Audit_Part(4,"部分审核");

    @Setter
    private Integer key;

    @Setter
    private String name;

    AuditStatusEnum(Integer key, String name) {
        this.key = key;
        this.name = name;
    }

    public static AuditStatusEnum getEnum(Integer key) {
        for (AuditStatusEnum item : AuditStatusEnum.values()) {
            if (item.key == key) {
                return item;
            }
        }
        return null;
    }

    public static String getName(Integer key) {
        AuditStatusEnum item = getEnum(key);
        return item != null ? item.name : null;
    }

    @Override
    public int getKey() {
        return key;
    }

    @Override
    public String getName() {
        return name;
    }
}

