package com.iailab.module.model.mcs.pre.enums; import lombok.AllArgsConstructor; import lombok.Getter; /** * @author PanZhibao * @Description * @createTime 2024年09月01日 */ @Getter @AllArgsConstructor public enum ItemStatus { STATUS0(0, "禁用"), STATUS1(1, "启用"); private Integer code; private String desc; public static ItemStatus getEumByCode(Integer code) { if (code == null) { return null; } for (ItemStatus statusEnum : ItemStatus.values()) { if (statusEnum.getCode().equals(code)) { return statusEnum; } } return null; } }