提交 5d8685b3 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

generate article content

上级 164e7267
......@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/easysoft/zendata/src/model"
commonUtils "github.com/easysoft/zendata/src/utils/common"
constant "github.com/easysoft/zendata/src/utils/const"
fileUtils "github.com/easysoft/zendata/src/utils/file"
i118Utils "github.com/easysoft/zendata/src/utils/i118"
logUtils "github.com/easysoft/zendata/src/utils/log"
......@@ -27,6 +28,15 @@ func GenerateForDefinition(defaultFile, configFile string, fieldsToExport *[]str
err = errors.New("")
return
}
if vari.Total < 0 {
if vari.Def.Type == constant.ConfigTypeArticle {
vari.Total = 1
} else {
vari.Total = constant.DefaultNumber
}
}
vari.Res = LoadResDef(*fieldsToExport)
topFieldNameToValuesMap := map[string][]string{}
......
......@@ -53,6 +53,7 @@ var (
DefaultPort = 8848
DefaultRoot = "./"
DefaultNumber = 10
ResDirData = "data"
ResDirYaml = "yaml"
......
......@@ -70,8 +70,8 @@ func main() {
flagSet.StringVar(&input, "i", "", "")
flagSet.StringVar(&input, "input", "", "")
flagSet.IntVar(&vari.Total, "n", 10, "")
flagSet.IntVar(&vari.Total, "lines", 10, "")
flagSet.IntVar(&vari.Total, "n", -1, "")
flagSet.IntVar(&vari.Total, "lines", -1, "")
flagSet.StringVar(&fields, "F", "", "")
flagSet.StringVar(&fields, "field", "", "")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册