package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 预警等级枚举
 */
@Getter
@AllArgsConstructor
public enum LedgerAlertLevelEnum {

    RED_ALERT("1", "红色预警"),
    EXCELLENT_BENCHMARK("2", "优秀标杆"),
    NORMAL_RANGE("3", "正常范围");

    private final String code;
    private final String desc;

    public static LedgerAlertLevelEnum getByCode(String code) {
        for (LedgerAlertLevelEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }

}
