12 lines
430 B
Go
12 lines
430 B
Go
package dao
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type BaseModel struct {
|
|
ID int64 `gorm:"bigint;primaryKey;autoIncrement;column:id;comment:主键ID" json:"id"`
|
|
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间;not null;default:current_timestamp" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间;not null;default:current_timestamp on update current_timestamp" json:"updated_at"`
|
|
}
|