Files
customer-server/model/entity/conversation.go

28 lines
1.4 KiB
Go
Raw Normal View History

2026-03-14 10:02:49 +08:00
package entity
import (
"time"
"gitea.com/red-future/common/beans"
)
const ConversationCollection = "conversation"
// Conversation 对话记录实体
type Conversation struct {
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段
// 业务字段
UserId string `bson:"userId" json:"userId"` // 用户ID含平台前缀
Platform string `bson:"platform" json:"platform"` // 平台标识
SessionId string `bson:"sessionId" json:"sessionId"` // RAGFlow Session ID
CustomerServiceId string `bson:"customerServiceId" json:"customerServiceId"` // 客服账号ID
Role string `bson:"role" json:"role"` // 角色user/assistant
Content string `bson:"content" json:"content"` // 消息内容
Question string `bson:"question" json:"question"` // 用户问题(兼容旧字段)
Answer string `bson:"answer" json:"answer"` // AI 回复(兼容旧字段)
MessageId string `bson:"messageId" json:"messageId"` // 消息ID
MessageType string `bson:"messageType" json:"messageType"` // 消息类型TEXT/IMAGE/VIDEO等
MsgTime *time.Time `bson:"msgTime" json:"msgTime"` // 消息时间
}