提交 6172b495 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

support child custom fields

上级 2c52f2f1
......@@ -14,8 +14,8 @@ import (
func Generate(file string, total int, fieldsToExport string, out string, table string) {
constant.ResDir = filepath.Dir(file) + string(os.PathSeparator)
gen.LoadDefinitionFromFile(file)
gen.LoadDefinitionFromFile("conf/buildin.yaml")
gen.LoadDefinitionFromFile(file)
rows := gen.GenerateForDefinition(total, fieldsToExport, out, table)
Print(rows)
......
......@@ -6,6 +6,7 @@ import (
logUtils "github.com/easysoft/zendata/src/utils/log"
"gopkg.in/yaml.v2"
"io/ioutil"
"strings"
)
func LoadDefinitionFromFile(file string) {
......@@ -23,7 +24,7 @@ func LoadDefinitionFromFile(file string) {
return
}
if constant.Definition.Title == "" { // only add the fields in first level yaml file
if strings.Index(file, "conf") != 0 && constant.Definition.Title == "" { // only add the fields in first level yaml file
constant.Definition = def
}
......
......@@ -54,7 +54,7 @@ fields:
type: custom
range: custom.yaml
- name: domain
note: 域名
note: 域名,全局定义
type: custom
- name: field4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册