2023-07-23 23:42:50 -04:00
|
|
|
package model
|
2023-05-25 21:04:43 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"gorm.io/plugin/soft_delete"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ModelBase include common fields for db control
|
|
|
|
type ModelBase struct {
|
2023-05-28 23:53:16 -04:00
|
|
|
ID uint `json:"id" gorm:"column:id;primaryKey" filter:"id,integer"`
|
|
|
|
CreatedAt int64 `json:"created_at" gorm:"<-:create;autoCreateTime:milli;column:created_at" filter:"created_at,date"`
|
|
|
|
UpdatedAt int64 `json:"updated_at" gorm:"<-;autoUpdateTime:milli;column:updated_at" filter:"updated_at,date"`
|
2023-05-25 21:04:43 -04:00
|
|
|
DeletedAt soft_delete.DeletedAt `json:"-" gorm:"column:is_deleted;softDelete:flag"`
|
|
|
|
}
|