mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
20 lines
718 B
Go
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:"-"`
|
|
}
|