package com.lantone.daqe.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @Description: 丢失人工核查注解
 * @author: songxl
 * @time: 2022/3/4 16:03
 */
public enum LossIsAuditedEnum {
    FAIL_AUDITED("0", "未通过"),
    SUCCESS_AUDITED("1", "已通过"),
    NOT_AUDITED("2", "未核查");

    @Getter
    @Setter
    private String key;

    @Getter
    @Setter
    private String name;

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

    public static LossIsAuditedEnum getEnum(String key) {
        for (LossIsAuditedEnum item : LossIsAuditedEnum.values()) {
            if (item.key.equals(key)) {
                return item;
            }
        }
        return null;
    }

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