chore: 代码格式化 - go fmt 自动调整
This commit is contained in:
@@ -30,14 +30,14 @@ func main() {
|
|||||||
SET password_hash = $1, updated_at = NOW()
|
SET password_hash = $1, updated_at = NOW()
|
||||||
WHERE email = $2
|
WHERE email = $2
|
||||||
`, string(hash), "admin@govai.gov.cn")
|
`, string(hash), "admin@govai.gov.cn")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("更新密码失败:", err)
|
log.Fatal("更新密码失败:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
rows, _ := result.RowsAffected()
|
rows, _ := result.RowsAffected()
|
||||||
fmt.Printf("✅ 已重置 admin@govai.gov.cn 的密码为: %s (影响%d行)\n", password, rows)
|
fmt.Printf("✅ 已重置 admin@govai.gov.cn 的密码为: %s (影响%d行)\n", password, rows)
|
||||||
|
|
||||||
// 验证
|
// 验证
|
||||||
var email, role string
|
var email, role string
|
||||||
err = db.QueryRow("SELECT email, role FROM users WHERE email = $1", "admin@govai.gov.cn").Scan(&email, &role)
|
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)
|
log.Fatal("查询用户失败:", err)
|
||||||
}
|
}
|
||||||
fmt.Printf("用户: %s, 角色: %s\n", email, role)
|
fmt.Printf("用户: %s, 角色: %s\n", email, role)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,4 +63,4 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("✅ 成功初始化模型提供商数据:阿里云百炼 (通义千问)")
|
fmt.Println("✅ 成功初始化模型提供商数据:阿里云百炼 (通义千问)")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ type ChatRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ChatResponse struct {
|
type ChatResponse struct {
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
PromptTokens int `json:"prompt_tokens"`
|
PromptTokens int `json:"prompt_tokens"`
|
||||||
CompletionTokens int `json:"completion_tokens"`
|
CompletionTokens int `json:"completion_tokens"`
|
||||||
TotalTokens int `json:"total_tokens"`
|
TotalTokens int `json:"total_tokens"`
|
||||||
ConversationID string `json:"conversation_id,omitempty"`
|
ConversationID string `json:"conversation_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StreamDelta struct {
|
type StreamDelta struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user