phpcjl
2024-11-29 e8d2211654aadc73afc13be705ada77bdea993ab
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
package com.ruoyi.account.enums;
 
import lombok.Getter;
 
@Getter
public enum PointChangeType {
    CONSUME(1, "消费积分"),
    COMMISSION_RETURN(2, "返佣积分"),
    NEW_USER_REFERRAL(3, "拉新人积分"),
    EXCHANGE_GOODS(4, "兑换商品"),
    STORE_PERFORMANCE(5, "门店业绩积分"),
    STORE_COMMISSION_RETURN(6, "门店返佣积分"),
    TECHNICIAN_PERFORMANCE(7, "技师业绩积分"),
    TRANSFER_POINTS(8, "转赠积分"),
    WORK_PERFORMANCE(9, "做工积分"),
    REGISTRATION(10, "注册积分");
 
    private final int code;
    private final String description;
 
    PointChangeType(int code, String description) {
        this.code = code;
        this.description = description;
    }
 
    public static PointChangeType fromCode(int code) {
        for (PointChangeType type : values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid code: " + code);
    }
}