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);
|
}
|
}
|