Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultTimeFormat = "2006-01-02 15:04:05" TimeLocalZone = "Asia/Shanghai" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
ID string `json:"id" gorm:"primarykey"`
CreatedAt LocalTime `json:"createdAt"`
UpdatedAt LocalTime `json:"updatedAt"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
Model ID 值使用UUID, 避免分布式环境下key冲突
LocalTime
1.可以通过配置指定格式 app.timeFormat 1.1.string -> time (指定根式序列化) 1.2.time -> string (指定根式反序列化)
Click to show internal directories.
Click to hide internal directories.