package com.sckw.core.model.enums;

import lombok.Getter;

/**
 * @author czh
 * @desc 告警类型
 * @date 2023/6/15
 */
@Getter
public enum AlarmTypeEnum {

    //数据告警
    ALARM_ONE(2, "2", "数据告警"),
    //设备告警
    ALARM_TWO(1, "1", "设备告警");

    private final int code;

    private final String status;

    private final String name;

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

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