系统常规设置完成

This commit is contained in:
Liujian
2024-10-17 12:00:19 +08:00
parent e1c7c16d91
commit 8ba0d49fb3
12 changed files with 256 additions and 11 deletions
+3 -1
View File
@@ -1,12 +1,13 @@
package core
import (
"net/http"
"github.com/APIParkLab/APIPark/controller/ai"
ai_api "github.com/APIParkLab/APIPark/controller/ai-api"
"github.com/APIParkLab/APIPark/controller/monitor"
"github.com/APIParkLab/APIPark/controller/router"
"github.com/APIParkLab/APIPark/controller/system"
"net/http"
plugin_cluster "github.com/APIParkLab/APIPark/controller/plugin-cluster"
@@ -81,6 +82,7 @@ type plugin struct {
exportConfigController system.IExportConfigController `autowired:""`
importConfigController system.IImportConfigController `autowired:""`
aiProviderController ai.IProviderController `autowired:""`
settingController system.ISettingController `autowired:""`
apis []pm3.Api
}
+5 -1
View File
@@ -1,13 +1,17 @@
package core
import (
"github.com/eolinker/go-common/pm3"
"net/http"
"github.com/eolinker/go-common/pm3"
)
func (p *plugin) systemApis() []pm3.Api {
return []pm3.Api{
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/_export", []string{"context"}, nil, p.exportConfigController.ExportAll),
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/_import", []string{"context"}, nil, p.importConfigController.ImportAll),
pm3.CreateApiWidthDoc(http.MethodGet, "/api/v1/system/general", []string{"context"}, []string{"general"}, p.settingController.Get),
pm3.CreateApiWidthDoc(http.MethodPost, "/api/v1/system/general", []string{"context", "body"}, nil, p.settingController.Set),
}
}