'init'
This commit is contained in:
15
sc-lktx-backend/internal/common/model/base.go
Normal file
15
sc-lktx-backend/internal/common/model/base.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// BaseModel 基础模型,所有表内嵌此结构,提供 ID、时间戳、软删除
|
||||
type BaseModel struct {
|
||||
ID uint `gorm:"primarykey;comment:主键ID" json:"id"`
|
||||
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间(软删除)" json:"deleted_at,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user