package com.njcn.process.enums;

import lombok.Getter;

@Getter
public enum AlertTypeEnum {
    BLACK(0, "无预警"),
    YELLOW(1, "一级预警"),
    ORANGE(2, "二级预警"),
    RED(3, "超时");

    private final Integer code;

    private final String message;

    AlertTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static AlertTypeEnum getAlertTypeEnumByCode(Integer code) {
        for (AlertTypeEnum alertTypeEnum : AlertTypeEnum.values()) {
            if (alertTypeEnum.getCode().equals(code)) {
                return alertTypeEnum;
            }
        }
        return null;
    }
}
