package com.lantone.daqe.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @Description: 是否必填注解
 * @author: zhanghang
 * @time: 2022/3/11 16:03
 */
public enum AuditStatusEnum {
    NOT_AUDIT("0", "未通过"),
    IS_AUDIT("1", "已通过");

    @Getter
    @Setter
    private String key;

    @Getter
    @Setter
    private String name;

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

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

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