package model import ( "gorm.io/gorm" "time" ) type BaseModel struct { ID uint `gorm:"primaryKey" json:"id"` // 主键ID CreatedAt *time.Time `json:"-"` // 创建时间 UpdatedAt *time.Time `json:"-"` // 更新时间 DeletedAt gorm.DeletedAt `json:"-"` // 删除时间 } type TimeModel struct { CreatedAt *time.Time `json:"-"` // 创建时间 UpdatedAt *time.Time `json:"-"` // 更新时间 DeletedAt gorm.DeletedAt `json:"-"` // 删除时间 }