data_factory/test_data/field_config/field_config_demo.yaml

54 lines
1.7 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 字段信息
field:
name: "字段名称"
field: "数据库中字段名称"
# 字段生成相关信息
info:
data_type: "数据类型pg数据库操作postgresql、模版中获取excel_demo、固定值fixed、随机数据/字符random、mysql数据库操作mysql"
group: "数据分组" # 同一函数需要在一条数据中多次调用时添加
get_func: "已封装数据获取函数名称"
field: "字段名称英文名称,如为数据库中字段,最好填写数据库字段名称"
content: "参数固定值" # fixed固定参数值使用
percentage: true|false # 当函数为随机数字需要添加百分比符号则为true
# 函数调用参数,根据函数规则编写参数决定
parameter:
# 示例为随机生成数字/字符串的函数参数
random_type: # 随机类型number数字letter字符串special特殊字符
- number
- letter
number:
# 最大值最小值
min_val: 0
max_val: 9
decimal_places: 13
letter:
# 是否大写
uppercase: true
length: 6 # 随机数长度
# random_list 目标列表中随机内容配置参数 执行函数get_random_list
goal_list:
-
-
# 数据查询补充 --- 预设
query:
- 查询参数: "参数值"
# 字段校验规则 --- 预设
rules:
if_must: "是否必填"
unique: "是否唯一"
if_null: "是否为空"
if_negative_number: "是否负值"
equal:
- field: "对比字段"
- type: "相同还是不同yes/no"
# 固定值(支持字段/列表)
fixed_value:
- a
- b
sql_field: "数据库校验名称(支持字段/列表)"
related:
- field: "关联字段"
rules: "关联字段的规则"
province: "省份校验"