Versions in this module Expand all Collapse all v0 v0.2.31 Dec 28, 2021 v0.2.30 Dec 23, 2021 v0.2.29 Dec 23, 2021 Changes in this version + const DefaultModelPkg + func GetStructNames(bases []*BaseStruct) (res []string) + func ParseStructRelationShip(relationship *schema.Relationships) []field.Relation + type BaseStruct struct + Fields []*model.Field + FileName string + GenBaseStruct bool + NewStructName string + S string + Source model.SourceCode + StructInfo parser.Param + StructName string + TableName string + func CheckStructs(db *gorm.DB, structs ...interface{}) (bases []*BaseStruct, err error) + func GenBaseStructs(db *gorm.DB, conf model.Conf) (bases *BaseStruct, err error) + func (b *BaseStruct) HasField() bool + func (b *BaseStruct) Relations() (result []field.Relation) + func (b *BaseStruct) ReviseFieldName() + type Clause interface + Creat func() string + String func() string + type ElseClause struct + func (e ElseClause) Creat() string + func (e ElseClause) Finish() string + func (e ElseClause) String() (res string) + type ForClause struct + ForRange ForRange + Value []Clause + func (f ForClause) Creat() string + func (f ForClause) Finish() string + func (f ForClause) String() string + type ForRange struct + func (f *ForRange) DataValue(dataName, clauseName string) string + func (f *ForRange) String() string + type ITableInfo interface + GetTbColumns func(schemaName string, tableName string) (result []*model.Column, err error) + GetTbIndex func(schemaName string, tableName string) (result []*model.Index, err error) + type IfClause struct + Value []Clause + func (i IfClause) Creat() string + func (i IfClause) Finish() string + func (i IfClause) String() string + type InterfaceMethod struct + Doc string + GormOption string + HasForParams bool + InterfaceName string + MethodName string + OriginStruct parser.Param + Package string + Params []parser.Param + Result []parser.Param + ResultData parser.Param + S string + Sections *Sections + SqlParams []parser.Param + SqlString string + Table string + TargetStruct string + func BuildDiyMethod(f *parser.InterfaceSet, s *BaseStruct, data []*InterfaceMethod) (checkResults []*InterfaceMethod, err error) + func (m *InterfaceMethod) DocComment() string + func (m *InterfaceMethod) GetAssertInTmpl() string + func (m *InterfaceMethod) GetParamInTmpl() string + func (m *InterfaceMethod) GetResultParamInTmpl() string + func (m *InterfaceMethod) GetTestParamInTmpl() string + func (m *InterfaceMethod) GetTestResultParamInTmpl() string + func (m *InterfaceMethod) GormRunMethodName() string + func (m *InterfaceMethod) HasGotPoint() bool + func (m *InterfaceMethod) HasNeedNewResult() bool + func (m *InterfaceMethod) HasSqlData() bool + func (m *InterfaceMethod) IsRepeatFromDifferentInterface(newMethod *InterfaceMethod) bool + func (m *InterfaceMethod) IsRepeatFromSameInterface(newMethod *InterfaceMethod) bool + func (m *InterfaceMethod) ReturnError() bool + func (m *InterfaceMethod) ReturnRowsAffected() bool + func (m *InterfaceMethod) SQLParamName(param string) string + type SQLClause struct + Value []string + func (s SQLClause) Creat() string + func (s SQLClause) Finish() string + func (s SQLClause) String() string + type Sections struct + ClauseTotal map[model.Status]int + Tmpl []string + func NewSections() *Sections + func (s *Sections) BuildSQL() ([]Clause, error) + func (s *Sections) GetName(status model.Status) string + func (s *Sections) HasMore() bool + func (s *Sections) IsNull() bool + func (s *Sections) SubIndex() + type SetClause struct + Value []Clause + func (s SetClause) Creat() string + func (s SetClause) Finish(name string) string + func (s SetClause) String() string + type WhereClause struct + Value []Clause + func (w WhereClause) Creat() string + func (w WhereClause) Finish(name string) string + func (w WhereClause) String() string