feat: Phase 1 — 项目骨架搭建,集成 Gin、SQLite 和设置页面

This commit is contained in:
2026-06-18 22:48:16 +08:00
parent 46f1bbf0f1
commit 1e9b1a2129
26 changed files with 2518 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package models
import "time"
type Analysis struct {
ID int64 `json:"id"`
RepoID int64 `json:"repo_id"`
Type string `json:"type"` // "pr_description" | "code_review"
BaseRef string `json:"base_ref"`
HeadRef string `json:"head_ref"`
Result string `json:"result"`
CreatedAt time.Time `json:"created_at"`
}
type ReviewNote struct {
ID int64 `json:"id"`
AnalysisID int64 `json:"analysis_id"`
Scope string `json:"scope"` // "overall" | "file" | "suggestion"
ScopeKey string `json:"scope_key"` // empty for overall, filename for file, suggestion ID for suggestion
Content string `json:"content"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
+12
View File
@@ -0,0 +1,12 @@
package models
import "time"
type Repository struct {
ID int64 `json:"id"`
URL string `json:"url"`
LocalPath string `json:"local_path"`
SizeBytes int64 `json:"size_bytes"`
ClonedAt time.Time `json:"cloned_at"`
LastUsed time.Time `json:"last_used"`
}
+10
View File
@@ -0,0 +1,10 @@
package models
var DefaultSettings = map[string]string{
"llm.endpoint": "https://api.openai.com/v1",
"llm.api_key": "",
"llm.model": "gpt-4o",
"review.top_n": "20",
"cache.max_age_days": "7",
"cache.max_size_mb": "5000",
}