package com.winsun.constant;


import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * 审核类型
 *
 * @datetime 2021-07-28 11:23
 */
public enum ExamineType {

//     0 审核不通过，1 审核通过，空为未审核
    AUDITFAILED("0","审核不通过"),
    APPROVED("1","审核通过"),
    NOTAPPROVED("","未审核");



    ExamineType(String id, String name) {
        this.id = id;
        this.name = name;
    };

    private static final Map<String, ExamineType> DATAS = new HashMap<>();
    static {
        Arrays.asList(values()).forEach(data -> DATAS.put(data.getId(), data));
    }

    private String id;

    private String name;

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static ExamineType findById(String id) {
        return DATAS.getOrDefault(id, null);
    }
}
