entity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 6 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

func RelativeDomainPath

func RelativeDomainPath(e Entity) string

func SnakeDomainName

func SnakeDomainName(e Entity) string

func TableName

func TableName(schema string, e Entity) string

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) DomainCNName

func (e *Base) DomainCNName() string

func (*Base) DomainCamelName

func (e *Base) DomainCamelName() string

func (*Base) ForCreate

func (e *Base) ForCreate() error

func (*Base) ForUpdate

func (e *Base) ForUpdate() error

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
	DBSchema() string
	DomainCNName() string
	DomainCamelName() string
	GenerateID() error
	GetID() string
	CheckFieldID(domainCNName string) error
	ForCreate() 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