KKSU
2025-01-10 59b5c5cdcdfcf29537a53b90aa01331cb8894792
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
package cc.mrbird.febs.common.enumerates;
 
import lombok.Getter;
 
@Getter
public enum ActivityTypeEnum {
 
 
    YOU_HUI_JUAN(2, "优惠卷"),
 
    ZHE_KOU(1, "折扣活动");
 
    private final int value;
 
    private final String desc;
 
    ActivityTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    public static ActivityTypeEnum getEnum(int value) {
        for (ActivityTypeEnum activityTypeEnum : ActivityTypeEnum.values()) {
            if (activityTypeEnum.getValue() == value) {
                return activityTypeEnum;
            }
        }
        return null;
    }
    public static String getActivityType(int value) {
        for (ActivityTypeEnum activityTypeEnum : ActivityTypeEnum.values()) {
            if (activityTypeEnum.getValue() == value) {
                switch (activityTypeEnum.getValue()){
                    case 1:
                        return "(折扣活动)";
                    case 2:
                        return "(优惠卷)";
                    default:
                        return "(未知)";
                }
            }
        }
        return "(未知)";
    }
}