package com.iailab.module.device.commons; import lombok.AllArgsConstructor; import lombok.Getter; /** * 设备健康评价指标类型 * * @author PanZhibao * @Description * @createTime 2024年06月30日 */ @Getter @AllArgsConstructor public enum HealthIndexTypeEnum { runTime("runTime", "运行时长"), elec("elec", "电流"), temperature("temperature", "温度"), flutter("flutter", "振动"); private String code; private String desc; public static HealthIndexTypeEnum getEumByCode(String code) { if (code == null) { return null; } for (HealthIndexTypeEnum statusEnum : HealthIndexTypeEnum.values()) { if (statusEnum.getCode().equals(code)) { return statusEnum; } } return null; } }