接入luban

This commit is contained in:
2026-02-17 09:07:25 +08:00
parent edab22473a
commit 861a8a9d16
284 changed files with 17677 additions and 848 deletions

View File

@@ -0,0 +1,28 @@
{{~if __namespace != ''~}}
package {{__namespace}};
{{~end~}}
type JsonLoader func(string) ([]map[string]interface{}, error)
type {{__name}} struct {
{{~for table in __tables ~}}
{{table.name}} *{{full_name table}}
{{~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{{full_name table}}(buf) ; err != nil {
return nil, err
}
{{~end~}}
return tables, nil
}