package com.sckw.core.model.enums;

import lombok.Getter;

/**
 * @author lfdc
 * @description 报表枚举
 * @date 2023-10-31 11:10:07
 */
@Getter
public enum ReportEnum {
    /**
     * 禁用
     */
    NOT_ENABLED(2, "2", "禁用"),

    /**
     * 启用
     */
    ENABLED(0, "0", "启用"),

    /**
     * 未启用
     */
    FORBIDDEN(1, "1", "未启用");

    private final String status;
    private final Integer code;
    private final String description;

    ReportEnum(Integer code, String status, String description) {
        this.code = code;
        this.status = status;
        this.description = description;
    }

    public static String getDescription(Integer code) {
        for (ReportEnum value : ReportEnum.values()) {
            if (value.code == code) {
                return value.description;
            }
        }
        return null;
    }

    public static String getDescription(String status) {
        for (ReportEnum value : ReportEnum.values()) {
            if (value.status.equals(status)) {
                return value.description;
            }
        }
        return null;
    }
}
