package com.ningdatech.carapi.report.constant;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 直报系统数据审核状态
 * @return
 * @author CMM
 * @since 2023/02/07 13:55
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "DataUploadAuditTypeEnum", description = "直报系统数据审核类型-枚举")
public enum DataUploadAuditTypeEnum {

    /**
     * 市级散办审核
     */
    CITY_AUDIT(1,"市级散办审核"),

    /**
     * 审核通过
     */
    PROVINCE_AUDIT(2, "省散办审核");

    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 (DataUploadAuditTypeEnum t : DataUploadAuditTypeEnum.values()) {
            if (code.equals(t.getCode())) {
                return t.desc;
            }
        }
        return StringUtils.EMPTY;
    }

    public boolean eq(String val) {
        return this.name().equals(val);
    }

}
