first commit

This commit is contained in:
Yangtao
2025-11-18 17:48:20 +08:00
commit 6e56cab848
196 changed files with 65809 additions and 0 deletions

90
pkg/req/admin_system.go Normal file
View File

@ -0,0 +1,90 @@
package req
import (
"errors"
"servicebase/pkg/datasource/fields"
)
type SystemSettingPageReq struct {
Page
}
type DashboardBasicReq struct {
Date *fields.Date
}
type SystemSettingAddReq struct {
Name string `json:"name"` // 配置名称
Key string `json:"key"` // 配置Key
Value string `json:"value"` // 配置值
Desc string `json:"desc"` // 描述说明
Ext string `json:"ext"` // 扩展信息
}
func (d *SystemSettingAddReq) Check() error {
if len(d.Name) == 0 {
return errors.New("名称不能为空")
}
if len(d.Key) == 0 {
return errors.New("配置Key不能为空")
}
return nil
}
type SystemSettingUpdateReq struct {
IDBody
SystemSettingAddReq
}
func (d *SystemSettingUpdateReq) Check() error {
if len(d.ID) == 0 {
return errors.New("ID不能为空")
}
if len(d.Name) == 0 {
return errors.New("名称不能为空")
}
if len(d.Key) == 0 {
return errors.New("配置Key不能为空")
}
return nil
}
type AdminSystemContentPageReq struct {
Page
}
type AdminSystemContentAddReq struct {
Name string `json:"name"` // 配置名称
Key string `json:"key"` // 配置Key
Value string `json:"value"` // 配置值
Desc string `json:"desc"` // 描述说明
Ext string `json:"ext"` // 扩展信息
}
func (d *AdminSystemContentAddReq) Check() error {
if len(d.Name) == 0 {
return errors.New("名称不能为空")
}
if len(d.Key) == 0 {
return errors.New("配置Key不能为空")
}
return nil
}
type AdminSystemContentUpdateReq struct {
IDBody
AdminSystemContentAddReq
}
func (d *AdminSystemContentUpdateReq) Check() error {
if len(d.ID) == 0 {
return errors.New("ID不能为空")
}
if len(d.Name) == 0 {
return errors.New("名称不能为空")
}
if len(d.Key) == 0 {
return errors.New("配置Key不能为空")
}
return nil
}