You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
547 B
20 lines
547 B
6 months ago
|
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:"-"` // 删除时间
|
||
|
}
|