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 {