🎨 优化扩展模块,完成ai接入和对话功能

This commit is contained in:
2026-02-12 23:12:28 +08:00
parent 4e611d3a5e
commit 572f3aa15b
779 changed files with 194400 additions and 3136 deletions

View File

@@ -8,39 +8,44 @@ import (
// ExtensionResponse 扩展响应
type ExtensionResponse struct {
ID uint `json:"id"`
UserID uint `json:"userId"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Version string `json:"version"`
Author string `json:"author"`
Description string `json:"description"`
Homepage string `json:"homepage"`
Repository string `json:"repository"`
License string `json:"license"`
Tags []string `json:"tags"`
ExtensionType string `json:"extensionType"`
Category string `json:"category"`
Dependencies map[string]string `json:"dependencies"`
Conflicts []string `json:"conflicts"`
ManifestData map[string]interface{} `json:"manifestData"`
ScriptPath string `json:"scriptPath"`
StylePath string `json:"stylePath"`
AssetsPaths []string `json:"assetsPaths"`
Settings map[string]interface{} `json:"settings"`
Options map[string]interface{} `json:"options"`
IsEnabled bool `json:"isEnabled"`
IsInstalled bool `json:"isInstalled"`
IsSystemExt bool `json:"isSystemExt"`
InstallSource string `json:"installSource"`
InstallDate time.Time `json:"installDate"`
LastEnabled time.Time `json:"lastEnabled"`
UsageCount int `json:"usageCount"`
ErrorCount int `json:"errorCount"`
LoadTime int `json:"loadTime"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ID uint `json:"id"`
UserID uint `json:"userId"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Version string `json:"version"`
Author string `json:"author"`
Description string `json:"description"`
Homepage string `json:"homepage"`
Repository string `json:"repository"`
License string `json:"license"`
Tags []string `json:"tags"`
ExtensionType string `json:"extensionType"`
Category string `json:"category"`
Dependencies map[string]string `json:"dependencies"`
Conflicts []string `json:"conflicts"`
ManifestData map[string]interface{} `json:"manifestData"`
ScriptPath string `json:"scriptPath"`
StylePath string `json:"stylePath"`
AssetsPaths []string `json:"assetsPaths"`
Settings map[string]interface{} `json:"settings"`
Options map[string]interface{} `json:"options"`
IsEnabled bool `json:"isEnabled"`
IsInstalled bool `json:"isInstalled"`
IsSystemExt bool `json:"isSystemExt"`
InstallSource string `json:"installSource"`
SourceURL string `json:"sourceUrl"`
Branch string `json:"branch"`
AutoUpdate bool `json:"autoUpdate"`
InstallDate time.Time `json:"installDate"`
LastEnabled time.Time `json:"lastEnabled"`
LastUpdateCheck *time.Time `json:"lastUpdateCheck"`
AvailableVersion string `json:"availableVersion"`
UsageCount int `json:"usageCount"`
ErrorCount int `json:"errorCount"`
LoadTime int `json:"loadTime"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// ExtensionListResponse 扩展列表响应
@@ -151,38 +156,43 @@ func ToExtensionResponse(ext *app.AIExtension) ExtensionResponse {
}
return ExtensionResponse{
ID: ext.ID,
UserID: ext.UserID,
Name: ext.Name,
DisplayName: ext.DisplayName,
Version: ext.Version,
Author: ext.Author,
Description: ext.Description,
Homepage: ext.Homepage,
Repository: ext.Repository,
License: ext.License,
Tags: tags,
ExtensionType: ext.ExtensionType,
Category: ext.Category,
Dependencies: dependencies,
Conflicts: conflicts,
ManifestData: manifestData,
ScriptPath: ext.ScriptPath,
StylePath: ext.StylePath,
AssetsPaths: assetsPaths,
Settings: settings,
Options: options,
IsEnabled: ext.IsEnabled,
IsInstalled: ext.IsInstalled,
IsSystemExt: ext.IsSystemExt,
InstallSource: ext.InstallSource,
InstallDate: ext.InstallDate,
LastEnabled: ext.LastEnabled,
UsageCount: ext.UsageCount,
ErrorCount: ext.ErrorCount,
LoadTime: ext.LoadTime,
Metadata: metadata,
CreatedAt: ext.CreatedAt,
UpdatedAt: ext.UpdatedAt,
ID: ext.ID,
UserID: ext.UserID,
Name: ext.Name,
DisplayName: ext.DisplayName,
Version: ext.Version,
Author: ext.Author,
Description: ext.Description,
Homepage: ext.Homepage,
Repository: ext.Repository,
License: ext.License,
Tags: tags,
ExtensionType: ext.ExtensionType,
Category: ext.Category,
Dependencies: dependencies,
Conflicts: conflicts,
ManifestData: manifestData,
ScriptPath: ext.ScriptPath,
StylePath: ext.StylePath,
AssetsPaths: assetsPaths,
Settings: settings,
Options: options,
IsEnabled: ext.IsEnabled,
IsInstalled: ext.IsInstalled,
IsSystemExt: ext.IsSystemExt,
InstallSource: ext.InstallSource,
SourceURL: ext.SourceURL,
Branch: ext.Branch,
AutoUpdate: ext.AutoUpdate,
InstallDate: ext.InstallDate,
LastEnabled: ext.LastEnabled,
LastUpdateCheck: ext.LastUpdateCheck,
AvailableVersion: ext.AvailableVersion,
UsageCount: ext.UsageCount,
ErrorCount: ext.ErrorCount,
LoadTime: ext.LoadTime,
Metadata: metadata,
CreatedAt: ext.CreatedAt,
UpdatedAt: ext.UpdatedAt,
}
}