2026-06-26 14:58:15 +08:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
|
|
// Tag 标签定义
|
|
|
|
|
type Tag struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
Scope string `json:"scope"` // system or personal
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
Options []TagOption `json:"options,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TagOption 标签选项
|
|
|
|
|
type TagOption struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
TagID int64 `json:"tag_id"`
|
|
|
|
|
Label string `json:"label"`
|
|
|
|
|
ConstraintText string `json:"constraint_text"`
|
|
|
|
|
SortOrder int `json:"sort_order"`
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Snippet 片段模板
|
|
|
|
|
type Snippet struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Content string `json:"content"`
|
|
|
|
|
Category string `json:"category"`
|
|
|
|
|
Scope string `json:"scope"`
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BuilderSession 构建会话
|
|
|
|
|
type BuilderSession struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
ProjectName string `json:"project_name"`
|
|
|
|
|
FinalPrompt string `json:"final_prompt"`
|
|
|
|
|
ClaudeSessionID *string `json:"claude_session_id"`
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
|
|
|
Tags []SessionTag `json:"tags,omitempty"`
|
|
|
|
|
Snippets []SessionSnippet `json:"snippets,omitempty"`
|
2026-06-26 17:26:27 +08:00
|
|
|
Materials []SessionMaterial `json:"materials,omitempty"`
|
2026-06-26 14:58:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SessionTag 构建会话标签关联
|
|
|
|
|
type SessionTag struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
BuilderSessionID int64 `json:"builder_session_id"`
|
|
|
|
|
TagID int64 `json:"tag_id"`
|
|
|
|
|
TagOptionID int64 `json:"tag_option_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SessionSnippet 构建会话片段关联
|
|
|
|
|
type SessionSnippet struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
BuilderSessionID int64 `json:"builder_session_id"`
|
|
|
|
|
SnippetID int64 `json:"snippet_id"`
|
|
|
|
|
SortOrder int `json:"sort_order"`
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-26 17:26:27 +08:00
|
|
|
// SessionMaterial 构建会话参考材料
|
|
|
|
|
type SessionMaterial struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
BuilderSessionID int64 `json:"builder_session_id"`
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
Content string `json:"content"`
|
|
|
|
|
SortOrder int `json:"sort_order"`
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-26 14:58:15 +08:00
|
|
|
// Prompt prompts 表记录(只读)
|
|
|
|
|
type Prompt struct {
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
SessionID string `json:"session_id"`
|
|
|
|
|
ProjectName string `json:"project_name"`
|
|
|
|
|
Prompt string `json:"prompt"`
|
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Suggestion 智能建议
|
|
|
|
|
type Suggestion struct {
|
|
|
|
|
Title string `json:"title"`
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
ConstraintText string `json:"constraint_text"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Settings 系统设置
|
|
|
|
|
type Settings struct {
|
|
|
|
|
LLMAPIBaseURL string `json:"llm_api_base_url"`
|
|
|
|
|
LLMModelName string `json:"llm_model_name"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// APIResponse 统一响应
|
|
|
|
|
type APIResponse struct {
|
|
|
|
|
Code int `json:"code"`
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
Data interface{} `json:"data,omitempty"`
|
|
|
|
|
}
|