package com.ningdatech.carapi.company.enumeration;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 企业安全主体责任-通报文件类型
 * @return
 * @author CMM
 * @since 2023/05/17 14:42
 */
@Getter
@AllArgsConstructor
public enum SecurityProductFileType {

    MANAGE_BU(0, "管理部门"),
    COMPANY_INNER(1, "企业内部"),
    REGULATION_NOTICE(2,"监管通报"),
    HIGHER_CHECK(3,"上级检查");




    private Integer code;
    private String desc;

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByCode(Integer code) {
        if(Objects.isNull(code)){
            return StringUtils.EMPTY;
        }
        for (SecurityProductFileType t : SecurityProductFileType.values()) {
            if (code.equals(t.getCode())) {
                return t.desc;
            }
        }
        return StringUtils.EMPTY;
    }

}
