34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package v1
|
||
|
||
import "github.com/gogf/gf/v2/frame/g"
|
||
|
||
// ============================================================================
|
||
// 管理端系统配置契约(迭代-2026-09-29)
|
||
//
|
||
// 走 settings 表(约定 S9:配置一律走 settings 表,不写 config.yaml);本模块
|
||
// 只开放白名单键,当前是 site.base_url(图片等静态资源的对外拼接前缀)。
|
||
// ============================================================================
|
||
|
||
// AdminSettingItem 配置项
|
||
type AdminSettingItem struct {
|
||
Key string `json:"key"`
|
||
Value string `json:"value"`
|
||
Remark string `json:"remark"`
|
||
}
|
||
|
||
// AdminSettingGetReq 读取白名单配置项
|
||
type AdminSettingGetReq struct {
|
||
g.Meta `path:"/admin/setting/get" method:"get" tags:"admin" summary:"系统配置读取"`
|
||
}
|
||
type AdminSettingGetRes struct {
|
||
Items []AdminSettingItem `json:"items"`
|
||
}
|
||
|
||
// AdminSettingSaveReq 保存一项配置(key 必须在白名单内)
|
||
type AdminSettingSaveReq struct {
|
||
g.Meta `path:"/admin/setting/save" method:"post" tags:"admin" summary:"系统配置保存"`
|
||
Key string `v:"required" json:"key"`
|
||
Value string `v:"length:0,255#配置值最多 255 字" json:"value"`
|
||
}
|
||
type AdminSettingSaveRes struct{}
|