package com.sz.admin.monitor.enums;

import lombok.Getter;

/**
 * ClassName: AlarmReportEnums
 * Package: com.sz.admin.monitor.enums
 * Description: 移位报警
 */
@Getter
public enum AlarmReportEnums {
    DISPLACEMENT_ALARM("Displacement",1,"移位报警"),
    FIRE_ALARM("Fire",2,"明烟明火报警"),
    FACE_ID_ALARM("FaceId",3,"人脸识别报警"),
    CAPTURE_FACE_ALARM("CaptureFace", 4, "抓拍到人脸报警"),
    HELMET_ALARM("NoHelmet", 5, "未戴安全帽报警");
    private final String alarmType;
    private final Integer alarmCode;
    private final String alarmDescription;
    AlarmReportEnums(String alarmType, Integer alarmCode, String alarmDescription) {
        this.alarmType = alarmType;
        this.alarmCode = alarmCode;
        this.alarmDescription = alarmDescription;

    }
    // 根据alarmCode获取枚举值
    public static AlarmReportEnums getAlarmReportEnums(Integer alarmCode) {
        for (AlarmReportEnums alarmReportEnums : AlarmReportEnums.values()) {
            if (alarmReportEnums.getAlarmCode().equals(alarmCode)) {
                return alarmReportEnums;
            }
        }
        return null;
    }
    public static AlarmReportEnums getAlarmReportEnums(String alarmType) {
        for (AlarmReportEnums alarmReportEnums : AlarmReportEnums.values()) {
            if (alarmReportEnums.getAlarmType().equals(alarmType)) {
                return alarmReportEnums;
            }
        }
        return null;
    }

}
