提交 3c6c60db 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

gen yaml files

上级 d68089a7
......@@ -16,4 +16,5 @@ require (
github.com/sirupsen/logrus v1.4.2
gopkg.in/ini.v1 v1.55.0
gopkg.in/yaml.v2 v2.2.8
gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86
)
......@@ -67,3 +67,5 @@ gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86 h1:OfFoIUYv/me30yv7XlMy4F9RJw8DEm8WQ6QG1Ph4bH0=
gopkg.in/yaml.v3 v3.0.0-20200506231410-2ff61e1afc86/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
......@@ -6,7 +6,7 @@ import (
i118Utils "github.com/easysoft/zendata/src/utils/i118"
logUtils "github.com/easysoft/zendata/src/utils/log"
"github.com/easysoft/zendata/src/utils/vari"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
"io/ioutil"
"os"
"path/filepath"
......@@ -31,7 +31,7 @@ func ParseSql(file string, out string) {
def.Fields = append(def.Fields, field)
}
bytes, _ := yaml.Marshal(def)
bytes, _ := yaml.Marshal(&def)
out = fileUtils.UpdateDir(out)
outFile := out + tableName + ".yaml"
WriteToFile(outFile, string(bytes))
......
......@@ -4,7 +4,7 @@ import (
"github.com/easysoft/zendata/src/model"
i118Utils "github.com/easysoft/zendata/src/utils/i118"
logUtils "github.com/easysoft/zendata/src/utils/log"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
"io/ioutil"
)
......
......@@ -9,7 +9,7 @@ import (
stringUtils "github.com/easysoft/zendata/src/utils/string"
"github.com/easysoft/zendata/src/utils/vari"
"github.com/jinzhu/copier"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
"io/ioutil"
"os"
"strings"
......
......@@ -55,7 +55,7 @@ type FieldBase struct {
}
type DefSimple struct {
ClsBase `yaml:",inline"`
Fields []FieldSimple `yaml:"fields,flow"`
Fields []FieldSimple `yaml:"fields"`
}
type FieldSimple struct {
Field string `yaml:"field"`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册