20 lines
771 B
Go
20 lines
771 B
Go
package models
|
|
|
|
// Config 配置表
|
|
type Config struct {
|
|
ID int64 `json:"id" gorm:"primarykey;comment:配置ID"`
|
|
Key string `json:"key" gorm:"size:200;not null;default:'';uniqueIndex:uk_key;comment:配置键"`
|
|
Value string `json:"value" gorm:"type:text;comment:配置值"`
|
|
CreatedAt int64 `json:"created_at" gorm:"type:bigint;default:0;comment:创建时间戳(秒)"`
|
|
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;default:0;comment:更新时间戳(秒)"`
|
|
IsDel int8 `json:"is_del" gorm:"type:tinyint(1);default:0;comment:逻辑删除标记(0:未删除,1:已删除)"`
|
|
}
|
|
|
|
func (Config) TableName() string {
|
|
return "config"
|
|
}
|
|
|
|
func (Config) TableOptions() string {
|
|
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置表'"
|
|
}
|