entity

package
v0.0.0-...-418145e Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditedEntity

type AuditedEntity struct {
	Entity
	//创建时间
	CreationTime time.Time `json:"creationTime" bson:"creationTime" gorm:"column:CreationTime"`
	//创建人
	CreatorId *uuid.UUID `json:"creatorId" bson:"creatorId" gorm:"column:CreatorId"`
	//最后修改时间
	LastModificationTime time.Time `json:"lastModificationTime"`
	//最后修改人id
	LastModifierId *uuid.UUID `json:"lastModifierId"`
}

可审核的entity

func (*AuditedEntity) BeforeCreate

func (entity *AuditedEntity) BeforeCreate()

创建时设置对象的基本信息

func (*AuditedEntity) BeforeUpdate

func (entity *AuditedEntity) BeforeUpdate()

type Entity

type Entity struct {
	Id uuid.UUID `json:"id"`
}

一个抽象的entity对象

func (*Entity) BeforeCreate

func (entity *Entity) BeforeCreate()

自动创建id

type MayHaveTenantEntity

type MayHaveTenantEntity struct {
	TenantId *uuid.UUID `json:"tenantId"`
}

带租户的实体

type SoftDeleteEntity

type SoftDeleteEntity struct {
	//是否已删除
	IsDeleted bool `json:"isDeleted"`
	//删除人员
	DeleterId *uuid.UUID `json:"deleterId"`
	//删除时间
	DeletionTime time.Time `json:"deletionTime"`
}

支持软删除的实体

Jump to

Keyboard shortcuts

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