refactor: replace APIKey with HasAPIKey in AIConfig and related components

This commit is contained in:
mlogclub
2026-05-30 22:41:21 +08:00
parent ac3936f7f7
commit a2f238b3f8
7 changed files with 123 additions and 15 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ type AIConfigResponse struct {
Name string `json:"name"`
Provider enums.AIProvider `json:"provider"`
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
HasAPIKey bool `json:"hasApiKey"`
ModelType enums.AIModelType `json:"modelType"`
ModelName string `json:"modelName"`
Dimension int `json:"dimension"`
@@ -51,7 +51,7 @@ func BuildAIConfigResponse(item *models.AIConfig) AIConfigResponse {
Name: item.Name,
Provider: item.Provider,
BaseURL: item.BaseURL,
APIKey: item.APIKey,
HasAPIKey: item.APIKey != "",
ModelType: item.ModelType,
ModelName: item.ModelName,
Dimension: item.Dimension,