提交 98d25c46 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

udpate doc

上级 7d0b450e
......@@ -114,7 +114,7 @@ fields:
- field: field_use_excel # 从excel数据源里面取数据。
from: system.address.v1.china # 从data/system/address/v1.xlsx文件中读取名为china的工作簿。
select: city # 查询city字段。
where: state like '%山东%' # 条件是省份包含山东。
where: state like '%山东%' # 条件是省份包含山东。
postfix: "\t"
- field: field_with_children # 嵌套字段
......
zendata is a generic data generator. You can use YAML file to define the data format and use zendata to create it.
ZenData is a generic data generator. You can use YAML file to define the data format and use zendata to create it.
Parameters
Parameters:
-d --default The default config file for data format.
-c --config The current config file for data format, and it can override the config in the default file.
......@@ -32,7 +32,7 @@ Parameters
-h --help Print help.
-e --example Print the data format config file of the example.
Command Line Examples
Command Line Examples:
$>zd.exe -d demo/default.yaml # Generate 10 lines of data according to the config file specified by -d.
$>zd.exe -c demo/default.yaml # Generate 10 lines of data according to the config file specified by -c.
......@@ -47,17 +47,17 @@ $>zd.exe -d demo/default.yaml -o test.sql -t user -s mysql --trim # Remove th
$>zd.exe -i db.sql -o db # Generate YAML files for each table by parsing db.sql and store them in the db directory.
$>zd.exe -c demo/default.yaml -i test.txt --decode # Parse the file specified by -i according to the config of -d.
$>zd.exe -l # List all build-in data types.
$>zd.exe -v system.address.v1 # View data types in build-in Excel file system/address/v1.xlsx.
$>zd.exe -v system.address.v1.china # View data items in Excel sheet "china".
$>zd.exe -v system.ip.v1.yaml # View data items in build-in instances。
$>zd.exe -l List all build-in data types.
$>zd.exe -v system.address.v1 View data types in build-in Excel file system/address/v1.xlsx.
$>zd.exe -v system.address.v1.china View data items in Excel sheet "china".
$>zd.exe -v system.ip.v1.yaml View data items in build-in instances。
Service Example
Service Example:
$zd.exe -p 80 -R d:\zd\config # Listen port 80. Use d:\zd\config as the root.
$zd.exe -p 80 -R d:\zd\config Listen port 80. Use d:\zd\config as the root.
Client Call
Client Call:
$curl http://loclahost/?d=default.yaml&c=config.yaml&n=100&o=test.sql&t=user # Specify the server config file via GET.
$curl http://loclahost/?default=default.yamloutput=test.sql&table=user # Parameter names can be full.
$curl -d "default=...&config=...&lines=10" http://localhost/ # The config can be uploaded via POST.
$curl http://loclahost/?d=default.yaml&c=config.yaml&n=100&o=test.sql&t=user Specify the server config file via GET.
$curl http://loclahost/?default=default.yaml&output=test.sql&table=user Parameter names can be full.
$curl -d "default=...&config=...&lines=10" http://localhost/ The config can be uploaded via POST.
此差异已折叠。
......@@ -114,7 +114,7 @@ fields:
- field: field_use_excel # 从excel数据源里面取数据。
from: system.address.v1.china # 从data/system/address/v1.xlsx文件中读取名为china的工作簿。
select: city # 查询city字段。
where: state like '%山东%' # 条件是省份包含山东。
where: state like '%山东%' # 条件是省份包含山东。
postfix: "\t"
- field: field_with_children # 嵌套字段
......
zendata是一款通用的数据生成工具,您可以使用yaml文件来定义您的数据格式,然后交由zendata生成。
ZenData是一款通用的数据生成工具,您可以使用yaml文件来定义您的数据格式,然后交由zendata生成。
参数:
......@@ -39,10 +39,10 @@ $>zd.exe -d demo\default.yaml -n 100 -o test.sql -t user -s mysql 输出插
$>zd.exe -i db.sql -o db 根据db.sql的定义生成每个表的yaml文件,存储到db目录里面。
$>zd.exe -c demo\default.yaml -i test.txt --decode 将-i指定的文件根据-d参数的配置进行解析。
$>zd.exe -l # 列出所有內置数据。
$>zd.exe -v system.address.v1 # 查看內置Excel文件system/address/v1.xlsx中的数据表。
$>zd.exe -v system.address.v1.china # 查看內置Excel文件china数据表中的数据。
$>zd.exe -v system.ip.v1.yaml # 查看內置名为IP的Instances数据。
$>zd.exe -l 列出所有內置数据。
$>zd.exe -v system.address.v1 查看內置Excel文件system/address/v1.xlsx中的数据表。
$>zd.exe -v system.address.v1.china 查看內置Excel文件china数据表中的数据。
$>zd.exe -v system.ip.v1.yaml 查看內置名为IP的Instances数据。
服务模式举例:
......@@ -51,5 +51,5 @@ $zd.exe -p 80 -R d:\zd\config 监听80端口,以d:\zd\config为根目录。
客户端调用:
$curl http://loclahost/?d=default.yaml&c=config.yaml&n=100&o=test.sql&t=user 通过GET方式指定服务器端配置文件。
$curl http://loclahost/?default=default.yamloutput=test.sql&table=user 参数名可以用全拼。
$curl http://loclahost/?default=default.yaml&output=test.sql&table=user 参数名可以用全拼。
$curl -d "default=...&config=...&lines=10" http://localhost/ 可以通过POST方式上传配置。
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册