entity

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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 CheckID

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

Types

type Base

type Base struct {
	ID string `sqlmapping:"column:id;key;" sqlresult:"column:id;"`
}

func (*Base) CheckFieldID

func (e *Base) CheckFieldID(domainCNName string) error

func (*Base) DBSchema

func (e *Base) DBSchema() string

func (*Base) GenerateID

func (e *Base) GenerateID() error

func (*Base) GetID

func (e *Base) GetID() string

func (*Base) IDColumnName

func (e *Base) IDColumnName() string

type Entity

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

type TenantIDField

type TenantIDField struct {
	TenantID string `sqlmapping:"column:tenant_id;" sqlresult:"column:tenant_id;"`
}

func (*TenantIDField) CheckFieldTenantID

func (field *TenantIDField) CheckFieldTenantID(domainCNName string) error

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;"`
	LastUpdateUserID string `sqlmapping:"column:last_update_user_id;" sqlresult:"column:last_update_user_id;"`
}

func (*UserIDFields) CheckFieldCreateUserID

func (field *UserIDFields) CheckFieldCreateUserID(domainCNName string) error

func (*UserIDFields) CheckFieldLastUpdateUserID

func (field *UserIDFields) CheckFieldLastUpdateUserID(domainCNName string) error

Jump to

Keyboard shortcuts

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