package com.sckw.core.model.enums;

import lombok.Getter;

/**
 * @author lfdc
 * @desc 告警等级
 * @date 2023/6/15
 */
@Getter
public enum AlarmLevelEnum {

    //离线时长超1天
    ALARM_Level_ONE(1, "1", "一级", "一"),
    //数值超阈值
    ALARM_Level_TWO(2, "2", "二级", "二"),
    ALARM_LEVEL_THREE(3, "2", "三级", "三"),
    ;

    private final int code;

    private final String status;

    private final String name;
    private final String destination;

    AlarmLevelEnum(int code, String status, String name, String destination) {
        this.code = code;
        this.status = status;
        this.name = name;
        this.destination = destination;
    }

    public static String getName(int code) {
        for (AlarmLevelEnum entryTypeEnum : values()) {
            if (entryTypeEnum.getCode() == code) {
                return entryTypeEnum.name;
            }
        }
        return null;
    }

    public static String getChineseName(int code) {
        for (AlarmLevelEnum entryTypeEnum : values()) {
            if (entryTypeEnum.getCode() == code) {
                return entryTypeEnum.destination;
            }
        }
        return null;
    }
}