Documentation ¶
Index ¶
- func AddMetadata(md *curdmodel.Metadata)
- func AddTemplate(tpl *curdmodel.Template)
- func CamelName(name string) string
- func CamelName2(name string) string
- func CamelName3(name string) string
- func ConvertGoType(f *curdmodel.MetadataField) string
- func ConvertPBType(f *curdmodel.MetadataField, isOnly int) string
- func ConvertTSType(f *curdmodel.MetadataField) string
- func CreateMetadataByTable(sourceDB *gorm.DB, system, tableSchema, tableName string, isPostgres bool) *curdpb.MetadataInfo
- func CreateMetadataByTableFromSqlServer(sourceDB *gorm.DB, system, tableSchema, tableName string) *curdpb.MetadataInfo
- func DeleteMetadata(id string)
- func DeleteTemplate(id string)
- func GenClassDefaultValue(f *curdmodel.MetadataField) stdtpl.HTML
- func GenClassField(f *curdmodel.MetadataField) stdtpl.HTML
- func GenCode(tplID, mdID string) (string, error)
- func GenCodeByFileTemplate(codeFile *curdmodel.FileTemplate, mdID string) (string, string, error)
- func GenCodeByFunctionalTemplate(functionalTemplate *curdmodel.FunctionalTemplate, mdID string, ...) ([]*apipb.GenFunctionalTemplateCodeInfo, error)
- func GenCreateColumnSql(f *curdmodel.MetadataField) string
- func GenCreateIndexsql(tableName string, f *curdmodel.MetadataField) string
- func GenCreateSql(md *curdmodel.Metadata) stdtpl.HTML
- func GenCreateUniqueIndexsql(md *curdmodel.Metadata) string
- func GenDeleteChildren(md *curdmodel.Metadata) stdtpl.HTML
- func GenDeleteChildren2(md *curdmodel.Metadata) stdtpl.HTML
- func GenDeleteChildrenByParentID(md *curdmodel.Metadata) stdtpl.HTML
- func GenDeleteChildrenByParentID2(md *curdmodel.Metadata) stdtpl.HTML
- func GenPBMessageProperty(index int, f *curdmodel.MetadataField, isOnly int) stdtpl.HTML
- func GenPBQueryCond(index int, f *curdmodel.MetadataField) stdtpl.HTML
- func GenPBToStrcut(f *curdmodel.MetadataField, str string) stdtpl.HTML
- func GenPageConfig(ctx *GenContext) stdtpl.HTML
- func GenQueryCond(f *curdmodel.MetadataField) stdtpl.HTML
- func GenQueryStructField(f *curdmodel.MetadataField) stdtpl.HTML
- func GenService(serviceID string, writeFile bool, resp *apipb.GenServiceResponse)
- func GenStrcutToPB(f *curdmodel.MetadataField, str string) stdtpl.HTML
- func GenStructField(f *curdmodel.MetadataField) stdtpl.HTML
- func GenSwagQueryParam(f *curdmodel.MetadataField) stdtpl.HTML
- func GetDefaultValue(f *curdmodel.MetadataField) string
- func GetMetadataById(mdID string) (*curdmodel.Metadata, error)
- func GetMetadataByName(name string) (*curdmodel.Metadata, error)
- func GetTemplateById(tplID string) (*curdmodel.Template, error)
- func InitGenCode(md *curdmodel.Metadata)
- func InitMetadata(db *gorm.DB, tableSchema string, isPostgres bool)
- func InitMetadataFromSqlServer(db db.DBClientInterface)
- func JsonMarshal(obj interface{}) string
- func LcFirst(s string) string
- func LoadCache()
- func LowerSnakeCase(s string) string
- func RecursiveGetRefMetadatas(md *curdmodel.Metadata, mustChildren bool) []*curdmodel.Metadata
- func RecursiveGetRefMetadatas2(md *curdmodel.Metadata) []*curdmodel.Metadata
- func RecursiveRefMetadata(parentMD *curdmodel.Metadata, field *curdmodel.MetadataField, prefix string) []string
- func RecursiveRefMetadatas(parentMD *curdmodel.Metadata, fields []*curdmodel.MetadataField, prefix string) []string
- func RemoveLastChar(s string) string
- func ToUpper(str string) string
- type ColumnInfo
- type Config
- type GenContext
- type GenServiceRequest
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMetadata ¶
func AddTemplate ¶
func CamelName2 ¶
func CamelName3 ¶
func ConvertGoType ¶
func ConvertGoType(f *curdmodel.MetadataField) string
func ConvertPBType ¶
func ConvertPBType(f *curdmodel.MetadataField, isOnly int) string
func ConvertTSType ¶
func ConvertTSType(f *curdmodel.MetadataField) string
func CreateMetadataByTable ¶
func CreateMetadataByTableFromSqlServer ¶
func CreateMetadataByTableFromSqlServer(sourceDB *gorm.DB, system, tableSchema, tableName string) *curdpb.MetadataInfo
func DeleteMetadata ¶
func DeleteMetadata(id string)
func DeleteTemplate ¶
func DeleteTemplate(id string)
func GenClassDefaultValue ¶
func GenClassDefaultValue(f *curdmodel.MetadataField) stdtpl.HTML
func GenClassField ¶
func GenClassField(f *curdmodel.MetadataField) stdtpl.HTML
func GenCodeByFileTemplate ¶
func GenCodeByFunctionalTemplate ¶
func GenCodeByFunctionalTemplate(functionalTemplate *curdmodel.FunctionalTemplate, mdID string, service *curdmodel.Service) ([]*apipb.GenFunctionalTemplateCodeInfo, error)
func GenCreateColumnSql ¶
func GenCreateColumnSql(f *curdmodel.MetadataField) string
func GenCreateIndexsql ¶
func GenCreateIndexsql(tableName string, f *curdmodel.MetadataField) string
func GenCreateSql ¶
PRIMARY KEY (`id`),
KEY `idx_api_group` (`group`), KEY `idx_api_method` (`method`), KEY `idx_api_description` (`description`), KEY `idx_api_enable` (`enable`), KEY `idx_api_check_auth` (`check_auth`), KEY `idx_api_deleted_at` (`deleted_at`), KEY `idx_api_uri` (`path`), KEY `idx_api_check_login` (`check_login`), KEY `idx_api_path` (`path`) UNIQUE KEY `unique_index` (`ptype`,`v0`,`v1`,`v2`,`v3`,`v4`,`v5`)
func GenCreateUniqueIndexsql ¶
func GenPBMessageProperty ¶
func GenPBQueryCond ¶
func GenPBQueryCond(index int, f *curdmodel.MetadataField) stdtpl.HTML
func GenPBToStrcut ¶
func GenPBToStrcut(f *curdmodel.MetadataField, str string) stdtpl.HTML
func GenPageConfig ¶
func GenPageConfig(ctx *GenContext) stdtpl.HTML
func GenQueryCond ¶
func GenQueryCond(f *curdmodel.MetadataField) stdtpl.HTML
func GenQueryStructField ¶
func GenQueryStructField(f *curdmodel.MetadataField) stdtpl.HTML
func GenService ¶
func GenService(serviceID string, writeFile bool, resp *apipb.GenServiceResponse)
func GenStrcutToPB ¶
func GenStrcutToPB(f *curdmodel.MetadataField, str string) stdtpl.HTML
func GenStructField ¶
func GenStructField(f *curdmodel.MetadataField) stdtpl.HTML
func GenSwagQueryParam ¶
func GenSwagQueryParam(f *curdmodel.MetadataField) stdtpl.HTML
func GetDefaultValue ¶
func GetDefaultValue(f *curdmodel.MetadataField) string
func InitGenCode ¶
func InitMetadataFromSqlServer ¶
func InitMetadataFromSqlServer(db db.DBClientInterface)
func JsonMarshal ¶
func JsonMarshal(obj interface{}) string
func LowerSnakeCase ¶
func RecursiveRefMetadata ¶
func RecursiveRefMetadatas ¶
func RemoveLastChar ¶
Types ¶
type ColumnInfo ¶
type ColumnInfo struct { TableSchema string `gorm:"column(table_schema)"` TableName string `gorm:"column(table_name)"` ColumnName string `gorm:"column(column_name)"` ColumnDefault string `gorm:"column(column_default)"` IsNullable string `gorm:"column(is_nullable)"` DataType string `gorm:"column(data_type)"` ColumnKey string `gorm:"column(column_key)"` ColumnComment string `gorm:"column(column_comment)"` CharacterMaximumLength string `gorm:"column(character_maximum_length)"` }
type GenContext ¶
type GenServiceRequest ¶
type GenServiceRequest struct {
ServiceID uint
}
Click to show internal directories.
Click to hide internal directories.