Files
sc-lktx-mp/sc-lktx-backend/internal/common/model/base.go
huangjin fe3ad20fe2 'init'
2026-06-29 17:34:59 +08:00

16 lines
493 B
Go

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"`
}