feat: 扩展 Session 模型,新增 UserID、Title、UpdatedAt 字段

This commit is contained in:
hhs
2026-06-14 17:30:59 +08:00
parent c01ee1d14c
commit 9ff971fd89

View File

@@ -5,7 +5,10 @@ import "time"
// Session 会话。 // Session 会话。
type Session struct { type Session struct {
ID string `json:"session_id"` ID string `json:"session_id"`
UserID string `json:"user_id,omitempty"`
Title string `json:"title"`
CreatedAt time.Time `json:"created_at"` CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Config SessionConfig `json:"config"` Config SessionConfig `json:"config"`
} }
@@ -16,6 +19,9 @@ type SessionConfig struct {
Language string `json:"language"` Language string `json:"language"`
} }
// DefaultSessionTitle 默认会话标题。
const DefaultSessionTitle = "新对话"
// DefaultConfig 默认会话配置。 // DefaultConfig 默认会话配置。
func DefaultConfig() SessionConfig { func DefaultConfig() SessionConfig {
return SessionConfig{TTSEnabled: true, DetailLevel: "low", Language: "zh-CN"} return SessionConfig{TTSEnabled: true, DetailLevel: "low", Language: "zh-CN"}