From 108a17bdaf640959b435e9b03d5103efdaf9939e Mon Sep 17 00:00:00 2001 From: selfrelease Date: Mon, 22 Jun 2026 18:47:52 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=20-=20go=20fmt=20=E8=87=AA=E5=8A=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/cmd/reset-password/main.go | 6 +++--- server/cmd/seed-providers/main.go | 2 +- server/pkg/llm/provider.go | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/server/cmd/reset-password/main.go b/server/cmd/reset-password/main.go index 95dd018..449cbfb 100644 --- a/server/cmd/reset-password/main.go +++ b/server/cmd/reset-password/main.go @@ -30,14 +30,14 @@ func main() { SET password_hash = $1, updated_at = NOW() WHERE email = $2 `, string(hash), "admin@govai.gov.cn") - + if err != nil { log.Fatal("更新密码失败:", err) } rows, _ := result.RowsAffected() fmt.Printf("✅ 已重置 admin@govai.gov.cn 的密码为: %s (影响%d行)\n", password, rows) - + // 验证 var email, role string err = db.QueryRow("SELECT email, role FROM users WHERE email = $1", "admin@govai.gov.cn").Scan(&email, &role) @@ -45,4 +45,4 @@ func main() { log.Fatal("查询用户失败:", err) } fmt.Printf("用户: %s, 角色: %s\n", email, role) -} \ No newline at end of file +} diff --git a/server/cmd/seed-providers/main.go b/server/cmd/seed-providers/main.go index 876e6e3..d92c688 100644 --- a/server/cmd/seed-providers/main.go +++ b/server/cmd/seed-providers/main.go @@ -63,4 +63,4 @@ func main() { } fmt.Println("✅ 成功初始化模型提供商数据:阿里云百炼 (通义千问)") -} \ No newline at end of file +} diff --git a/server/pkg/llm/provider.go b/server/pkg/llm/provider.go index 831d27c..b8197f1 100644 --- a/server/pkg/llm/provider.go +++ b/server/pkg/llm/provider.go @@ -27,12 +27,12 @@ type ChatRequest struct { } type ChatResponse struct { - Content string `json:"content"` - Model string `json:"model"` - PromptTokens int `json:"prompt_tokens"` - CompletionTokens int `json:"completion_tokens"` - TotalTokens int `json:"total_tokens"` - ConversationID string `json:"conversation_id,omitempty"` + Content string `json:"content"` + Model string `json:"model"` + PromptTokens int `json:"prompt_tokens"` + CompletionTokens int `json:"completion_tokens"` + TotalTokens int `json:"total_tokens"` + ConversationID string `json:"conversation_id,omitempty"` } type StreamDelta struct {