第一版完成
This commit is contained in:
48
internal/model/config.go
Normal file
48
internal/model/config.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// Config 配置模型
|
||||
type Config struct {
|
||||
Id int `json:"id" dc:"主键"`
|
||||
ConfigKey string `json:"config_key" dc:"配置键"`
|
||||
ConfigValue string `json:"config_value" dc:"配置值"`
|
||||
ConfigType string `json:"config_type" dc:"配置类型 string:字符串 int:整数 bool:布尔 json:JSON"`
|
||||
GroupName string `json:"group_name" dc:"分组名称"`
|
||||
Description string `json:"description" dc:"配置描述"`
|
||||
SortOrder int `json:"sort_order" dc:"排序"`
|
||||
IsSystem int `json:"is_system" dc:"是否系统配置 0:否 1:是"`
|
||||
CreatedAt *gtime.Time `json:"created_at" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updated_at" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// SiteConfig 站点配置别名
|
||||
type SiteConfig = Config
|
||||
|
||||
// CreateConfigRequest 创建配置请求
|
||||
type CreateConfigRequest struct {
|
||||
ConfigKey string `json:"config_key" v:"required|length:1,100#配置键不能为空|配置键长度不能超过100字符" dc:"配置键"`
|
||||
ConfigValue string `json:"config_value" dc:"配置值"`
|
||||
ConfigType string `json:"config_type" dc:"配置类型"`
|
||||
GroupName string `json:"group_name" dc:"分组名称"`
|
||||
Description string `json:"description" dc:"配置描述"`
|
||||
SortOrder int `json:"sort_order" dc:"排序"`
|
||||
IsSystem int `json:"is_system" dc:"是否系统配置"`
|
||||
}
|
||||
|
||||
// UpdateConfigRequest 更新配置请求
|
||||
type UpdateConfigRequest struct {
|
||||
ConfigValue string `json:"config_value" dc:"配置值"`
|
||||
ConfigType string `json:"config_type" dc:"配置类型"`
|
||||
GroupName string `json:"group_name" dc:"分组名称"`
|
||||
Description string `json:"description" dc:"配置描述"`
|
||||
SortOrder int `json:"sort_order" dc:"排序"`
|
||||
IsSystem int `json:"is_system" dc:"是否系统配置"`
|
||||
}
|
||||
|
||||
// BatchUpdateConfigRequest 批量更新配置请求
|
||||
type BatchUpdateConfigRequest struct {
|
||||
Configs map[string]string `json:"configs" v:"required#配置不能为空" dc:"配置键值对"`
|
||||
}
|
||||
Reference in New Issue
Block a user