1
This commit is contained in:
27
model/entity/conversation.go
Normal file
27
model/entity/conversation.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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"` // 消息时间
|
||||
}
|
||||
Reference in New Issue
Block a user