package com.iailab.module.device.commons; import lombok.AllArgsConstructor; import lombok.Getter; /** * @author PanZhibao * @Description * @createTime 2024年07月03日 */ @Getter @AllArgsConstructor public enum HealthLevelEnum { Level1("1", "健康"), Level2("2", "良好"), Level3("3", "不良"); private String code; private String desc; public static HealthLevelEnum getEumByCode(String code) { if (code == null) { return null; } for (HealthLevelEnum statusEnum : HealthLevelEnum.values()) { if (statusEnum.getCode().equals(code)) { return statusEnum; } } return null; } }