shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package com.walker.jdbc.mongo;
 
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Field;
 
/**
 * 聊天记录对象定义。
 * @author 时克英
 * @date 2023-07-06
 */
public class ChatRecord {
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public long getCreateDate() {
        return createDate;
    }
 
    public void setCreateDate(long createDate) {
        this.createDate = createDate;
    }
 
    public long getUserId() {
        return userId;
    }
 
    public void setUserId(long userId) {
        this.userId = userId;
    }
 
    public int getType() {
        return type;
    }
 
    public void setType(int type) {
        this.type = type;
    }
 
    public String getMsgType() {
        return msgType;
    }
 
    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }
 
    public String getMessage() {
        return message;
    }
 
    public void setMessage(String message) {
        this.message = message;
    }
 
    public String getBizId() {
        return bizId;
    }
 
    public void setBizId(String bizId) {
        this.bizId = bizId;
    }
 
    /**
     * 对话ID,用于区别每一次对话,可以通过传入该参数,查询每个对话全部内容。
     * <p>该属性由业务层定义,在客服系统中,用户能关闭对话,此时生成一个完整对话内容。</p>
     * @return
     * @date 2023-09-06
     */
    public String getDialogId() {
        return dialogId;
    }
 
    public void setDialogId(String dialogId) {
        this.dialogId = dialogId;
    }
 
    @Indexed(unique=false)
    @Field("dialog_id")
    private String dialogId;
 
    @Indexed(unique=false)
    @Field("biz_id")
    private String bizId;
 
    @Id
    private String id;
 
    @CreatedDate
    @Field("create_time")
    private long createDate;
 
    // 聊天对方ID
    @Indexed(unique=false)
    @Field("user_id")
    private long userId;
 
    // 类型:发送或接收
    private int type = TYPE_SEND;
 
    @Field("msg_type")
    private String msgType = MSG_TYPE_TEXT;
 
    private String message;
 
    public static final int TYPE_SEND = 0;
    public static final int TYPE_RECEIVED = 1;
 
    public static final String MSG_TYPE_TEXT = "text";
 
    @Override
    public String toString() {
        return "ChatRecord{" +
                "id='" + id + '\'' +
                ", createDate=" + createDate +
                ", userId=" + userId +
                ", type=" + type +
                ", msgType='" + msgType + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}