init: import web_huangguo2 server project

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 10:47:38 +08:00
co-authored by Claude Opus 4.7
commit a50c9c342e
668 changed files with 141008 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
package web_cfg
import (
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"videoweb/web/service/srv_cfg"
"github.com/gin-gonic/gin"
)
// @Tags 系统配置
// @Summary 获取系统配置
// @Description 获取系统配置
// @Accept json
// @Produce json
// @Param param body GetSysConfigReq true "参数列表"
// @Success 200 {object} GetSysConfigResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/syscfg/get [GET]
func GetCfg(ctx *gin.Context) {
config, err := srv_cfg.GetSystemConfig(ctx)
if err != nil {
common.ServerJSON(ctx, err.Code, err.Error())
return
}
resp := &GetSysConfigResp{config}
common.ServerJSON(ctx, srvdef.Success, resp)
}
// @Tags 系统配置
// @Summary 修改系统配置
// @Description 修改系统配置
// @Accept json
// @Produce json
// @Param param body SysConfigUpdateReq true "参数列表"
// @Success 200 {object} SysConfigUpdateResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/syscfg/update [POST]
func UpdateCfg(ctx *gin.Context) {
var req SysConfigUpdateReq
if err := ctx.ShouldBind(&req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, err.Error())
return
}
if err := srv_cfg.UpdateSystemConfig(ctx, &req.SysCfgUpdate); err != nil {
common.ServerJSON(ctx, err.Code, err.Error())
return
}
common.ServerJSON(ctx, srvdef.Success, &SysConfigUpdateResp{})
}
+18
View File
@@ -0,0 +1,18 @@
package web_cfg
import (
"videoweb/pub/models/cfg"
"videoweb/web/service/srv_cfg"
)
type GetSysConfigReq struct {
}
type GetSysConfigResp struct {
*cfg.SysCfg
}
type SysConfigUpdateReq struct {
srv_cfg.SysCfgUpdate
}
type SysConfigUpdateResp struct{}