refactor: 完成管理后台的系统设置页面重构

This commit is contained in:
RockYang
2023-06-19 15:58:52 +08:00
parent 935c6caf96
commit af3f7ac810
9 changed files with 204 additions and 245 deletions

View File

@@ -1,8 +1,9 @@
package handler
package admin
import (
"chatplus/core"
"chatplus/core/types"
"chatplus/handler"
"chatplus/store/model"
"chatplus/utils"
"chatplus/utils/resp"
@@ -12,14 +13,14 @@ import (
)
type ConfigHandler struct {
BaseHandler
handler.BaseHandler
db *gorm.DB
}
func NewConfigHandler(app *core.AppServer, db *gorm.DB) *ConfigHandler {
handler := ConfigHandler{db: db}
handler.App = app
return &handler
h := ConfigHandler{db: db}
h.App = app
return &h
}
func (h *ConfigHandler) Update(c *gin.Context) {
@@ -71,8 +72,3 @@ func (h *ConfigHandler) Get(c *gin.Context) {
resp.SUCCESS(c, m)
}
// AllGptModels 获取所有的 GPT 模型
func (h *ConfigHandler) AllGptModels(c *gin.Context) {
resp.SUCCESS(c, types.GptModels)
}