Files
customer-server/model/entity/session.go
2026-03-14 10:02:49 +08:00

30 lines
996 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"` // 归档时间
}