package cn.lili.modules.lmk.enums.general; import lombok.Getter; import org.apache.commons.lang3.StringUtils; /** * 浏览类型 * * @author:xp * @date:2025/5/14 10:30 */ @Getter public enum ViewTypeEnum { VIDEO("video", "视频"), GOODS("goods", "商品"), ; private final String value; private final String desc; ViewTypeEnum(String value, String desc) { this.value = value; this.desc = desc; } /** * 获取含义 * * @param value * @return */ public static String getDescByValue(String value) { if (StringUtils.isBlank(value)) { return null; } for (ViewTypeEnum e : ViewTypeEnum.values()){ if (value.equals(e.getValue())) { return e.getDesc(); } } return null; } }