metaentity

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MulanPSL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortByType = "type"
	SortByName = "name"
)

Variables

This section is empty.

Functions

func InjectEntityDto

func InjectEntityDto(s *EntityDto)

func LoadEntityDto

func LoadEntityDto() baseiface.ISingleton

Types

type CodeDto

type CodeDto struct {
	FileName string

	FileVar     string
	DateVar     string
	BodyVar     string
	StruNameVar string
	FuncVar     string
	// contains filtered or unexported fields
}

func (*CodeDto) BodyEntity

func (e *CodeDto) BodyEntity() string

func (*CodeDto) BuildCode

func (self *CodeDto) BuildCode() string

func (*CodeDto) FuncEntity

func (e *CodeDto) FuncEntity() string

func (*CodeDto) SetBodyEntity

func (e *CodeDto) SetBodyEntity(bodyEntity string)

func (*CodeDto) SetFuncEntity

func (e *CodeDto) SetFuncEntity(funcEntity string)

type EntityDto

type EntityDto struct {
	basedto.BaseEntity

	EntityName string
	Fields     []*EntityField
	SortBy     string
	*basedata.DataPath
	StrategyType int
	CodeDto
}

func FindBeanEntityDto

func FindBeanEntityDto() *EntityDto

FindBeanEntityDto

func NewEntityDto

func NewEntityDto() *EntityDto

func (*EntityDto) AppendField

func (self *EntityDto) AppendField(fileldName, fieldType string) *EntityField

func (*EntityDto) NewField

func (self *EntityDto) NewField(fileldName, fieldType string) *EntityField

func (*EntityDto) SortByName

func (self *EntityDto) SortByName()

func (*EntityDto) SortByType

func (self *EntityDto) SortByType()

func (*EntityDto) SortFields

func (self *EntityDto) SortFields()

func (*EntityDto) ToGoEntityName

func (self *EntityDto) ToGoEntityName(trimPre bool) string

func (*EntityDto) ToGoEntityNameEs

func (self *EntityDto) ToGoEntityNameEs(trimPre bool) string

func (*EntityDto) ToGoEntityNameEsCase

func (self *EntityDto) ToGoEntityNameEsCase(trimPre bool) string

func (*EntityDto) Write2File

func (self *EntityDto) Write2File(file string, code string) error

type EntityField

type EntityField struct {
	FieldName string `json:"field_name"`
	FieldType string `json:"field_type"`
	metaistrategy.MetaIStrategy
	EntityGofield
}

func NewEntityField

func NewEntityField(strategyType int, fieldName, fieldType string) *EntityField

func (*EntityField) SelectStrategy

func (self *EntityField) SelectStrategy(strategy int) *EntityField

func (*EntityField) ToGo

func (self *EntityField) ToGo()

type EntityGofield

type EntityGofield struct {
	GoField string `json:"go_field"`
	GoType  string `json:"go_type"`
}

func (EntityGofield) SortField

func (self EntityGofield) SortField(sortBy string, that EntityGofield) bool

type IndexStrategy

type IndexStrategy struct {
	*EntityField
}

func NewIndexStrategy

func NewIndexStrategy(field *EntityField) *IndexStrategy

func (*IndexStrategy) ToGoStruField

func (self *IndexStrategy) ToGoStruField() string

func (*IndexStrategy) ToGoTag

func (self *IndexStrategy) ToGoTag() string

func (*IndexStrategy) ToGoType

func (self *IndexStrategy) ToGoType() string

type TableStrategy

type TableStrategy struct {
	*EntityField
}

func NewTableStrategy

func NewTableStrategy(f *EntityField) *TableStrategy

func (*TableStrategy) ToGoStruField

func (self *TableStrategy) ToGoStruField() string

func (*TableStrategy) ToGoTag

func (self *TableStrategy) ToGoTag() string

func (*TableStrategy) ToGoType

func (self *TableStrategy) ToGoType() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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