package com.iailab.module.data.video.enums; import lombok.AllArgsConstructor; import lombok.Getter; /** * @author PanZhibao * @Description * @createTime 2024年03月12日 */ @Getter @AllArgsConstructor public enum AlarmStatusEnum { NORMAL(0,"无排放"), POLLUTION(1,"有排放"), EXCEPTION(2,"设备异常"); private Integer code; private String desc; public static AlarmStatusEnum getEumByCode(Integer code){ if(code == null) {return null;} for(AlarmStatusEnum statusEnum: AlarmStatusEnum.values()) { if(statusEnum.getCode().equals(code)) { return statusEnum; } } return null; } }