entity

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldID               = "ID"
	FieldTenantID         = "TenantID"
	FieldCreateUserID     = "CreateUserID"
	FieldLastUpdateUserID = "LastUpdateUserID"
	FieldCreatedTime      = "CreatedTime"
	FieldLastUpdatedTime  = "LastUpdatedTime"
)
View Source
const (
	ColumnID               = "id"
	ColumnTenantID         = "tenant_id"
	ColumnCreateUserID     = "create_user_id"
	ColumnLastUpdateUserID = "last_update_user_id"
	ColumnCreatedTime      = "created_time"
	ColumnLastUpdatedTime  = "last_updated_time"
)

Variables

This section is empty.

Functions

func CheckFieldCreateUserID added in v0.5.1

func CheckFieldCreateUserID(entity Entity) error

func CheckFieldCreateUserIDResult added in v0.5.2

func CheckFieldCreateUserIDResult(checkResult check.Result) error

func CheckFieldID added in v0.5.1

func CheckFieldID(entity Entity) error

func CheckFieldIDResult added in v0.5.2

func CheckFieldIDResult(checkResult check.Result) error

func CheckFieldLastUpdateUserID added in v0.5.1

func CheckFieldLastUpdateUserID(entity Entity) error

func CheckFieldLastUpdateUserIDResult added in v0.5.2

func CheckFieldLastUpdateUserIDResult(checkResult check.Result) error

func CheckFieldTenantID added in v0.5.1

func CheckFieldTenantID(entity Entity) error

func CheckFieldTenantIDResult added in v0.5.2

func CheckFieldTenantIDResult(checkResult check.Result) error

func CheckIDTypeValue added in v0.5.1

func CheckIDTypeValue(domainCNName string, fieldCNName string, id string) error

Types

type Base

type Base struct {
	ID string `sqlmapping:"column:id;key;" sqlresult:"column:id;" check:"required,len=32"`
}

func (*Base) DBSchema

func (e *Base) DBSchema() string

func (*Base) GenerateID

func (e *Base) GenerateID() error

func (*Base) GetID

func (e *Base) GetID() string

type Entity

type Entity interface {
	domain.Object
	GenerateID() error
	GetID() string
	ForCreate() error
	ForDelete() error
	ForUpdate() error
}

type TenantIDField

type TenantIDField struct {
	TenantID string `sqlmapping:"column:tenant_id;" sqlresult:"column:tenant_id;" check:"required,len=32"`
}

type TimeFields

type TimeFields struct {
	CreatedTime     time.Time `sqlmapping:"column:created_time;" sqlresult:"column:created_time;"`
	LastUpdatedTime time.Time `sqlmapping:"column:last_updated_time;" sqlresult:"column:last_updated_time;"`
}

type UserIDFields

type UserIDFields struct {
	CreateUserID     string `sqlmapping:"column:create_user_id;" sqlresult:"column:create_user_id;" check:"required,len=32"`
	LastUpdateUserID string `sqlmapping:"column:last_update_user_id;" sqlresult:"column:last_update_user_id;" check:"required,len=32"`
}

Jump to

Keyboard shortcuts

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