admin
2025-04-20 24b1d8e38de30063e2fc8008265455da32e959b2
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.taoke.autopay.entity.credit;
 
import org.yeshi.utils.generater.mybatis.Column;
import org.springframework.data.annotation.Id;
import java.math.BigDecimal;
import org.yeshi.utils.generater.mybatis.Table;
import java.util.Date;
import lombok.Data;
import lombok.Builder;
 
@Data
@Builder
@Table(value = "table_user_credit_record")
public class UserCreditRecord {
 
    // 添加常量:方向获得
    public static final int DIRECTION_GAIN = 1; // 方向获得
 
    // 添加常量:方向消耗
    public static final int DIRECTION_CONSUME = 0; // 方向消耗
 
    @Id
    @Column(name = "id")
    private Long id; // 主键ID
 
    @Column(name = "uid")
    private Long uid; // 用户ID
 
    @Column(name = "direction")
    private Integer direction; // 方向(获得/消耗)
 
    @Column(name = "identifier_id")
    private String identifierId; // 标识ID
 
    @Column(name = "credit_amount")
    private Integer creditAmount; // 积分数量
 
    @Column(name = "acquisition_method")
    private AcquisitionMethod acquisitionMethod; // 获取方式
 
    @Column(name = "consumption_method")
    private ConsumptionMethod consumptionMethod; // 消耗方式
 
    // 新增:说明字段
    @Column(name = "description")
    private String description; // 说明
 
    @Column(name = "create_time")
    private Date createTime; // 创建时间
 
    @Column(name = "update_time")
    private Date updateTime; // 更新时间
 
    // 新增默认构造函数
    public UserCreditRecord() {
    }
 
    // 新增:获取方式枚举
    public enum AcquisitionMethod {
        COMMAND_PAYMENT("口令代付"),
        EXCHANGE_RETURN("兑换退回")
        ;
 
        private final String description;
 
        AcquisitionMethod(String description) {
            this.description = description;
        }
 
        public String getDescription() {
            return description;
        }
    }
 
    // 消耗方式枚举
    public enum ConsumptionMethod {
        EXCHANGE_RED_PACKET("兑换红包");
        private final String description;
        ConsumptionMethod(String description) {
            this.description = description;
        }
 
        public String getDescription() {
            return description;
        }
    }
}