package com.rongyichuang.message.entity; /** * 消息类型枚举 */ public enum MessageType { /** * 审核通过 */ REVIEW_APPROVED(1, "审核通过"), /** * 审核驳回 */ REVIEW_REJECTED(2, "审核驳回"), /** * 比赛晋级 */ COMPETITION_PROMOTED(3, "比赛晋级"); private final int value; private final String description; MessageType(int value, String description) { this.value = value; this.description = description; } public int getValue() { return value; } public String getDescription() { return description; } /** * 根据值获取枚举 */ public static MessageType fromValue(int value) { for (MessageType type : MessageType.values()) { if (type.getValue() == value) { return type; } } throw new IllegalArgumentException("Unknown MessageType value: " + value); } }