Start TEngine3.0

Start TEngine3.0
This commit is contained in:
ALEXTANG
2023-03-31 17:27:49 +08:00
parent 179765c43c
commit 36353294d6
1032 changed files with 21868 additions and 102407 deletions

View File

@@ -0,0 +1,31 @@
{{~
name = x.name
namespace = x.namespace
tables = x.tables
~}}
package {{namespace}}
type JsonLoader func(string) ([]map[string]interface{}, error)
type {{name}} struct {
{{~for table in tables ~}}
{{table.name}} *{{table.go_full_name}}
{{~end~}}
}
func NewTables(loader JsonLoader) (*{{name}}, error) {
var err error
var buf []map[string]interface{}
tables := &{{name}}{}
{{~for table in tables ~}}
if buf, err = loader("{{table.output_data_file}}") ; err != nil {
return nil, err
}
if tables.{{table.name}}, err = New{{table.go_full_name}}(buf) ; err != nil {
return nil, err
}
{{~end~}}
return tables, nil
}