作业校验 websocket测试 POST http://192.168.101.52:5050/api/job/check 请求参数 参数名 类型 描述 必填 component_list list 组件列表( 列表中的每个item 参数根据具体组件具体设计) 必填 id int 组件id 必填 parents string 父组件id 多个用逗号分隔,不存在时为空 必填 children string 子组件id 多个用逗号分隔,不存在时为空 必填 code string 组件code(必须)传组件code 必填 value dict 组件参数值 必填 响应参数 参数名 类型 描述 必填 code int 示例:成功200; 作业参数错误校验失败400 ; 服务器错误500 必填 msg string 示例:sucess 必填 time string 接口返回时间 必填 data object 数据字典 必填 describ string 描述提示 可选 error_field list 参数错误列表 可选 field string 错误参数字段名 可选 value string 错误信息 可选 说明 / 示例 完整作业校验,包含了输入输出,字段筛选、数据筛选、值替换组件 ``` { "component_list": [ { "id":1, "parents":"", "children":"2", "code": "io_input", "value":{ "type": "mongodb", "host": "192.168.101.179", "port": 27017, "db": "component_center_test", "table_name": "baidu_data", "limit": 10 } }, { "id":2, "parents":"1", "children":"3", "code": "preparation_field_filter", "value":{ "operation": [ { "field": "title", "type": "str", "opt_type": "save" }, { "field": "url", "type": "str", "opt_type": "save" }, { "field": "keyword", "type": "str", "opt_type": "save" }, { "field": "site", "type": "str", "opt_type": "save" } ] } }, { "id":3, "parents":"2", "children":"4", "code": "preparation_value_filter", "value":{ "rules": "", "opt_type":"simple", "operation":[{ "field":"keyword.name2", "filter_type":"==", "value":"'测试map'" }] } }, { "id":6, "parents":"", "children":"4", "code": "io_input", "value":{ "type": "mongodb", "host": "192.168.101.179", "port": 27017, "db": "component_center_test", "table_name": "baidu_data", "fetch_keys":"keyword,site" } }, { "id":7, "parents":"", "children":"4", "code": "io_input", "value":{ "type": "mysql", "host": "192.168.101.204", "port": 3306, "db": "component_center", "table_name": "test_save", "username": "root", "password": "12345678", "fetch_keys":"url,title" } }, { "id":4, "parents":"3,6,7", "children":"5", "code": "preparation_value_replace", "value":{ "operation": [ { "field": "title", "type": "str", "opt_type": "str", "old_str":"“.*”规划编制工作$", "new_str":"哈哈哈我被替换过", "is_regular":1 }, { "field": "keyword.name", "type": "int", "opt_type": "map", "map_id":6, "relation_field":"keyword.name", "replace_field":"site" }, { "field": "url", "type": "str", "opt_type": "map", "map_id":7, "relation_field":"url", "replace_field":"title" } ] } }, { "id":5, "parents":"4", "children":"", "code": "io_output", "value":{ "type": "mongodb", "host": "192.168.101.179", "port": 27017, "db": "component_center_output", "table_name": "mongo_save_all", "username": "", "password": "", "save_type":"replace" } } ] } ```
完整作业校验,包含了输入输出,字段筛选、数据筛选、值替换组件 ``` { "component_list": [ { "id":1, "parents":"", "children":"2", "code": "io_input", "value":{ "type": "mongodb", "host": "192.168.101.179", "port": 27017, "db": "component_center_test", "table_name": "baidu_data", "limit": 10 } }, { "id":2, "parents":"1", "children":"3", "code": "preparation_field_filter", "value":{ "operation": [ { "field": "title", "type": "str", "opt_type": "save" }, { "field": "url", "type": "str", "opt_type": "save" }, { "field": "keyword", "type": "str", "opt_type": "save" }, { "field": "site", "type": "str", "opt_type": "save" } ] } }, { "id":3, "parents":"2", "children":"4", "code": "preparation_value_filter", "value":{ "rules": "", "opt_type":"simple", "operation":[{ "field":"keyword.name2", "filter_type":"==", "value":"'测试map'" }] } }, { "id":6, "parents":"", "children":"4", "code": "io_input", "value":{ "type": "mongodb", "host": "192.168.101.179", "port": 27017, "db": "component_center_test", "table_name": "baidu_data", "fetch_keys":"keyword,site" } }, { "id":7, "parents":"", "children":"4", "code": "io_input", "value":{ "type": "mysql", "host": "192.168.101.204", "port": 3306, "db": "component_center", "table_name": "test_save", "username": "root", "password": "12345678", "fetch_keys":"url,title" } }, { "id":4, "parents":"3,6,7", "children":"5", "code": "preparation_value_replace", "value":{ "operation": [ { "field": "title", "type": "str", "opt_type": "str", "old_str":"“.*”规划编制工作$", "new_str":"哈哈哈我被替换过", "is_regular":1 }, { "field": "keyword.name", "type": "int", "opt_type": "map", "map_id":6, "relation_field":"keyword.name", "replace_field":"site" }, { "field": "url", "type": "str", "opt_type": "map", "map_id":7, "relation_field":"url", "replace_field":"title" } ] } }, { "id":5, "parents":"4", "children":"", "code": "io_output", "value":{ "type": "mongodb", "host": "192.168.101.179", "port": 27017, "db": "component_center_output", "table_name": "mongo_save_all", "username": "", "password": "", "save_type":"replace" } } ] } ```