package org.wcs.constant.enums.database;

import lombok.Getter;

/**
 * 报警等级枚举
 */
@Getter
public enum BaseErrorLevelEnum {

    NORMAL(0, "普通"),
    WARNING(1, "注意"),
    EMERGENCY(2, "紧急"),
    FATAL(3, "致命");

    private final Integer code;
    private final String name;

    public static String getName(Integer code) {
        for (BaseErrorLevelEnum value : BaseErrorLevelEnum.values()) {
            if (value.code.equals(code)) {
                return value.name;
            }
        }
        return null;
    }


    BaseErrorLevelEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }
}
