Files
PandaX/base/model/base_model.go
feilong.teng@rheinchina.com cd824b7f0c 集成完成
2021-12-12 19:49:39 +08:00

20 lines
718 B
Go

package model
import (
"gorm.io/gorm"
"time"
)
type BaseAutoModel struct {
Id int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id" form:"id"`
CreatedAt time.Time `gorm:"column:create_time" json:"create_time" form:"create_time"`
UpdatedAt time.Time `gorm:"column:update_time" json:"update_time" form:"update_time"`
DeletedAt gorm.DeletedAt `gorm:"column:delete_time" sql:"index" json:"-"`
}
type BaseModel struct {
CreatedAt time.Time `gorm:"column:create_time" json:"create_time" form:"create_time"`
UpdatedAt time.Time `gorm:"column:update_time" json:"update_time" form:"update_time"`
DeletedAt gorm.DeletedAt `gorm:"column:delete_time" sql:"index" json:"-"`
}