package models import ( "time" ) // SystemConfig 系统常量设置表 type SystemConfig struct { ID uint `gorm:"primaryKey;autoIncrement" json:"id"` ConfigKey string `gorm:"type:varchar(100);not null;uniqueIndex;comment:配置键" json:"config_key" binding:"required"` ConfigValue string `gorm:"type:text;not null;comment:配置值" json:"config_value" binding:"required"` ConfigName string `gorm:"type:varchar(200);not null;comment:配置名称" json:"config_name" binding:"required"` ConfigDescription string `gorm:"type:text;comment:配置描述" json:"config_description"` ConfigType string `gorm:"type:varchar(20);not null;default:'string';comment:配置类型:string、number、boolean、json" json:"config_type"` IsSystem uint8 `gorm:"type:tinyint;not null;default:0;comment:是否系统配置:0否,1是" json:"is_system"` CreatedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" json:"updated_at"` } func (SystemConfig) TableName() string { return "system_configs" }