metaentity

package
v0.0.0-...-0b700f4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MulanPSL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortByType = "type"
	SortByName = "name"
)
View Source
const (
	MetaStrategyIndex = iota
	MetaStrategyTable
)

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

	DaoVar      string
	BodyDtoVar  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) BuildCodeDao

func (self *CodeDto) BuildCodeDao() string

func (*CodeDto) DaoEntity

func (self *CodeDto) DaoEntity() string

func (*CodeDto) FuncEntity

func (e *CodeDto) FuncEntity() string

func (*CodeDto) SetBodyEntity

func (e *CodeDto) SetBodyEntity(bodyEntity string)

func (*CodeDto) SetDaoEntity

func (self *CodeDto) SetDaoEntity(daoEntity 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
	IfIchub20 bool
}

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"`
	FieldDesc string `json:"field_desc"`
	MetaIStrategy
	EntityGofield
	GormTag string `json:"gorm_tag"`

	CamelCase bool `json:"camel_case"`
}

func NewEntityField

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

func (*EntityField) IfFloat64

func (self *EntityField) IfFloat64() bool

func (*EntityField) IfInt64

func (self *EntityField) IfInt64() bool

func (*EntityField) SelectStrategy

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

func (*EntityField) ToGo

func (self *EntityField) ToGo() *EntityField

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

func (self *IndexStrategy) ToGoStruFieldDto() string

func (*IndexStrategy) ToGoTag

func (self *IndexStrategy) ToGoTag() string

func (*IndexStrategy) ToGoType

func (self *IndexStrategy) ToGoType() string

type MetaIStrategy

type MetaIStrategy interface {
	ToGo() *EntityField
	ToGoType() string
	ToGoTag() string
	ToGoStruField() string
	ToGoStruFieldDto() string
}

type TableStrategy

type TableStrategy struct {
	*EntityField
}

func NewTableStrategy

func NewTableStrategy(f *EntityField) *TableStrategy

func (*TableStrategy) ToGoStruField

func (self *TableStrategy) ToGoStruField() string

func (*TableStrategy) ToGoStruFieldDto

func (self *TableStrategy) ToGoStruFieldDto() string

func (*TableStrategy) ToGoTag

func (self *TableStrategy) ToGoTag() string

func (*TableStrategy) ToGoTagDto

func (self *TableStrategy) ToGoTagDto() string

func (*TableStrategy) ToGoType

func (self *TableStrategy) ToGoType() string

Jump to

Keyboard shortcuts

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