30 lines
996 B
Go
30 lines
996 B
Go
package entity
|
||
|
||
import (
|
||
"time"
|
||
|
||
"gitea.com/red-future/common/beans"
|
||
)
|
||
|
||
const SessionCollection = "session"
|
||
|
||
// SessionStatus 会话状态
|
||
const (
|
||
SessionStatusActive = "active" // 活跃中
|
||
SessionStatusArchived = "archived" // 已归档
|
||
)
|
||
|
||
// Session 会话实体
|
||
type Session 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
|
||
Status string `bson:"status" json:"status"` // 状态:active/archived
|
||
MessageCount int `bson:"messageCount" json:"messageCount"` // 消息数量
|
||
LastActiveAt *time.Time `bson:"lastActiveAt" json:"lastActiveAt"` // 最后活跃时间
|
||
ArchivedAt *time.Time `bson:"archivedAt" json:"archivedAt"` // 归档时间
|
||
}
|