Files
junhong_cmp_fiber/internal/model/system_config.go
break 17782d5f8e
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m20s
实现七月迭代公共技术基础
2026-07-23 17:52:48 +09:00

25 lines
1.4 KiB
Go

package model
import "time"
// SystemConfig 是受控系统配置的 PostgreSQL 持久化模型。
type SystemConfig struct {
ID uint `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
ConfigKey string `gorm:"column:config_key;type:varchar(150);not null;uniqueIndex:uq_system_config_key" json:"config_key"`
ConfigValue string `gorm:"column:config_value;type:text;not null" json:"config_value"`
ValueType string `gorm:"column:value_type;type:varchar(20);not null" json:"value_type"`
Module string `gorm:"column:module;type:varchar(100);not null;index:idx_system_config_module_key,priority:1" json:"module"`
Description string `gorm:"column:description;type:varchar(500);not null" json:"description"`
IsReadonly bool `gorm:"column:is_readonly;type:boolean;not null;default:false" json:"is_readonly"`
IsSensitive bool `gorm:"column:is_sensitive;type:boolean;not null;default:false" json:"is_sensitive"`
Creator uint `gorm:"column:creator;not null;default:0" json:"creator"`
Updater uint `gorm:"column:updater;not null;default:0" json:"updater"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamptz;not null;autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamptz;not null;autoUpdateTime" json:"updated_at"`
}
// TableName 返回受控系统配置表名。
func (SystemConfig) TableName() string {
return "tb_system_config"
}