请求地址

/v2/webservice/apply/analyze-add-table-file

请求参数

参数名称 类型 是否必填 说明
app_id int 业务ID
attach_id 数组 文件ID

请求示例

{
    attach_id: [1,2],
    app_id: 3
}

返回参数data字段说明,data为数组,每个元素是一个表的解析结果:

参数名称

类型

说明

table_name

string

表名

table_type

array

[ 0 ] 表示generic表

[ 1 ] 表示是list表, 

[0, 1] 表示这两种表类型都可以加

status

枚举 number

 1, // 表示有效表,可以加表
 2, // 加入白名单后的有效表   
 -2, // 需要加入白名单才能加表    
 -1, // 无效表

message

message数组

count_with_refer_check

{result: boolean}

表规则白名单检查,  result为true时,表示检查通过,不需要加白名单

entry_length_check

{result: boolean, field: string[]}

白名单检查, result为true时,表示检查通过,不需要加白名单, field表示超出长度的字段

customattr2

{is_old_define: boolean}

如果is_old_define为false ,表示在表定义文件中定义了表类型和listnum, 加表的时候不允许填选别的值

message数组子元素对象字段

参数名称 类型 说明
content string
level 枚举 string info warning error

成功返回示例,

{
    "code": 0,
    "request_id": "7c8a3846-271b-4825-a49a-17a649b34e68",
    "data": [
        {
            "status": -2,
            "message": [
                {
                    "level": "error",
                    "content": "这些字段长度超出限制,uname1;uname2;uname3;uname4;uname5;uname6",
                    "check_key": "entry_length"
                },
                {
                    "level": "error",
                    "content": "List-type-table isn't allowed to configure index field! table:'test_table'",
                    "check_key": "basic"
                }
            ],
            "count_with_refer_check": {
                "result": true
            },
            "entry_length_check": {
                "result": false,
                "field": [
                    "uname1",
                    "uname2",
                    "uname3",
                    "uname4",
                    "uname5",
                    "uname6"
                ]
            },
            "tdr_version": 1,
            "splittable_keys_count": 1,
            "table_name": "entyLenErrTable",
            "customattr2": {
                "is_old_define": true,
                "table_type": 0,
                "table_maxnum": 0,
                "sort_field_num": 0,
                "sort_rule": 0,
                "data_protocol_type": "TBD"
            },
            "splittable_keys": [
                "gameid"
            ],
            "splittable_count": 1,
            "table_type": []
        },
        {
            "status": 1,
            "message": [
                {
                    "level": "info",
                    "content": "attr2.table_type[1] is not equal to req.table_type[0].",
                    "check_key": "basic"
                },
                {
                    "level": "error",
                    "content": "attr2.table_type[1] is not equal to req.table_type[0].",
                    "check_key": "basic"
                }
            ],
            "count_with_refer_check": {
                "result": true
            },
            "entry_length_check": {
                "result": true
            },
            "tdr_version": 1,
            "splittable_keys_count": 1,
            "table_name": "ListTableDemo",
            "customattr2": {
                "is_old_define": false,
                "table_type": 1,
                "table_maxnum": 1023,
                "sort_field_num": -1,
                "sort_rule": -1,
                "data_protocol_type": "TBD"
            },
            "splittable_keys": [
                "uin"
            ],
            "splittable_count": 1,
            "table_type": [
                1
            ]
        },
        {
            "status": 1,
            "message": [
                {
                    "level": "info",
                    "content": "List-type-table isn't allowed to configure index field! table:'gnericTable'",
                    "check_key": "basic"
                }
            ],
            "count_with_refer_check": {
                "result": true
            },
            "entry_length_check": {
                "result": true
            },
            "tdr_version": 1,
            "splittable_keys_count": 1,
            "table_name": "gnericTable",
            "customattr2": {
                "is_old_define": true,
                "table_type": 0,
                "table_maxnum": 0,
                "sort_field_num": 0,
                "sort_rule": 0,
                "data_protocol_type": "TBD"
            },
            "splittable_keys": [
                "gameid"
            ],
            "splittable_count": 1,
            "table_type": [
                0
            ]
        },
        {
            "status": 1,
            "message": [],
            "count_with_refer_check": {
                "result": true
            },
            "entry_length_check": {
                "result": true
            },
            "tdr_version": 1,
            "splittable_keys_count": 1,
            "table_name": "gnericOrListTable",
            "customattr2": {
                "is_old_define": true,
                "table_type": 0,
                "table_maxnum": 0,
                "sort_field_num": 0,
                "sort_rule": 0,
                "data_protocol_type": "TBD"
            },
            "splittable_keys": [
                "KeyID"
            ],
            "splittable_count": 1,
            "table_type": [
                0,
                1
            ]
        },
        {
            "status": 1,
            "message": [
                {
                    "level": "info",
                    "content": "attr2.table_type[1] is not equal to req.table_type[0].",
                    "check_key": "basic"
                },
                {
                    "level": "error",
                    "content": "attr2.table_type[1] is not equal to req.table_type[0].",
                    "check_key": "basic"
                }
            ],
            "count_with_refer_check": {
                "result": true
            },
            "entry_length_check": {
                "result": true
            },
            "tdr_version": 1,
            "splittable_keys_count": 1,
            "table_name": "ListTableDemo",
            "customattr2": {
                "is_old_define": false,
                "table_type": 1,
                "table_maxnum": 1023,
                "sort_field_num": -1,
                "sort_rule": -1,
                "data_protocol_type": "TBD"
            },
            "splittable_keys": [
                "uin"
            ],
            "splittable_count": 1,
            "table_type": [
                1
            ]
        }
    ]
}

白名单说明

count_with_refer_check.result === false 需要调用这个接口加入白名单 entry_length_check,result === false 需要加入

results matching ""

    No results matching ""