model

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditModel added in v1.4.0

type AuditModel struct {
	Model
	CreatedBy string `gorm:"size:64"` // 创建人标识(用户 ID 或账号)
	UpdatedBy string `gorm:"size:64"` // 更新人标识(用户 ID 或账号)
}

AuditModel 在基础字段上增加创建人/更新人审计字段。 审计字段需要业务在写入时显式赋值(例如通过中间件从用户上下文填充)。

type Model

type Model struct {
	ID        int `gorm:"primarykey"` // 主键
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"` // 逻辑删除
}

Model 默认表需携带的必须字段

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL