Documentation
¶
Index ¶
- Constants
- func InjectEntityDto(s *EntityDto)
- func LoadEntityDto() baseiface.ISingleton
- type CodeDto
- func (e *CodeDto) BodyEntity() string
- func (self *CodeDto) BuildCode() string
- func (self *CodeDto) BuildCodeDao() string
- func (self *CodeDto) DaoEntity() string
- func (e *CodeDto) FuncEntity() string
- func (e *CodeDto) SetBodyEntity(bodyEntity string)
- func (self *CodeDto) SetDaoEntity(daoEntity string)
- func (e *CodeDto) SetFuncEntity(funcEntity string)
- type EntityDto
- func (self *EntityDto) AppendField(fileldName, fieldType string) *EntityField
- func (self *EntityDto) NewField(fileldName, fieldType string) *EntityField
- func (self *EntityDto) SortByName()
- func (self *EntityDto) SortByType()
- func (self *EntityDto) SortFields()
- func (self *EntityDto) ToGoEntityName(trimPre bool) string
- func (self *EntityDto) ToGoEntityNameEs(trimPre bool) string
- func (self *EntityDto) ToGoEntityNameEsCase(trimPre bool) string
- func (self *EntityDto) Write2File(file string, code string) error
- type EntityField
- type EntityGofield
- type IndexStrategy
- type MetaIStrategy
- type TableStrategy
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 (*CodeDto) BuildCodeDao ¶
func (*CodeDto) FuncEntity ¶
func (*CodeDto) SetBodyEntity ¶
func (*CodeDto) SetDaoEntity ¶
func (*CodeDto) SetFuncEntity ¶
type EntityDto ¶
type EntityDto struct {
basedto.BaseEntity
EntityName string
Fields []*EntityField
SortBy string
*basedata.DataPath
StrategyType int
CodeDto
IfIchub20 bool
}
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 (*EntityDto) ToGoEntityNameEs ¶
func (*EntityDto) ToGoEntityNameEsCase ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.