package com.iailab.module.data.enums; import lombok.AllArgsConstructor; import lombok.Getter; /** * @author PanZhibao * @Description * @createTime 2024年11月18日 */ @Getter @AllArgsConstructor public enum TimeGranularitySecEnum { TG_MIN("min", 60), TG_HOUR("hour", 60 * 60), TG_DAY("day", 60 * 60 * 24); private String code; private Integer value; public static TimeGranularitySecEnum getEumByCode(String code) { if (code == null) { return null; } for (TimeGranularitySecEnum statusEnum : TimeGranularitySecEnum.values()) { if (statusEnum.getCode().equals(code)) { return statusEnum; } } return null; } }