package models import ( "fmt" "time" ) // BaseModel 基础模型 type BaseModel struct { ID uint `gorm:"column:id;primaryKey;autoIncrement;comment:主键ID" json:"id,omitempty"` // 主键ID } type CommonTimestampsField struct { CreatedAt time.Time `gorm:"column:created_at;index;" json:"created_at,omitempty"` // 创建时间 UpdatedAt time.Time `gorm:"column:updated_at;index;" json:"updated_at,omitempty"` // 更新时间 } func GetStringID(id uint) string { return fmt.Sprintf("%d", id) }