lrj
昨天 93eb6b470773bc49ea6e1a9d4cbd914eb95d525b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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);
    }
}