database

package
v0.0.0-...-0988648 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCallbacks

func RegisterCallbacks(db *gorm.DB)

Types

type BaseModel

type BaseModel struct {
	IDModel
	MetadataTimeModel
	DeleteModel
}

type DeleteModel

type DeleteModel struct {
	Delete bool `json:"deleted" gorm:"column:deleted; not null"` // 数据软删除
}

type IDModel

type IDModel struct {
	ID uint64 `json:"id" gorm:"column:id; primaryKey"`
}

type MetadataTimeModel

type MetadataTimeModel struct {
	Ctime time.Time `json:"ctime" gorm:"column:ctime; not null"` // 状态最后一次更改
	Mtime time.Time `json:"mtime" gorm:"column:mtime; not null"` // 数据最后一次修改
}

type UniqueUUIDModel

type UniqueUUIDModel struct {
	UniqueUUID uuid.UUID `json:"unique_uuid" gorm:"column:unique_uuid; uniqueIndex; not null"`
}

Jump to

Keyboard shortcuts

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