Tableman接口&事件文档

一、ACTIONS

1.表操作:

create_table

新建数据表

参数 说明 是否必填
action create_table M
organization_id 组织ID M
name 数据表中文名 M
alias 数据表别名 M
listorder 排序 O
uid_prefix uid前缀:给表中新增记录时,
自动生成的UID的前缀
M
tags 标签,字符串数组
uid_length 长度:uid长度(除了前缀外的数字部分) M
description 描述 O

请求示例:

{
    "action":"create_table", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "name":"订单表",
    "alias":"order",
    "listorder":10,
    "uid_prefix":"ODR",
    "tags":["A","B","C"],
    "uid_length":11,
    "description":"测试测试"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 81,
        "name": "订单表",
        "description": "测试测试",
        "listorder": 10,
        "reference": null,
        "uid": "TBT008696889600",
        "created": "2023-01-04 16:43:26",
        "last_modified": "2023-01-04 16:43:26",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "alias": "order",
        "is_system": 0,
        "uid_prefix": "ODR",
        "tags": [
            "A",
            "B",
            "C"
        ]
        "uid_length": 11
    },
    "action": "create_table",
    "actionid": ""
}

返回参数说明:

参数 说明 其他说明
id 数据库自增ID M
name 数据表中文名 M
description 描述 M
uid 唯一UID
created 创建时间 M
last_modified 上次修改时间 M
created_by 创建人ID O
last_modified_by 修改人ID
is_available 是否可用 (该字段暂未使用)
alias 别名
is_system 是否系统表 (该字段暂未使用)
uid_prefix uid前缀
uid_length uid长度

update_table

修改数据表,别名alias不允许修改

参数 说明 是否必填
action update_table M
organization_id 组织ID M
uid 要修改的表UID M
name 中文名 M
listorder 排序 O
uid_prefix uid前缀 M
uid_length uid长度 M
description 描述 O

请求示例

{
    "action": "update_table",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBT008696889600",
    "name": "订单表1", 
    "listorder": 11,
    "uid_prefix": "ODRA",
    "tags":["A","V","D"],
    "uid_length": 12,
    "description": "测试测试"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 81,
        "name": "订单表1",
        "description": "测试测试",
        "listorder": 11,
        "reference": null,
        "uid": "TBT008696889600",
        "created": "2023-01-04 16:43:26",
        "last_modified": "2023-01-04 16:44:22",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "alias": "order",
        "is_system": 0,
        "uid_prefix": "ODRA",
        "tags":["A","V","D"],
        "uid_length": 12
    },
    "action": "update_table",
    "actionid": ""
}

delete_table

删除数据表

参数 说明 是否必填
action delete_table M
organization_id 组织ID M
uid 表uid M

请求示例

删除数据表

{ 
    "action":"delete_table",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBT1672797625360828"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 76,
        "name": "订单表1",
        "description": "测试测试",
        "listorder": 11,
        "reference": null,
        "uid": "TBT1672797625360828",
        "created": "2023-01-04 10:00:25",
        "last_modified": "2023-01-04 10:41:28",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "alias": "order",
        "tags":["A","V","D"],
        "is_system": 0,
        "uid_prefix": "ODRA",
        "uid_length": 12
    },
    "action": "delete_table",
    "actionid": ""
}

get_table_item

获取数据表详情

参数 说明 是否必填
action get_table_item M
organization_id 组织ID M
uid 表UID M

请求示例

获取数据表详情

{ 
    "action":"get_table_item",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBT008696889600"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 81,
        "name": "订单表1",
        "description": "测试测试",
        "listorder": 11,
        "reference": null,
        "uid": "TBT008696889600",
        "created": "2023-01-04 16:43:26",
        "last_modified": "2023-01-04 16:44:22",
        "created_by": 0,
        "tags":["A","V","D"],
        "last_modified_by": 0,
        "is_available": 1,
        "alias": "order",
        "is_system": 0,
        "uid_prefix": "ODRA",
        "uid_length": 12
    },
    "action": "get_table_item",
    "actionid": ""
}

get_table_list

获取表列表

参数 说明 是否必填
action get_table_list M
organization_id 组织ID M
select 表中文名 O
where_and and过滤条件。 O
where_or or过滤条件。 O
where_in [“uid”,[“OBJ1”,”OBJ2”,”OBJ3”]] O
order_by 长度:uid中,除了前缀外,之后的数值位数 O
order_type 排序方法:asc正序,desc倒序 O
page_size 页大小 O
page_index 页码 O

请求示例

{ 
    "action":"get_table_list",
    "organization_id":"ORGANIZATION1654940612893570"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 81,
                "name": "订单表1",
                "description": "测试测试",
                "listorder": 11,
                "reference": null,
                "uid": "TBT008696889600",
                "created": "2023-01-04 16:43:26",
                "last_modified": "2023-01-04 16:44:22",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 1,
                "alias": "order",
                "is_system": 0,
                "uid_prefix": "ODRA",
                "uid_length": 12
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 1
    },
    "action": "get_table_list",
    "actionid": ""
}

2.字段操作:

create_field

新建字段

参数 说明 是否必填
action create_field M
organization_id 组织ID M
table_id 表uid M
name 字段中文名 M
alias 字段别名 M
formtype 字段类型:可选:short/long,short短文本长度为varcahr(128),long长文本text M
is_unique 是否唯一:1/0 只有当formtype=short时,才可以设置is_uniuqe=true M
listorder 排序 O
setting 自定义配置 O

请求示例

创建字段

{ 
    "action":"create_field",
    "organization_id":"ORGANIZATION1654940612893570", 
    "table_id":"TBT008696889600",
    "name":"字段名称",
    "alias":"asdasd", 
    "is_unique":1,
    "listorder":"1",
    "formtype":"short",
    "setting":{"a":"1"}
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 1194,
        "name": "字段名称",
        "alias": "asdasd",
        "table_id": "TBT008696889600",
        "description": null,
        "listorder": 1,
        "reference": null,
        "uid": "TBF008708299829",
        "created": "2023-01-04 16:59:48",
        "last_modified": "2023-01-04 16:59:48",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "formtype": "short",
        "setting": {
            "a": "1"
        },
        "is_system": 0,
        "is_unique": 1
    },
    "action": "create_field",
    "actionid": ""
}

update_field

更新字段

参数 说明 是否必填
action create_field M
organization_id 组织ID M
table_id 表uid M
name 字段中文名 M
alias 字段别名 M
formtype 字段类型:可选:short/long,short短文本长度为varcahr(128),long长文本text M
is_unique 是否唯一:1/0 只有当formtype=short时,才可以设置is_uniuqe=true M
listorder 排序 O
setting 自定义配置 O

请求示例:

{ 
    "action":"update_field",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid":"TBF008708299829",
    "table_id":"TBT008696889600",
    "name":"字段名称",
    "alias":"asdasd", 
    "is_unique":1,
    "listorder":"1",
    "formtype":"short",
    "setting":{"a":"1"}
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 1194,
        "name": "字段名称",
        "alias": "asdasd",
        "table_id": "TBT008696889600",
        "description": null,
        "listorder": 1,
        "reference": null,
        "uid": "TBF008708299829",
        "created": "2023-01-04 16:59:48",
        "last_modified": "2023-01-04 16:59:48",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "formtype": "short",
        "setting": {
            "a": "1"
        },
        "is_system": 0,
        "is_unique": 1
    },
    "action": "update_field",
    "actionid": ""
}

delete_field

删除字段

参数 说明 是否必填
action create_table M
organization_id 组织ID M
name 表中文名
alias 别名
listorder 排序
uid_prefix uid前缀:当该数据创建数据,自动
生成UID时,UID的前缀
uid_length 长度:uid中,除了前缀外,之后的数值位数
description 描述

请求示例

{ 
    "action":"delete_field",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBF008708299829"
}

返回示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 1194,
        "name": "字段名称",
        "alias": "asdasd",
        "table_id": "TBT008696889600",
        "description": null,
        "listorder": 1,
        "reference": null,
        "uid": "TBF008708299829",
        "created": "2023-01-04 16:59:48",
        "last_modified": "2023-01-04 16:59:48",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "formtype": "short",
        "setting": {
            "a": "1"
        },
        "is_system": 0,
        "is_unique": 1
    },
    "action": "delete_field",
    "actionid": ""
}

get_field_item

查询字段详情

参数 说明 是否必填
action create_table M
organization_id 组织ID M
name 表中文名
alias 别名
listorder 排序
uid_prefix uid前缀:当该数据创建数据,自动
生成UID时,UID的前缀
uid_length 长度:uid中,除了前缀外,之后的数值位数
description 描述

请求示例

获取字段详情

{ 
    "action":"get_field_item", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBF008696898604"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 1187,
        "name": "编号",
        "alias": "uid",
        "table_id": "TBT008696889600",
        "description": null,
        "listorder": 1,
        "reference": null,
        "uid": "TBF008696898604",
        "created": "2023-01-04 16:43:26",
        "last_modified": "2023-01-04 16:43:26",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "formtype": "short",
        "setting": null,
        "is_system": 1,
        "is_unique": 0
    },
    "action": "get_field_item",
    "actionid": ""
}

get_field_list

查询字段列表

参数 说明 是否必填
action get_table_list M
organization_id 组织ID M
select 表中文名 O
where_and and过滤条件。 O
where_or or过滤条件。 O
where_in [“uid”,[“OBJ1”,”OBJ2”,”OBJ3”]] O
order_by 长度:uid中,除了前缀外,之后的数值位数 O
order_type 排序方法:asc正序,desc倒序 O
page_size 页大小 O
page_index 页码 O

请求示例

查询字段列表

{ 
    "action":"get_field_list",
    "organization_id":"ORGANIZATION1654940612893570", 
    "select":["alias","uid"],
    "where_and":[["table_id","=","TBT008696889600"]]
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "alias": "uid",
                "uid": "TBF008696898604"
            },
            {
                "alias": "reference",
                "uid": "TBF008696806082"
            },
            {
                "alias": "created",
                "uid": "TBF008696814656"
            },
            {
                "alias": "last_modified",
                "uid": "TBF008696822795"
            },
            {
                "alias": "created_by",
                "uid": "TBF008696830753"
            },
            {
                "alias": "last_modified_by",
                "uid": "TBF008696838927"
            },
            {
                "alias": "is_available",
                "uid": "TBF008696848258"
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 7
    },
    "action": "get_field_list",
    "actionid": ""
}

3.条件操作:

create_condition

创建条件

参数 说明 是否必填
action create_condition M
organization_id 组织ID M
name 条件名称 M
setting 脚本 M
table_id 表UID M
listorder 排序 O
description 描述 O

请求示例

条件的脚本由前端定,在使用的时候,由前端转换成 where_andwhere_or

{ 
    "action":"create_condition", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "name": "查询条件",
    "description": "",
    "setting": {"a":1},
    "table_id": "TBT1671085045111718",
    "listorder": 100
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 31,
        "name": "查询条件",
        "description": "",
        "listorder": 100,
        "reference": "",
        "uid": "TBC008736518921",
        "created": "2023-01-04 17:40:37",
        "last_modified": "2023-01-04 17:40:37",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "setting": {
            "a": 1
        },
        "table_id": "TBT1671085045111718"
    },
    "action": "create_condition",
    "actionid": ""
}

update_condition

修改条件

参数 说明 是否必填
action create_condition M
organization_id 组织ID M
name 条件名称 M
setting 脚本 M
table_id 表UID M
listorder 排序 O
description 描述 O

请求示例

{
    "action":"update_condition", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBC008736518921",
    "name": "查询条件",
    "description": "",
    "setting": {"b":2},
    "table_id": "TBT1671085045111718",
    "listorder": 100
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 31,
        "name": "查询条件",
        "description": "",
        "listorder": 100,
        "reference": "",
        "uid": "TBC008736518921",
        "created": "2023-01-04 17:40:37",
        "last_modified": "2023-01-04 17:45:55",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "setting": {
            "b": 2
        },
        "table_id": "TBT1671085045111718"
    },
    "action": "update_condition",
    "actionid": ""
}

delete_condition

删除条件

参数 说明 是否必填
action delete_condition M
organization_id 组织ID M
uid 条件UID M

请求示例

{ 
    "action":"delete_condition", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBC008736518921"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 31,
        "name": "查询条件",
        "description": "",
        "listorder": 100,
        "reference": "",
        "uid": "TBC008736518921",
        "created": "2023-01-04 17:40:37",
        "last_modified": "2023-01-04 17:45:55",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "setting": {
            "b": 2
        },
        "table_id": "TBT1671085045111718"
    },
    "action": "delete_condition",
    "actionid": ""
}

get_condition_item

获取条件详情

参数 说明 是否必填
action create_table M
organization_id 组织ID M
uid 条件UID

请求示例

{ 
    "action":"get_condition_item", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBC008747891074"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 32,
        "name": "查询条件",
        "description": "",
        "listorder": 100,
        "reference": null,
        "uid": "TBC008747891074",
        "created": "2023-01-04 17:56:46",
        "last_modified": "2023-01-04 17:56:46",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "setting": {
            "a": 1
        },
        "table_id": "TBT1671085045111718"
    },
    "action": "get_condition_item",
    "actionid": ""
}

get_condition_list

获取条件列表

参数 说明 是否必填
action get_condition_list M
organization_id 组织ID M

请求示例

{
    "action":"get_condition_list", 
    "organization_id":"ORGANIZATION1654940612893570"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 32,
                "name": "查询条件",
                "description": "",
                "listorder": 100,
                "reference": null,
                "uid": "TBC008747891074",
                "created": "2023-01-04 17:56:46",
                "last_modified": "2023-01-04 17:56:46",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 1,
                "setting": {
                    "a": 1
                },
                "table_id": "TBT1671085045111718"
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 1
    },
    "action": "get_condition_list",
    "actionid": ""
}

4.视图操作:

create_template

新建视图模板

参数 说明 是否必填
action create_table M
organization_id 组织ID M
table_id 表UID M
setting 配置脚本 M
type 类型有:list,add,edit,view,component M
name 名称 M
alias 别名 O
listorder 排序 O
description 描述 O

请求示例

{
    "action":"create_template",
    "organization_id":"ORGANIZATION1654940612893570", 
    "table_id":"TBT1667880903644737",
    "setting":{"a":1}, 
    "type":"list",
    "name":"1",
    "alias":"",
    "listorder":1,
    "description":""
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 256,
        "name": "1",
        "description": "",
        "listorder": 1,
        "reference": null,
        "uid": "TBP008756546809",
        "created": "2023-01-04 18:09:21",
        "last_modified": "2023-01-04 18:09:21",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "type": "list",
        "condition_id": null,
        "setting": {
            "a": 1
        },
        "table_id": "TBT1667880903644737",
        "alias": ""
    },
    "action": "create_template",
    "actionid": ""
}

update_template

修改视图

参数 说明 是否必填
action create_table M
organization_id 组织ID M
uid 要修改的视图ID M
table_id 表UID M
setting 配置脚本 M
type 类型有:list,add,edit,view,component M
name 名称 M
alias 别名 O
listorder 排序 O
description 描述 O

请求示例

{
    "action":"update_template",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBP008756546809",
    "table_id":"TBT1667880903644737",
    "setting":{"b":2}, 
    "type":"list",
    "name":"1",
    "alias":"",
    "listorder":1,
    "description":""
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 256,
        "name": "1",
        "description": "",
        "listorder": 1,
        "reference": null,
        "uid": "TBP008756546809",
        "created": "2023-01-04 18:09:21",
        "last_modified": "2023-01-04 18:29:09",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "type": "list",
        "condition_id": null,
        "setting": {
            "b": 2
        },
        "table_id": "TBT1667880903644737",
        "alias": ""
    },
    "action": "update_template",
    "actionid": ""
}

delete_template

新建数据表

参数 说明 是否必填
action delete_template M
organization_id 组织ID M
uid 视图UID M

请求示例

删除视图

  • Action
{ 
    "action":"delete_template", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBP008756546809"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 256,
        "name": "1",
        "description": "",
        "listorder": 1,
        "reference": null,
        "uid": "TBP008756546809",
        "created": "2023-01-04 18:09:21",
        "last_modified": "2023-01-04 18:29:09",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "type": "list",
        "condition_id": null,
        "setting": {
            "b": 2
        },
        "table_id": "TBT1667880903644737",
        "alias": ""
    },
    "action": "delete_template",
    "actionid": ""
}

get_template_item

查询视图详情

参数 说明 是否必填
action get_template_item M
organization_id 组织ID M
uid 视图UID M

请求示例

  • Action
{ 
    "action":"get_template_item",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBP008756546809"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 256,
        "name": "1",
        "description": "",
        "listorder": 1,
        "reference": null,
        "uid": "TBP008756546809",
        "created": "2023-01-04 18:09:21",
        "last_modified": "2023-01-04 18:29:09",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "type": "list",
        "condition_id": null,
        "setting": {
            "b": 2
        },
        "table_id": "TBT1667880903644737",
        "alias": ""
    },
    "action": "get_template_item",
    "actionid": ""
}

get_template_list

查询视图列表

参数 说明 是否必填
action get_template_list M
organization_id 组织ID M

请求示例

{ 
    "action":"get_template_list",
    "organization_id":"ORGANIZATION1654940612893570" 
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 256,
                "name": "1",
                "description": "",
                "listorder": 1,
                "reference": null,
                "uid": "TBP008756546809",
                "created": "2023-01-04 18:09:21",
                "last_modified": "2023-01-04 18:29:09",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 1,
                "type": "list",
                "condition_id": null,
                "setting": {
                    "b": 2
                },
                "table_id": "TBT1667880903644737",
                "alias": ""
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 1
    },
    "action": "get_template_list",
    "actionid": ""
}

5.菜单操作:

create_menu

新建菜单

参数 说明 是否必填
action create_menu M
organization_id 组织ID M
parent_id 父菜单ID,如果是0表示跟菜单 M
name 菜单名称 M
description 描述 O
listorder 排序 O
setting 配置脚本 M
display 是否展示 0、1 M

请求示例

{ 
    "action":"create_menu",  
    "organization_id":"ORGANIZATION1654940612893570", 
    "parent_id": 0,
    "name": "列表管理菜单",  
    "description": "description",
    "listorder": 100,
    "setting": {"ces":123},
    "display": 1
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 67,
        "name": "列表管理菜单",
        "description": "description",
        "listorder": 100,
        "reference": "",
        "uid": "TBM008776115185",
        "created": "2023-01-04 18:37:34",
        "last_modified": "2023-01-04 18:37:34",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "parent_id": 0,
        "logo": null,
        "type": "system",
        "template_id": null,
        "route": null,
        "display": 1,
        "logo_type": null,
        "setting": {
            "ces": 123
        }
    },
    "action": "create_menu",
    "actionid": ""
}

update_menu

更新菜单

参数 说明 是否必填
action create_menu M
organization_id 组织ID M
uid 菜单UID M
parent_id 父菜单ID,如果是0表示跟菜单 M
name 菜单名称 M
description 描述 O
listorder 排序 O
setting 配置脚本 M
display 是否展示 0、1 M

请求示例

{ 
    "action":"update_menu",  
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid":"TBM008776115185", 
    "parent_id": 0,
    "name": "列表管理菜单",  
    "description": "description",
    "listorder": 100,
    "setting": {"ceshi":1235},
    "display": 1
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 67,
        "name": "列表管理菜单",
        "description": "description",
        "listorder": 100,
        "reference": "",
        "uid": "TBM008776115185",
        "created": "2023-01-04 18:37:34",
        "last_modified": "2023-01-04 18:43:45",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "parent_id": 0,
        "logo": null,
        "type": "system",
        "template_id": null,
        "route": null,
        "display": 1,
        "logo_type": null,
        "setting": {
            "ceshi": 1235
        }
    },
    "action": "update_menu",
    "actionid": ""
}

delete_menu

删除菜单

参数 说明 是否必填
action delete_menu M
organization_id 组织ID M
uid 菜单UID M

请求示例

{ 
    "action":"delete_menu", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBM008776115185"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 67,
        "name": "列表管理菜单",
        "description": "description",
        "listorder": 100,
        "reference": "",
        "uid": "TBM008776115185",
        "created": "2023-01-04 18:37:34",
        "last_modified": "2023-01-04 18:43:45",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "parent_id": 0,
        "logo": null,
        "type": "system",
        "template_id": null,
        "route": null,
        "display": 1,
        "logo_type": null,
        "setting": {
            "ceshi": 1235
        }
    },
    "action": "delete_menu",
    "actionid": ""
}

get_menu_item

新建数据表

参数 说明 是否必填
action create_table M
organization_id 组织ID M
name 表中文名
alias 别名
listorder 排序
uid_prefix uid前缀:当该数据创建数据,自动
生成UID时,UID的前缀
uid_length 长度:uid中,除了前缀外,之后的数值位数
description 描述

请求示例

获取菜单详情

  • Action
{ 
    "action":"get_menu_item", 
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "TBM008776115185"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 67,
        "name": "列表管理菜单",
        "description": "description",
        "listorder": 100,
        "reference": "",
        "uid": "TBM008776115185",
        "created": "2023-01-04 18:37:34",
        "last_modified": "2023-01-04 18:43:45",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 1,
        "parent_id": 0,
        "logo": null,
        "type": "system",
        "template_id": null,
        "route": null,
        "display": 1,
        "logo_type": null,
        "setting": {
            "ceshi": 1235
        }
    },
    "action": "get_menu_item",
    "actionid": ""
}

get_menu_list

获取菜单列表

参数 说明 是否必填
action get_menu_list M
organization_id 组织ID M
show_tree 是否按照树形结构展示:true/false
(true时无法分页,强制展示全部)
M

请求示例1:

{ 
    "action":"get_menu_list",
    "organization_id":"ORGANIZATION1654940612893570", 
    "show_tree": true
}

响应示例1:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 67,
                "uid": "TBM008776115185",
                "name": "列表管理菜单",
                "listorder": 100,
                "description": "description",
                "display": 1,
                "parent_id": 0,
                "setting": {
                    "ceshi": 1235
                },
                "children": [
                    {
                        "id": 68,
                        "uid": "TBM008786880636",
                        "name": "查询列表",
                        "listorder": 100,
                        "description": "description",
                        "display": 1,
                        "parent_id": 67,
                        "setting": {
                            "ces": 123
                        }
                    }
                ]
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 2
    },
    "action": "get_menu_list",
    "actionid": ""
}

请求示例2:

{ 
    "action":"get_menu_list",
    "show_tree": false
}

响应示例2:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 67,
                "uid": "TBM008776115185",
                "name": "列表管理菜单",
                "listorder": 100,
                "description": "description",
                "display": 1,
                "parent_id": 0,
                "setting": {
                    "ceshi": 1235
                }
            },
            {
                "id": 68,
                "uid": "TBM008786880636",
                "name": "查询列表",
                "listorder": 100,
                "description": "description",
                "display": 1,
                "parent_id": 67,
                "setting": {
                    "ces": 123
                }
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 2
    },
    "action": "get_menu_list",
    "actionid": ""
}

6.导入导出:

read_file_info

检查文件的内容,返回文件信息:表头列表、文件服务器上的地址

参数 说明 是否必填
action read_file_info M
file_info 上传接口返回的文件信息 M

请求示例:

{
    "action": "read_file_info",
    "file_info": {
        "name": "123.xlsx",
        "url": "file/2023/04/25/202304251640361109.xlsx",
        "uid": "a32febbbbf94efc70460d16625f319b7644792048cd58",
        "app_url": "http://dev.mixiot.top/mixservice/storage",
        "file_uid": "FL34516403600380",
        "file_name": "123.xlsx"
    }
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "headers": [
            "文件",
            "单选框2",
            "文本"
        ],
        "localfile": "storage/file/123_20230425172033818104.xlsx"
    },
    "action": "read_file_info",
    "actionid": ""
}

import_data

将上一步上传的文件,按照指定的规范导入到某个表中

参数 说明 是否必填
action import_data M
table_name 表别名 M
local_file 上一步返回的文件地址 M
key_map 字段映射。其中key是excel文件的某一列头,value是table中某个字段的alias
如下"文件": "file1"含义是:将excel中的文件列导入到file1字段,

请求示例:

{
    "action": "import_data", 
    "table_name": "card_list",
    "local_file": "storage/file/123_20230425171153891163.xlsx",  
    "key_map": {
        "文件": "file1",
        "单选框2": "image2",
        "文本": "text10"
    }
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": "数据导入执行中,总共2000条数据,请等待。",
    "action": "import_data",
    "actionid": ""
}

export_data

新增记录

参数 说明 是否必填
action export_data M
table_name 表别名 M
select 需要导出的字段 M
where_and 筛选条件 O

请求示例:

{
    "action": "export_data", 
    "table_name": "customer_service",
    "select": [
        "uid",
        "customer_name",
        "content_keywords",
        "content_description"
    ]
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": "/tableman/excel/2023/04/25/客户服务记录-20230425172728.xlsx",
    "action": "export_data",
    "actionid": ""
}

7.数据操作:

响应参数说明:

result部分为数组,包含两个元素,第一个表示操作之前的数据库状态, 第二个表示操作后的数据库状态。

因此:

  • insert操作第一个元素为空,第二个元素为插入结果
  • update第一个元素为原始数据,第二个为修改后的数据
  • delete操作第一个为原始数据,第二个为空(表示数据已经被删除)。

insert_data

新增记录

参数 说明 是否必填
action insert_data M
table_name 表别名 M
data json格式的待插入的数据。 M

请求示例:

{ 
    "action":"insert_data",
    "table_name": "order",
    "data":{ 
        "name":"zhang",
        "age":"18"
    },
    "actionid": "5013316530133"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": [
        [],
        {
            "id": 1,
            "uid": "ODRA008790581880",
            "reference": null,
            "created": "2023-01-04 18:58:20",
            "last_modified": "2023-01-04 18:58:20",
            "created_by": 0,
            "last_modified_by": 0,
            "is_available": 0,
            "name": "zhang",
            "age": "18"
        }
    ],
    "action": "insert_data",
    "actionid": "5013316530133"
}

batch_insert_data

批量新增数据

参数 说明 是否必填
action batch_insert_data M
table_name 表别名 M
data 要新增的数据列表 M

请求示例

传入多条记录,保存

{
    "action":"batch_insert_data", 
    "table_name": "order",
    "data":[
        {"name":"zhang", "age":"19"},
        {"name":"wang", "age":"106"},
        {"name":"liu", "age":"103"}
    ]
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": [
        [],
        [
            {
                "id": 2,
                "uid": "ODRA008796531797",
                "reference": null,
                "created": "2023-01-04 19:07:00",
                "last_modified": "2023-01-04 19:07:00",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "wang",
                "age": "19"
            },
            {
                "id": 3,
                "uid": "ODRA008796531815",
                "reference": null,
                "created": "2023-01-04 19:07:00",
                "last_modified": "2023-01-04 19:07:00",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "liu",
                "age": "30"
            }
        ]
    ],
    "action": "batch_insert_data",
    "actionid": "2021-08-07"
}

update_data

更新记录

参数 说明 是否必填
action update_data M
uid 要修改的数据记录UID M
table_name 表别名 M
data json格式的待修改的数据。 M

请求示例

  • Action
{ 
    "action":"update_data",
    "table_name": "order",
    "uid":"ODRA008790581880",
    "data":{
        "name":"zhang",
        "age":"28"
    }
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": [
        {
            "id": 1,
            "uid": "ODRA008790581880",
            "reference": null,
            "created": "2023-01-04 18:58:20",
            "last_modified": "2023-01-04 18:58:20",
            "created_by": 0,
            "last_modified_by": 0,
            "is_available": 0,
            "name": "zhang",
            "age": "18"
        },
        {
            "id": 1,
            "uid": "ODRA008790581880",
            "reference": null,
            "created": "2023-01-04 18:58:20",
            "last_modified": "2023-01-04 19:09:23",
            "created_by": 0,
            "last_modified_by": 0,
            "is_available": 0,
            "name": "zhang",
            "age": "28"
        }
    ],
    "action": "update_data",
    "actionid": ""
}

batch_update_data

批量更新数据

参数 说明 是否必填
action batch_update_data M
table_name 表别名
where 传入的where条件格式为[字段,操作符,值]
支持操作符: = != > < >= <= in like not like
如果是多个条件,格式为[[字段1,操作符1,值1],[字段2,操作符2,值2]]
data JSON格式:修改的内容

请求示例

{ 
    "action":"batch_update_data",
    "table_name":"order",
    "where":[
        "name","like","zhang"
    ],
    "data":{
        "age":"108"
    }
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": [
        [
            {
                "id": 1,
                "uid": "ODRA008790581880",
                "reference": null,
                "created": "2023-01-04 18:58:20",
                "last_modified": "2023-01-04 19:20:16",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "zhang",
                "age": "108"
            }
        ],
        [
            {
                "id": 1,
                "uid": "ODRA008790581880",
                "reference": null,
                "created": "2023-01-04 18:58:20",
                "last_modified": "2023-01-04 19:20:26",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "zhang",
                "age": "108"
            }
        ]
    ],
    "action": "batch_update_data",
    "actionid": ""
}

batch_update_data_by_uid

根据UID批量更新记录

参数 说明 是否必填
action batch_update_data_by_uid M
table_name 表别名 M
data 格式为数组,数组的每个元素表示一条记录
必须包含uid。
M

请求示例

批量更新,每条记录中都包含uid,根据uid更新其他字段

{
    "action":"batch_update_data_by_uid", 
    "table_name":"order",
    "data":[
        {
            "uid":"ODRA008790581880",
            "age":101
        },
        {
            "uid":"ODRA008796531797",
            "age":102
        },
        {
            "uid":"ODRA008796531815",
            "age":103
        }
    ]
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": [
        [
            {
                "id": 1,
                "uid": "ODRA008790581880",
                "reference": null,
                "created": "2023-01-04 18:58:20",
                "last_modified": "2023-01-04 19:20:26",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "zhang",
                "age": "108"
            },
            {
                "id": 2,
                "uid": "ODRA008796531797",
                "reference": null,
                "created": "2023-01-04 19:07:00",
                "last_modified": "2023-01-04 19:07:00",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "wang",
                "age": "19"
            },
            {
                "id": 3,
                "uid": "ODRA008796531815",
                "reference": null,
                "created": "2023-01-04 19:07:00",
                "last_modified": "2023-01-04 19:07:00",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "liu",
                "age": "30"
            }
        ],
        [
            {
                "id": 1,
                "uid": "ODRA008790581880",
                "reference": null,
                "created": "2023-01-04 18:58:20",
                "last_modified": "2023-01-04 19:25:09",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "zhang",
                "age": "101"
            },
            {
                "id": 2,
                "uid": "ODRA008796531797",
                "reference": null,
                "created": "2023-01-04 19:07:00",
                "last_modified": "2023-01-04 19:25:09",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "wang",
                "age": "102"
            },
            {
                "id": 3,
                "uid": "ODRA008796531815",
                "reference": null,
                "created": "2023-01-04 19:07:00",
                "last_modified": "2023-01-04 19:25:09",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "liu",
                "age": "103"
            }
        ]
    ],
    "action": "batch_update_data_by_uid",
    "actionid": ""
}

delete_data

删除一条记录

参数 说明 是否必填
action delete_data M
uid 要删除的数据记录UID M
table_name 表别名 M

请求示例

根据uid删除一条数据

{ 
    "action":"delete_data",
    "table_name":"order",
    "uid":"ODRA008790581880"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": [
        {
            "id": 1,
            "uid": "ODRA008790581880",
            "reference": null,
            "created": "2023-01-04 18:58:20",
            "last_modified": "2023-01-04 19:25:09",
            "created_by": 0,
            "last_modified_by": 0,
            "is_available": 0,
            "name": "zhang",
            "age": "101"
        },
        []
    ],
    "action": "delete_data",
    "actionid": ""
}

batch_delete_data

根据where条件批量删除满足条件的记录。

  • Action
{
    "action":"batch_delete_data", 
    "table_name":"order", 
    "where":[
        "age",">",100
    ]
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": [
        [
            {
                "id": 9,
                "uid": "ODRA008819259029",
                "reference": null,
                "created": "2023-01-04 19:39:36",
                "last_modified": "2023-01-04 19:46:01",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "wang",
                "age": "108"
            },
            {
                "id": 10,
                "uid": "ODRA008819259046",
                "reference": null,
                "created": "2023-01-04 19:39:36",
                "last_modified": "2023-01-04 19:46:01",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "liu",
                "age": "108"
            }
        ],
        []
    ],
    "action": "batch_delete_data",
    "actionid": ""
}

get_data_item

新建数据表

参数 说明 是否必填
action get_data_item M
table_name 表别名 M
uid 记录UID M

请求示例

根据数据uid查询一条记录

{ 
    "action":"get_data_item", 
    "table_name":"order", 
    "uid": "ODRA008819259008"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 8,
        "uid": "ODRA008819259008",
        "reference": null,
        "created": "2023-01-04 19:39:36",
        "last_modified": "2023-01-04 19:44:36",
        "created_by": 0,
        "last_modified_by": 0,
        "is_available": 0,
        "name": "zhang",
        "age": "9"
    },
    "action": "get_data_item",
    "actionid": ""
}

get_data_list

查询数据列表

参数 说明 是否必填
action get_data_list M
table_name 表别名 M

请求示例

查询列表,可选参数(MixIot通用参数):

  • where_and

  • where_or

  • where_in

  • big_or #和其他所有条件并列的一级条件

  • page_size

  • page_index

  • order_type

  • order_by

  • Action
{ 
    "action":"get_data_list", 
    "table_name":"order"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 8,
                "uid": "ODRA008819259008",
                "reference": null,
                "created": "2023-01-04 19:39:36",
                "last_modified": "2023-01-04 19:44:36",
                "created_by": 0,
                "last_modified_by": 0,
                "is_available": 0,
                "name": "zhang",
                "age": "9"
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 1
    },
    "action": "get_data_list",
    "actionid": ""
}

8.监听器管理:

create_listener

新建监听器

参数 说明 是否必填
action create_listener M
organization_id 组织ID M
name 监听器项目名称 M
description 描述 O
table_name 监听器触发的表名。别名 M
method 监听器触发动作:可选insert、update、delete三种 M
script 脚本,详情请参考监听器文档 M
is_available 是否开启 M

请求示例

{
    "action": "create_listener",
    "organization_id":"ORGANIZATION1654940612893570", 
    "name": "订单同步1",
    "description": "新增时新增",
    "table_name": "order",
    "method": "insert",
    "script": {
        "trigger": {
            "table": "order",
            "method": "insert"
        },
        "response": {
            "table": "order_back",
            "method": "insert",
            "data": {
                "uid": "record|new|uid",
                "name": "record|new|name",
                "price": "record|new|price",
                "amount": "record|new|amount",
                "total_price": "record|new|total_price"
            }
        }
    },
    "is_available": 0
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 31,
        "uid": "LST010400588773",
        "name": "订单同步1",
        "description": "新增时新增",
        "table_name": "order",
        "method": "insert",
        "script": {
            "trigger": {
                "table": "order",
                "method": "insert"
            },
            "response": {
                "data": {
                    "uid": "record|new|uid",
                    "name": "record|new|name",
                    "price": "record|new|price",
                    "amount": "record|new|amount",
                    "total_price": "record|new|total_price"
                },
                "table": "order_back",
                "method": "insert"
            }
        },
        "is_available": 0,
        "created": "2023-01-05 09:52:09",
        "last_modified": "2023-01-05 09:52:09",
        "created_by": "",
        "last_modified_by": "",
        "reference": ""
    },
    "action": "create_listener",
    "actionid": ""
}

update_listener

修改监听器

参数 说明 是否必填
action update_listener M
organization_id 组织ID M
name 监听器项目名称 M
uid 监听器UID M
description 描述 O
table_name 监听器触发的表名。别名 M
method 监听器触发动作:可选insert、update、delete三种 M
script 脚本,详情请参考监听器文档 M
is_available 是否开启 M

请求示例

{
    "action": "update_listener",
    "organization_id":"ORGANIZATION1654940612893570", 
    "name": "订单同步",
    "uid": "LST010400588773",
    "description": "新增时新增",
    "table_name": "order",
    "method": "insert",
    "script": {
        "trigger": {
            "table": "order",
            "method": "insert"
        },
        "response": {
            "table": "order_back",
            "method": "insert",
            "data": {
                "uid": "record|new|uid",
                "name": "record|new|name",
                "price": "record|new|price",
                "amount": "record|new|amount",
                "total_price": "record|new|total_price"
            }
        }
    },
    "is_available": 0
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 30,
        "uid": "LST010400588773",
        "name": "订单同步",
        "description": "新增时新增",
        "table_name": "order",
        "method": "insert",
        "script": {
            "trigger": {
                "table": "order",
                "method": "insert"
            },
            "response": {
                "data": {
                    "uid": "record|new|uid",
                    "name": "record|new|name",
                    "price": "record|new|price",
                    "amount": "record|new|amount",
                    "total_price": "record|new|total_price"
                },
                "table": "order_back",
                "method": "insert"
            }
        },
        "is_available": 0,
        "created": "2023-01-05 09:36:39",
        "last_modified": "2023-01-05 11:22:27",
        "created_by": "",
        "last_modified_by": "",
        "reference": ""
    },
    "action": "update_listener",
    "actionid": ""
}

delete_listener

删除监听器

参数 说明 是否必填
action delete_listener M
organization_id 组织ID M
uid 监听器UID M

请求示例

{
    "action":"delete_listener",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid":"LST010411274615"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 31,
        "uid": "LST010411274615",
        "name": "订单同步",
        "description": "新增时新增",
        "table_name": "order",
        "method": "insert",
        "script": {
            "trigger": {
                "table": "order",
                "method": "insert"
            },
            "response": {
                "data": {
                    "uid": "record|new|uid",
                    "name": "record|new|name",
                    "price": "record|new|price",
                    "amount": "record|new|amount",
                    "total_price": "record|new|total_price"
                },
                "table": "order_back",
                "method": "insert"
            }
        },
        "is_available": 0,
        "created": "2023-01-05 09:52:09",
        "last_modified": "2023-01-05 09:54:05",
        "created_by": "",
        "last_modified_by": "",
        "reference": ""
    },
    "action": "delete_listener",
    "actionid": ""
}

listener_list

监听器列表

参数 说明 是否必填
action listener_list M
organization_id 组织ID M

请求示例

{ 
    "action":"listener_list",
    "organization_id":"ORGANIZATION1654940612893570" 
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 29,
                "uid": "LST1671508898704377",
                "name": "测试项目1",
                "description": "",
                "table_name": "order",
                "method": "insert",
                "script": {
                    "trigger": {
                        "table": "order",
                        "method": "insert"
                    },
                    "response": {
                        "data": {
                            "uid": "record|new|uid",
                            "name": "record|new|name",
                            "type": "record|new|type",
                            "price": "record|new|price",
                            "amount": "record|new|amount",
                            "total_price": "record|new|total_price"
                        },
                        "table": "order_back",
                        "method": "insert"
                    }
                },
                "is_available": 1,
                "created": "2022-12-20 12:01:38",
                "last_modified": "2023-01-05 09:20:40",
                "created_by": "",
                "last_modified_by": "",
                "reference": ""
            },
            {
                "id": 30,
                "uid": "LST010400588773",
                "name": "订单同步1",
                "description": "新增时新增",
                "table_name": "order",
                "method": "insert",
                "script": {
                    "trigger": {
                        "table": "order",
                        "method": "insert"
                    },
                    "response": {
                        "data": {
                            "uid": "record|new|uid",
                            "name": "record|new|name",
                            "price": "record|new|price",
                            "amount": "record|new|amount",
                            "total_price": "record|new|total_price"
                        },
                        "table": "order_back",
                        "method": "insert"
                    }
                },
                "is_available": 0,
                "created": "2023-01-05 09:36:39",
                "last_modified": "2023-01-05 09:36:39",
                "created_by": "",
                "last_modified_by": "",
                "reference": ""
            },
            {
                "id": 32,
                "uid": "LST010419572363",
                "name": "订单同步1",
                "description": "新增时新增",
                "table_name": "order",
                "method": "insert",
                "script": {
                    "trigger": {
                        "table": "order",
                        "method": "insert"
                    },
                    "response": {
                        "data": {
                            "uid": "record|new|uid",
                            "name": "record|new|name",
                            "price": "record|new|price",
                            "amount": "record|new|amount",
                            "total_price": "record|new|total_price"
                        },
                        "table": "order_back",
                        "method": "insert"
                    }
                },
                "is_available": 0,
                "created": "2023-01-05 10:04:07",
                "last_modified": "2023-01-05 10:04:07",
                "created_by": "",
                "last_modified_by": "",
                "reference": ""
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 3
    },
    "action": "listener_list",
    "actionid": ""
}

listener_item

监听器详情

参数 说明 是否必填
action listener_item M
organization_id 组织ID M
uid 监听器UID M

请求示例

{ 
    "action":"listener_item",  
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "LST1671508898704377"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 29,
        "uid": "LST1671508898704377",
        "name": "测试项目1",
        "description": "",
        "table_name": "order",
        "method": "insert",
        "script": {
            "trigger": {
                "table": "order",
                "method": "insert"
            },
            "response": {
                "data": {
                    "uid": "record|new|uid",
                    "name": "record|new|name",
                    "type": "record|new|type",
                    "price": "record|new|price",
                    "amount": "record|new|amount",
                    "total_price": "record|new|total_price"
                },
                "table": "order_back",
                "method": "insert"
            }
        },
        "is_available": 1,
        "created": "2022-12-20 12:01:38",
        "last_modified": "2023-01-05 09:20:40",
        "created_by": "",
        "last_modified_by": "",
        "reference": ""
    },
    "action": "listener_item",
    "actionid": ""
}

open_listener

开启监听器

参数 说明 是否必填
action open_listener M
organization_id 组织ID M
uid 监听器UID M

请求示例

{
    "action":"open_listener",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid":"LST1671508898704377"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "uid": "LST1671508898704377"
    },
    "action": "open_listener",
    "actionid": ""
}

close_listener

关闭监听器

参数 说明 是否必填
action close_listener M
organization_id 组织ID M
uid 监听器UID M

请求示例

{
    "action":"close_listener",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid":"LST1671508898704377"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "uid": "LST1671508898704377"
    },
    "action": "close_listener",
    "actionid": ""
}

9.HV管理:

create_hv

创建HV项目

参数 说明 是否必填
action create_hv M
organization_id 组织ID M
name 项目名称 M
is_active 是否激活:0、1 激活的项目会按照项目配置自动运行。 M
run_by 定时运行的周期,可选:month,week,day,hour。自动运行时有效 M
run_day 当run_by=month,范围131表示一个月的第几天。
当run_by=week,范围1
7,表示一周的第几天,
周一是每周的第一天。自动运行时有效
M
run_hour 第几小时。范围0~23。自动运行时有效 M
run_minute 第几分钟。范围0~59。自动运行时有效 M
table_uid 数据的来源。表的uid M
script 脚本说明。详情请查看HV项目文档。 M

请求示例

{
    "action": "create_hv",
    "organization_id":"ORGANIZATION1654940612893570", 
    "name": "test_hv",
    "is_active": 0,
    "run_by": "hour",
    "run_day": 1,
    "run_hour": 0,
    "run_minute": 0,
    "table_uid": "TBT1631957227230875",
    "script": {
        "datasource": {
            "table": "order",
            "field": [
                "uid",
                "name",
                "amount",
                "type",
                "price"
            ],
            "where": [
                [
                    "price",
                    ">",
                    "fix|int|0"
                ]
            ]
        },
        "compute": [
            {
                "direction": "H",
                "variable_name": "total_price",
                "function": "times",
                "parameters": [
                    "table|amount",
                    "table|price"
                ]
            },
            {
                "direction": "V",
                "variable_name": "全部订单总价",
                "function": "sum",
                "parameters": [
                    "compute|订单总价"
                ]
            },
            {
                "variable_name": "订单数量",
                "direction": "G",
                "groupby": [
                    "type"
                ],
                "where": [],
                "function": "count",
                "parameters": [
                    "table|uid"
                ]
            }
        ],
        "output": [
            {
                "output_strategy": "single",
                "output_method": "insert",
                "target_table": "res",
                "data": {
                    "k": "fix|string|全部订单总价",
                    "v": "compute|全部订单总价"
                }
            },
            {
                "output_strategy": "multi",
                "output_method": "update",
                "target_table": "order",
                "data": {
                    "uid": "table|uid",
                    "total_price": "compute|total_price"
                }
            },
            {
                "output_strategy": "group",
                "group_variable": "订单数量",
                "target_table": "res",
                "output_method": "insert",
                "data": {
                    "k": "groupby|订单数量|type",
                    "v": "compute|订单数量"
                }
            }
        ]
    }
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 16,
        "uid": "HV010595873960",
        "table_uid": "TBT1631957227230875",
        "name": "test_hv",
        "description": "",
        "script": {
            "output": [
                {
                    "data": {
                        "k": "fix|string|全部订单总价",
                        "v": "compute|全部订单总价"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "output_strategy": "single"
                },
                {
                    "data": {
                        "uid": "table|uid",
                        "total_price": "compute|total_price"
                    },
                    "target_table": "order",
                    "output_method": "update",
                    "output_strategy": "multi"
                },
                {
                    "data": {
                        "k": "groupby|订单数量|type",
                        "v": "compute|订单数量"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "group_variable": "订单数量",
                    "output_strategy": "group"
                }
            ],
            "compute": [
                {
                    "function": "times",
                    "direction": "H",
                    "parameters": [
                        "table|amount",
                        "table|price"
                    ],
                    "variable_name": "total_price"
                },
                {
                    "function": "sum",
                    "direction": "V",
                    "parameters": [
                        "compute|订单总价"
                    ],
                    "variable_name": "全部订单总价"
                },
                {
                    "where": [],
                    "groupby": [
                        "type"
                    ],
                    "function": "count",
                    "direction": "G",
                    "parameters": [
                        "table|uid"
                    ],
                    "variable_name": "订单数量"
                }
            ],
            "datasource": {
                "field": [
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table": "order",
                "where": [
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ]
            }
        },
        "is_available": 0,
        "created": "2023-01-05 14:17:58",
        "last_modified": "2023-01-05 14:17:58",
        "created_by": "",
        "last_modified_by": "",
        "reference": "",
        "run_by": "hour",
        "run_day": 1,
        "run_hour": 0,
        "run_minute": 0,
        "is_active": 0
    },
    "action": "create_hv",
    "actionid": ""
}

update_hv

修改HV项目

参数 说明 是否必填
action update_hv M
organization_id 组织ID M
uid 项目UID M
name 项目名称 M
is_active 是否激活:0、1 激活的项目会按照项目配置自动运行。 M
run_by 定时运行的周期,可选:month,week,day,hour。自动运行时有效 M
run_day 当run_by=month,范围131表示一个月的第几天。
当run_by=week,范围1
7,表示一周的第几天,
周一是每周的第一天。自动运行时有效
M
run_hour 第几小时。范围0~23。自动运行时有效 M
run_minute 第几分钟。范围0~59。自动运行时有效 M
table_uid 数据的来源。表的uid M
script 脚本说明。详情请查看HV项目文档。 M

请求示例

{
    "action": "update_hv",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "HV1671524702953648",
    "name": "test_hv",
    "is_active": 0,
    "run_by": "hour",
    "run_day": 1,
    "run_hour": 0,
    "run_minute": 0,
    "table_uid": "TBT1631957227230875",
    "script": {
        "datasource": {
            "table": "order",
            "field": [
                "uid",
                "name",
                "amount",
                "type",
                "price"
            ],
            "where": [
                [
                    "price",
                    ">",
                    "fix|int|0"
                ]
            ]
        },
        "compute": [
            {
                "direction": "H",
                "variable_name": "total_price",
                "function": "times",
                "parameters": [
                    "table|amount",
                    "table|price"
                ]
            },
            {
                "direction": "V",
                "variable_name": "全部订单总价",
                "function": "sum",
                "parameters": [
                    "compute|订单总价"
                ]
            },
            {
                "variable_name": "订单数量",
                "direction": "G",
                "groupby": [
                    "type"
                ],
                "where": [],
                "function": "count",
                "parameters": [
                    "table|uid"
                ]
            }
        ],
        "output": [
            {
                "output_strategy": "single",
                "output_method": "insert",
                "target_table": "res",
                "data": {
                    "k": "fix|string|全部订单总价",
                    "v": "compute|全部订单总价"
                }
            },
            {
                "output_strategy": "multi",
                "output_method": "update",
                "target_table": "order",
                "data": {
                    "uid": "table|uid",
                    "total_price": "compute|total_price"
                }
            },
            {
                "output_strategy": "group",
                "group_variable": "订单数量",
                "target_table": "res",
                "output_method": "insert",
                "data": {
                    "k": "groupby|订单数量|type",
                    "v": "compute|订单数量"
                }
            }
        ]
    }
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 12,
        "uid": "HV1671524702953648",
        "table_uid": "TBT1631957227230875",
        "name": "test_hv",
        "description": "",
        "script": {
            "output": [
                {
                    "data": {
                        "k": "fix|string|全部订单总价",
                        "v": "compute|全部订单总价"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "output_strategy": "single"
                },
                {
                    "data": {
                        "uid": "table|uid",
                        "total_price": "compute|total_price"
                    },
                    "target_table": "order",
                    "output_method": "update",
                    "output_strategy": "multi"
                },
                {
                    "data": {
                        "k": "groupby|订单数量|type",
                        "v": "compute|订单数量"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "group_variable": "订单数量",
                    "output_strategy": "group"
                }
            ],
            "compute": [
                {
                    "function": "times",
                    "direction": "H",
                    "parameters": [
                        "table|amount",
                        "table|price"
                    ],
                    "variable_name": "total_price"
                },
                {
                    "function": "sum",
                    "direction": "V",
                    "parameters": [
                        "compute|订单总价"
                    ],
                    "variable_name": "全部订单总价"
                },
                {
                    "where": [],
                    "groupby": [
                        "type"
                    ],
                    "function": "count",
                    "direction": "G",
                    "parameters": [
                        "table|uid"
                    ],
                    "variable_name": "订单数量"
                }
            ],
            "datasource": {
                "field": [
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table": "order",
                "where": [
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ]
            }
        },
        "is_available": 0,
        "created": "2022-12-20 16:25:02",
        "last_modified": "2023-01-05 14:28:35",
        "created_by": "",
        "last_modified_by": "",
        "reference": "",
        "run_by": "hour",
        "run_day": 1,
        "run_hour": 0,
        "run_minute": 0,
        "is_active": 0
    },
    "action": "update_hv",
    "actionid": ""
}

delete_hv

删除一个HV项目

参数 说明 是否必填
action delete_hv M
organization_id 组织ID M
uid 项目uid M

请求示例

{ 
    "action": "delete_hv",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "HV1671524702953648"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 12,
        "uid": "HV1671524702953648",
        "table_uid": "TBT1631957227230875",
        "name": "test_hv",
        "description": "",
        "script": {
            "output": [
                {
                    "data": {
                        "k": "fix|string|全部订单总价",
                        "v": "compute|全部订单总价"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "output_strategy": "single"
                },
                {
                    "data": {
                        "uid": "table|uid",
                        "total_price": "compute|total_price"
                    },
                    "target_table": "order",
                    "output_method": "update",
                    "output_strategy": "multi"
                },
                {
                    "data": {
                        "k": "groupby|订单数量|type",
                        "v": "compute|订单数量"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "group_variable": "订单数量",
                    "output_strategy": "group"
                }
            ],
            "compute": [
                {
                    "function": "times",
                    "direction": "H",
                    "parameters": [
                        "table|amount",
                        "table|price"
                    ],
                    "variable_name": "total_price"
                },
                {
                    "function": "sum",
                    "direction": "V",
                    "parameters": [
                        "compute|订单总价"
                    ],
                    "variable_name": "全部订单总价"
                },
                {
                    "where": [],
                    "groupby": [
                        "type"
                    ],
                    "function": "count",
                    "direction": "G",
                    "parameters": [
                        "table|uid"
                    ],
                    "variable_name": "订单数量"
                }
            ],
            "datasource": {
                "field": [
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table": "order",
                "where": [
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ]
            }
        },
        "is_available": 0,
        "created": "2022-12-20 16:25:02",
        "last_modified": "2023-01-05 14:28:35",
        "created_by": "",
        "last_modified_by": "",
        "reference": "",
        "run_by": "hour",
        "run_day": 1,
        "run_hour": 0,
        "run_minute": 0,
        "is_active": 0
    },
    "action": "delete_hv",
    "actionid": ""
}

hv_list

HV项目列表

参数 说明 是否必填
action hv_list M
organization_id 组织ID M

请求示例

{ 
    "action": "hv_list",
    "organization_id":"ORGANIZATION1654940612893570" 
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "data": [
            {
                "id": 15,
                "uid": "HV010479411786",
                "table_uid": "TBT1631957227230875",
                "name": "test_hv",
                "description": "",
                "is_available": 0,
                "created": "2023-01-05 11:30:17",
                "last_modified": "2023-01-05 11:30:17",
                "created_by": "",
                "last_modified_by": "",
                "reference": "",
                "run_by": "hour",
                "run_day": 1,
                "run_hour": 0,
                "run_minute": 0,
                "is_active": 0
            },
            {
                "id": 16,
                "uid": "HV010595873960",
                "table_uid": "TBT1631957227230875",
                "name": "test_hv",
                "description": "",
                "is_available": 0,
                "created": "2023-01-05 14:17:58",
                "last_modified": "2023-01-05 14:17:58",
                "created_by": "",
                "last_modified_by": "",
                "reference": "",
                "run_by": "hour",
                "run_day": 1,
                "run_hour": 0,
                "run_minute": 0,
                "is_active": 0
            }
        ],
        "page_index": 0,
        "page_size": 0,
        "total_pages": 0,
        "total_records": 2
    },
    "action": "hv_list",
    "actionid": ""
}

hv_item

HV项目详情

参数 说明 是否必填
action hv_item M
organization_id 组织ID M
uid 项目UID M

请求示例

{ 
    "action": "hv_item",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "HV010479411786"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "id": 15,
        "uid": "HV010479411786",
        "table_uid": "TBT1631957227230875",
        "name": "test_hv",
        "description": "",
        "script": {
            "output": [
                {
                    "data": {
                        "k": "fix|string|全部订单总价",
                        "v": "compute|全部订单总价"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "output_strategy": "single"
                },
                {
                    "data": {
                        "uid": "table|uid",
                        "total_price": "compute|total_price"
                    },
                    "target_table": "order",
                    "output_method": "update",
                    "output_strategy": "multi"
                },
                {
                    "data": {
                        "k": "groupby|订单数量|type",
                        "v": "compute|订单数量"
                    },
                    "target_table": "res",
                    "output_method": "insert",
                    "group_variable": "订单数量",
                    "output_strategy": "group"
                }
            ],
            "compute": [
                {
                    "function": "times",
                    "direction": "H",
                    "parameters": [
                        "table|amount",
                        "table|price"
                    ],
                    "variable_name": "total_price"
                },
                {
                    "function": "sum",
                    "direction": "V",
                    "parameters": [
                        "compute|订单总价"
                    ],
                    "variable_name": "全部订单总价"
                },
                {
                    "where": [],
                    "groupby": [
                        "type"
                    ],
                    "function": "count",
                    "direction": "G",
                    "parameters": [
                        "table|uid"
                    ],
                    "variable_name": "订单数量"
                }
            ],
            "datasource": {
                "field": [
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table": "order",
                "where": [
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ]
            }
        },
        "is_available": 0,
        "created": "2023-01-05 11:30:17",
        "last_modified": "2023-01-05 11:30:17",
        "created_by": "",
        "last_modified_by": "",
        "reference": "",
        "run_by": "hour",
        "run_day": 1,
        "run_hour": 0,
        "run_minute": 0,
        "is_active": 0
    },
    "action": "hv_item",
    "actionid": ""
}

run_hv

执行HV项目

参数 说明 是否必填
action run_hv M
organization_id 组织ID M
uid 项目UID M

请求示例

{ 
    "action": "run_hv",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid": "HV1671184524560796"
}

open_hv

开启定时执行功能

参数 说明 是否必填
action open_hv M
organization_id 组织ID M
uid 项目UID M

请求示例

{
    "action":"open_hv",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid":"HV1671524702953648"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "uid": "HV1671524702953648"
    },
    "action": "open_hv",
    "actionid": ""
}

close_hv

关闭定时执行功能

参数 说明 是否必填
action close_hv M
organization_id 组织ID M
uid 项目UID M

请求示例

关闭定时执行功能

{
    "action":"close_hv",
    "organization_id":"ORGANIZATION1654940612893570", 
    "uid":"HV1671524702953648"
}

响应示例:

{
    "code": 200,
    "msg": "success",
    "result": {
        "uid": "HV1671524702953648"
    },
    "action": "close_hv",
    "actionid": ""
}

二、EVENTS

1. 表

create_table
{
    "event":"create_table",
    "block":"tableman",
    "data":{
        "alias":"order",
        "is_system":0,
        "name":"订单表",
        "description":"测试测试",
        "uid":"TBT1672797625360828",
        "is_available":1,
        "uid_prefix":"ODR",
        "listorder":10,
        "created_by":0,
        "last_modified_by":0,
        "uid_length":11,
        "last_modified":"2023-01-04 10:00:25",
        "id":76,
        "reference":null,
        "created":"2023-01-04 10:00:25"
    },
    "uniqueid":"167279762563b4ddb96a30b",
    "datetime":"2023-01-04 10:00:25"
}
update_table
{
    "event":"update_table",
    "block":"tableman",
    "data":{
        "is_system":0,
        "uid_length":12,
        "description":"测试测试",
        "created_by":0,
        "alias":"order",
        "id":76,
        "uid":"TBT1672797625360828",
        "uid_prefix":"ODRA",
        "reference":null,
        "is_available":1,
        "created":"2023-01-04 10:00:25",
        "last_modified":"2023-01-04 10:41:28",
        "last_modified_by":0,
        "name":"订单表1",
        "listorder":11
    },
    "uniqueid":"167280008863b4e7588f373",
    "datetime":"2023-01-04 10:41:28"
}
delete_table
{
    "event":"delete_table",
    "block":"tableman",
    "data":{
        "created_by":0,
        "alias":"order",
        "created":"2023-01-04 14:27:56",
        "last_modified":"2023-01-04 14:29:59",
        "is_available":1,
        "reference":null,
        "uid":"TBT167281367633963b51c6c52f1c",
        "is_system":0,
        "uid_length":12,
        "id":77,
        "name":"订单表1",
        "last_modified_by":0,
        "uid_prefix":"ODRA",
        "description":"测试测试",
        "listorder":11
    },
    "uniqueid":"167281598263b5256eac9b8",
    "datetime":"2023-01-04 15:06:22"
}

2. 字段

create_field
{
    "event":"create_field",
    "block":"tableman",
    "data":{
        "table_id":"TBT008696889600",
        "created":"2023-01-04 16:59:48",
        "last_modified":"2023-01-04 16:59:48",
        "created_by":0,
        "is_available":1,
        "name":"字段名称",
        "last_modified_by":0,
        "description":null,
        "formtype":"short",
        "is_unique":1,
        "reference":null,
        "alias":"asdasd",
        "listorder":1,
        "uid":"TBF008708299829",
        "setting":{
            "a":"1"
        },
        "is_system":0,
        "id":1194
    },
    "datetime":"2023-01-04 16:59:48",
    "uniqueid":"167282278863b54004a171d"
}
update_field
{
    "event":"update_field",
    "block":"tableman",
    "data":{
        "listorder":1,
        "created":"2023-01-04 16:59:48",
        "formtype":"short",
        "id":1194,
        "name":"字段名称",
        "description":null,
        "reference":null,
        "created_by":0,
        "setting":{
            "a":"1"
        },
        "table_id":"TBT008696889600",
        "last_modified_by":0,
        "is_available":1,
        "is_unique":1,
        "alias":"asdasd",
        "uid":"TBF008708299829",
        "last_modified":"2023-01-04 16:59:48",
        "is_system":0
    },
    "uniqueid":"167282378463b543e84762f",
    "datetime":"2023-01-04 17:16:24"
}
delete_field
{
    "event":"delete_field",
    "block":"tableman",
    "data":{
        "alias":"asdasd",
        "description":null,
        "is_unique":1,
        "created_by":0,
        "setting":{
            "a":"1"
        },
        "id":1194,
        "table_id":"TBT008696889600",
        "reference":null,
        "is_available":1,
        "uid":"TBF008708299829",
        "last_modified":"2023-01-04 16:59:48",
        "last_modified_by":0,
        "formtype":"short",
        "is_system":0,
        "name":"字段名称",
        "listorder":1,
        "created":"2023-01-04 16:59:48"
    },
    "uniqueid":"167282457063b546fae451b",
    "datetime":"2023-01-04 17:29:30"
}

3. 视图

create_template
{
    "event":"create_template",
    "block":"tableman",
    "data":{
        "listorder":1,
        "last_modified":"2023-01-04 18:09:21",
        "created_by":0,
        "type":"list",
        "setting":{
            "a":1
        },
        "description":"",
        "reference":null,
        "last_modified_by":0,
        "is_available":1,
        "condition_id":null,
        "table_id":"TBT1667880903644737",
        "alias":"",
        "id":256,
        "name":"1",
        "uid":"TBP008756546809",
        "created":"2023-01-04 18:09:21"
    },
    "uniqueid":"167282696163b55051206e8",
    "datetime":"2023-01-04 18:09:21"
}
update_template
{
    "event":"update_template",
    "block":"tableman",
    "data":{
        "alias":"",
        "created":"2023-01-04 18:09:21",
        "created_by":0,
        "is_available":1,
        "condition_id":null,
        "setting":{
            "b":2
        },
        "name":"1",
        "description":"",
        "listorder":1,
        "reference":null,
        "table_id":"TBT1667880903644737",
        "id":256,
        "uid":"TBP008756546809",
        "last_modified":"2023-01-04 18:29:09",
        "last_modified_by":0,
        "type":"list"
    },
    "uniqueid":"167282814963b554f58d3f8",
    "datetime":"2023-01-04 18:29:09"
}
delete_template
{
    "event":"delete_template",
    "block":"tableman",
    "data":{
        "condition_id":null,
        "table_id":"TBT1667880903644737",
        "reference":null,
        "created":"2023-01-04 18:09:21",
        "last_modified":"2023-01-04 18:29:09",
        "type":"list",
        "name":"1",
        "created_by":0,
        "last_modified_by":0,
        "id":256,
        "uid":"TBP008756546809",
        "setting":{
            "b":2
        },
        "alias":"",
        "description":"",
        "listorder":1,
        "is_available":1
    },
    "uniqueid":"167282843963b556175b4e4",
    "datetime":"2023-01-04 18:33:59"
}

4. 菜单

create_menu
{
    "event":"create_menu",
    "block":"tableman",
    "data":{
        "last_modified_by":0,
        "logo_type":null,
        "last_modified":"2023-01-04 18:37:34",
        "created_by":0,
        "is_available":1,
        "parent_id":0,
        "template_id":null,
        "route":null,
        "display":1,
        "setting":{
            "ces":123
        },
        "listorder":100,
        "name":"列表管理菜单",
        "uid":"TBM008776115185",
        "type":"system",
        "id":67,
        "reference":"",
        "created":"2023-01-04 18:37:34",
        "logo":null,
        "description":"description"
    },
    "uniqueid":"167282865463b556eeb273f",
    "datetime":"2023-01-04 18:37:34"
}
update_menu
{
    "event":"update_menu",
    "block":"tableman",
    "data":{
        "id":67,
        "description":"description",
        "created":"2023-01-04 18:37:34",
        "last_modified":"2023-01-04 18:43:45",
        "type":"system",
        "route":null,
        "listorder":100,
        "uid":"TBM008776115185",
        "last_modified_by":0,
        "parent_id":0,
        "display":1,
        "logo_type":null,
        "setting":{
            "ceshi":1235
        },
        "reference":"",
        "created_by":0,
        "is_available":1,
        "template_id":null,
        "name":"列表管理菜单",
        "logo":null
    },
    "uniqueid":"167282902563b5586127a9b",
    "datetime":"2023-01-04 18:43:45"
}
delete_menu
{
    "event":"delete_menu",
    "block":"tableman",
    "data":{
        "parent_id":0,
        "type":"system",
        "name":"订单管理",
        "description":"",
        "created_by":1,
        "last_modified_by":1,
        "created":"2022-11-08 12:23:59",
        "is_available":1,
        "display":1,
        "route":"/data/list/TBP1667881348238818",
        "id":56,
        "listorder":210,
        "uid":"TBM1667881439524555",
        "template_id":"TBP1667881348238818",
        "reference":null,
        "last_modified":"2022-11-08 12:23:59",
        "logo":"",
        "logo_type":""
    },
    "uniqueid":"1669022213637b4205a5fad",
    "datetime":"2022-11-21 17:16:53"
}

5. 条件

create_condition
{
    "event":"create_condition",
    "block":"tableman",
    "data":{
        "is_available":1,
        "table_id":"TBT1671085045111718",
        "listorder":100,
        "reference":"",
        "uid":"TBC008736518921",
        "created":"2023-01-04 17:40:37",
        "created_by":0,
        "setting":{
            "a":1
        },
        "id":31,
        "name":"查询条件",
        "description":"",
        "last_modified":"2023-01-04 17:40:37",
        "last_modified_by":0
    },
    "uniqueid":"167282523763b5499522a8f",
    "datetime":"2023-01-04 17:40:37"
}
update_condition
{
    "event":"update_condition",
    "block":"tableman",
    "data":{
        "listorder":100,
        "reference":"",
        "created_by":0,
        "last_modified_by":0,
        "id":31,
        "name":"查询条件",
        "description":"",
        "uid":"TBC008736518921",
        "created":"2023-01-04 17:40:37",
        "last_modified":"2023-01-04 17:45:55",
        "is_available":1,
        "setting":{
            "b":2
        },
        "table_id":"TBT1671085045111718"
    },
    "uniqueid":"167282555563b54ad379f60",
    "datetime":"2023-01-04 17:45:55"
}
delete_condition
{
    "event":"delete_condition",
    "block":"tableman",
    "uniqueid":"16699672176389ad71642bb",
    "datetime":"2022-12-02 15:46:57",
    "data":{
        "id":1,
        "description":"测试测试测试测试测试测试测试测试测试测试测试测试测试",
        "reference":null,
        "name":"测试表",
        "created":"2022-11-08 12:15:03",
        "last_modified":"2022-11-08 12:15:03",
        "uid_length":11,
        "listorder":1,
        "is_available":1,
        "alias":"test_table",
        "is_system":0,
        "uid":"TBT1667880903644737",
        "created_by":1,
        "last_modified_by":1,
        "uid_prefix":"TST"
    }
}

6. 数据

insert_data
{
    "event":"insert_data",
    "block":"tableman",
    "table":"order",
    "data":[
        [

        ],
        {
            "last_modified_by":0,
            "is_available":0,
            "uid":"ODRA008790581880",
            "created_by":0,
            "created":"2023-01-04 18:58:20",
            "last_modified":"2023-01-04 18:58:20",
            "name":"zhang",
            "age":"18",
            "id":1,
            "reference":null
        }
    ],
    "uniqueid":"167282990063b55bcc2945b",
    "datetime":"2023-01-04 18:58:20"
}
batch_insert_data
{
    "event":"batch_insert_data",
    "block":"tableman",
    "table":"order",
    "data":[
        [

        ],
        [
            {
                "reference":null,
                "last_modified":"2023-01-04 19:07:00",
                "created_by":0,
                "is_available":0,
                "age":"19",
                "uid":"ODRA008796531797",
                "created":"2023-01-04 19:07:00",
                "last_modified_by":0,
                "name":"wang",
                "id":2
            },
            {
                "name":"liu",
                "age":"30",
                "last_modified":"2023-01-04 19:07:00",
                "uid":"ODRA008796531815",
                "reference":null,
                "created":"2023-01-04 19:07:00",
                "created_by":0,
                "last_modified_by":0,
                "is_available":0,
                "id":3
            }
        ]
    ],
    "uniqueid":"167283042063b55dd4d25e5",
    "datetime":"2023-01-04 19:07:00"
}
update_data
{
    "datetime":"2023-01-04 19:09:23",
    "table":"order",
    "event":"update_data",
    "block":"tableman",
    "data":[
        {
            "id":1,
            "uid":"ODRA008790581880",
            "created":"2023-01-04 18:58:20",
            "age":"18",
            "name":"zhang",
            "reference":null,
            "last_modified":"2023-01-04 18:58:20",
            "created_by":0,
            "last_modified_by":0,
            "is_available":0
        },
        {
            "id":1,
            "reference":null,
            "created":"2023-01-04 18:58:20",
            "last_modified_by":0,
            "age":"28",
            "uid":"ODRA008790581880",
            "last_modified":"2023-01-04 19:09:23",
            "created_by":0,
            "is_available":0,
            "name":"zhang"
        }
    ],
    "uniqueid":"167283056363b55e632134e"
}
batch_update_data
{
    "event":"batch_update_data",
    "block":"tableman",
    "data":[
        [
            {
                "uid":"ODRA008790581880",
                "created_by":0,
                "id":1,
                "created":"2023-01-04 18:58:20",
                "last_modified":"2023-01-04 19:20:26",
                "last_modified_by":0,
                "is_available":0,
                "name":"zhang",
                "age":"108",
                "reference":null
            },
            {
                "last_modified_by":0,
                "age":"19",
                "uid":"ODRA008796531797",
                "last_modified":"2023-01-04 19:07:00",
                "created_by":0,
                "is_available":0,
                "name":"wang",
                "id":2,
                "reference":null,
                "created":"2023-01-04 19:07:00"
            },
            {
                "reference":null,
                "created":"2023-01-04 19:07:00",
                "last_modified":"2023-01-04 19:07:00",
                "last_modified_by":0,
                "is_available":0,
                "age":"30",
                "uid":"ODRA008796531815",
                "created_by":0,
                "name":"liu",
                "id":3
            }
        ],
        [
            {
                "created":"2023-01-04 18:58:20",
                "last_modified":"2023-01-04 19:25:09",
                "is_available":0,
                "id":1,
                "uid":"ODRA008790581880",
                "last_modified_by":0,
                "name":"zhang",
                "age":"101",
                "reference":null,
                "created_by":0
            },
            {
                "created":"2023-01-04 19:07:00",
                "last_modified":"2023-01-04 19:25:09",
                "last_modified_by":0,
                "name":"wang",
                "uid":"ODRA008796531797",
                "reference":null,
                "created_by":0,
                "is_available":0,
                "age":"102",
                "id":2
            },
            {
                "id":3,
                "created":"2023-01-04 19:07:00",
                "last_modified":"2023-01-04 19:25:09",
                "name":"liu",
                "age":"103",
                "uid":"ODRA008796531815",
                "reference":null,
                "created_by":0,
                "last_modified_by":0,
                "is_available":0
            }
        ]
    ],
    "uniqueid":"167283150963b562153408d",
    "datetime":"2023-01-04 19:25:09",
    "table":"order"
}
delete_data
{
    "event":"delete_data",
    "block":"tableman",
    "table":"order",
    "data":[
        {
            "last_modified":"2023-01-04 19:25:09",
            "created_by":0,
            "is_available":0,
            "name":"zhang",
            "age":"101",
            "id":1,
            "created":"2023-01-04 18:58:20",
            "last_modified_by":0,
            "uid":"ODRA008790581880",
            "reference":null
        },
        [

        ]
    ],
    "uniqueid":"167283175463b5630ad9245",
    "datetime":"2023-01-04 19:29:14"
}
batch_delete_data
{
    "event":"batch_delete_data",
    "block":"tableman",
    "table":"order",
    "data":[
        [
            {
                "reference":null,
                "created":"2023-01-04 19:39:36",
                "created_by":0,
                "last_modified_by":0,
                "is_available":0,
                "age":"108",
                "id":9,
                "uid":"ODRA008819259029",
                "last_modified":"2023-01-04 19:46:01",
                "name":"wang"
            },
            {
                "created":"2023-01-04 19:39:36",
                "created_by":0,
                "name":"liu",
                "age":"108",
                "uid":"ODRA008819259046",
                "reference":null,
                "last_modified":"2023-01-04 19:46:01",
                "last_modified_by":0,
                "is_available":0,
                "id":10
            }
        ],
        [

        ]
    ],
    "uniqueid":"167283278763b56713d3e8f",
    "datetime":"2023-01-04 19:46:27"
}

7. 监听器

create_listener
{
    "event":"create_listener",
    "block":"tableman",
    "data":{
        "id":31,
        "uid":"LST010411274615",
        "created":"2023-01-05 09:52:09",
        "last_modified":"2023-01-05 09:52:09",
        "last_modified_by":"",
        "reference":"",
        "name":"订单同步1",
        "description":"新增时新增",
        "table_name":"order",
        "method":"insert",
        "script":{
            "trigger":{
                "table":"order",
                "method":"insert"
            },
            "response":{
                "data":{
                    "uid":"record|new|uid",
                    "name":"record|new|name",
                    "price":"record|new|price",
                    "amount":"record|new|amount",
                    "total_price":"record|new|total_price"
                },
                "table":"order_back",
                "method":"insert"
            }
        },
        "is_available":0,
        "created_by":""
    },
    "uniqueid":"167288352963b62d493007f",
    "datetime":"2023-01-05 09:52:09"
}
update_listener
{
    "event":"update_listener",
    "block":"tableman",
    "data":{
        "table_name":"order",
        "method":"insert",
        "script":{
            "trigger":{
                "table":"order",
                "method":"insert"
            },
            "response":{
                "method":"insert",
                "data":{
                    "name":"record|new|name",
                    "price":"record|new|price",
                    "amount":"record|new|amount",
                    "total_price":"record|new|total_price",
                    "uid":"record|new|uid"
                },
                "table":"order_back"
            }
        },
        "last_modified":"2023-01-05 09:54:05",
        "created_by":"",
        "last_modified_by":"",
        "reference":"",
        "id":31,
        "uid":"LST010411274615",
        "name":"订单同步",
        "description":"新增时新增",
        "is_available":0,
        "created":"2023-01-05 09:52:09"
    },
    "uniqueid":"167288364563b62dbd5b314",
    "datetime":"2023-01-05 09:54:05"
}
delete_listener
{
    "event":"delete_listener",
    "block":"tableman",
    "data":{
        "uid":"LST010411274615",
        "name":"订单同步",
        "description":"新增时新增",
        "table_name":"order",
        "method":"insert",
        "is_available":0,
        "created_by":"",
        "id":31,
        "script":{
            "trigger":{
                "table":"order",
                "method":"insert"
            },
            "response":{
                "data":{
                    "uid":"record|new|uid",
                    "name":"record|new|name",
                    "price":"record|new|price",
                    "amount":"record|new|amount",
                    "total_price":"record|new|total_price"
                },
                "table":"order_back",
                "method":"insert"
            }
        },
        "created":"2023-01-05 09:52:09",
        "last_modified":"2023-01-05 09:54:05",
        "last_modified_by":"",
        "reference":""
    },
    "uniqueid":"167288400863b62f281944d",
    "datetime":"2023-01-05 10:00:08"
}
open_listener
{
    "event":"open_listener",
    "block":"tableman",
    "data":{
        "uid":"LST1671508898704377"
    },
    "uniqueid":"167288711063b63b46b89bb",
    "datetime":"2023-01-05 10:51:50"
}
close_listener
{
    "event":"close_listener",
    "block":"tableman",
    "data":{
        "uid":"LST1671508898704377"
    },
    "uniqueid":"167288748163b63cb99e78b",
    "datetime":"2023-01-05 10:58:01"
}

8. HV项目

create_hv
{
    "event":"create_hv",
    "block":"tableman",
    "data":{
        "uid":"HV010595873960",
        "created_by":"",
        "run_by":"hour",
        "run_minute":0,
        "id":16,
        "last_modified_by":"",
        "table_uid":"TBT1631957227230875",
        "is_available":0,
        "last_modified":"2023-01-05 14:17:58",
        "reference":"",
        "run_hour":0,
        "is_active":0,
        "description":"",
        "script":{
            "output":[
                {
                    "data":{
                        "k":"fix|string|全部订单总价",
                        "v":"compute|全部订单总价"
                    },
                    "target_table":"res",
                    "output_method":"insert",
                    "output_strategy":"single"
                },
                {
                    "data":{
                        "uid":"table|uid",
                        "total_price":"compute|total_price"
                    },
                    "target_table":"order",
                    "output_method":"update",
                    "output_strategy":"multi"
                },
                {
                    "data":{
                        "k":"groupby|订单数量|type",
                        "v":"compute|订单数量"
                    },
                    "target_table":"res",
                    "output_method":"insert",
                    "group_variable":"订单数量",
                    "output_strategy":"group"
                }
            ],
            "compute":[
                {
                    "variable_name":"total_price",
                    "function":"times",
                    "direction":"H",
                    "parameters":[
                        "table|amount",
                        "table|price"
                    ]
                },
                {
                    "function":"sum",
                    "direction":"V",
                    "parameters":[
                        "compute|订单总价"
                    ],
                    "variable_name":" 全部订单总价"
                },
                {
                    "variable_name":"订单数量",
                    "where":[

                    ],
                    "groupby":[
                        "type"
                    ],
                    "function":"count",
                    "direction":"G",
                    "parameters":[
                        "table|uid"
                    ]
                }
            ],
            "datasource":{
                "where":[
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ],
                "field":[
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table":"order"
            }
        },
        "created":"2023-01-05 14:17:58",
        "run_day":1,
        "name":"test_hv"
    },
    "datetime":"2023-01-05 14:17:58",
    "uniqueid":"167289947863b66b96a70b5"
}
update_hv
{
    "event":"update_hv",
    "block":"tableman",
    "data":{
        "script":{
            "output":[
                {
                    "data":{
                        "k":"fix|string|全部订单总价",
                        "v":"compute|全部订单总价"
                    },
                    "target_table":"res",
                    "output_method":"insert",
                    "output_strategy":"single"
                },
                {
                    "target_table":"order",
                    "output_method":"update",
                    "output_strategy":"multi",
                    "data":{
                        "uid":"table|uid",
                        "total_price":"compute|total_price"
                    }
                },
                {
                    "data":{
                        "k":"groupby|订单数量|type",
                        "v":"compute|订单数量"
                    },
                    "target_table":"res",
                    "output_method":"insert",
                    "group_variable":"订单数量",
                    "output_strategy":"group"
                }
            ],
            "compute":[
                {
                    "function":"times",
                    "direction":"H",
                    "parameters":[
                        "table|amount",
                        "table|price"
                    ],
                    "variable_name":"total_price"
                },
                {
                    "variable_name":"全部订单总价",
                    "function":"sum",
                    "direction":"V",
                    "parameters":[
                        "compute|订单总价"
                    ]
                },
                {
                    "where":[

                    ],
                    "groupby":[
                        "type"
                    ],
                    "function":"count",
                    "direction":"G",
                    "parameters":[
                        "table|uid"
                    ],
                    "variable_name":"订单数量"
                }
            ],
            "datasource":{
                "field":[
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table":"order",
                "where":[
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ]
            }
        },
        "is_available":0,
        "run_minute":0,
        "id":12,
        "name":"test_hv",
        "reference":"",
        "uid":"HV1671524702953648",
        "created":"2022-12-20 16:25:02",
        "last_modified":"2023-01-05 14:28:35",
        "created_by":"",
        "run_hour":0,
        "is_active":0,
        "table_uid":"TBT1631957227230875",
        "description":"",
        "last_modified_by":"",
        "run_by":"hour",
        "run_day":1
    },
    "uniqueid":"167290011563b66e13585a7",
    "datetime":"2023-01-05 14:28:35"
}
delete_hv
{
    "event":"delete_hv",
    "block":"tableman",
    "data":{
        "is_available":0,
        "last_modified":"2023-01-05 14:28:35",
        "last_modified_by":"",
        "description":"",
        "name":"test_hv",
        "created":"2022-12-20 16:25:02",
        "created_by":"",
        "uid":"HV1671524702953648",
        "table_uid":"TBT1631957227230875",
        "script":{
            "output":[
                {
                    "data":{
                        "k":"fix|string|全部订单总价",
                        "v":"compute|全部订单总价"
                    },
                    "target_table":"res",
                    "output_method":"insert",
                    "output_strategy":"single"
                },
                {
                    "data":{
                        "uid":"table|uid",
                        "total_price":"compute|total_price"
                    },
                    "target_table":"order",
                    "output_method":"update",
                    "output_strategy":"multi"
                },
                {
                    "data":{
                        "k":"groupby|订单数量|type",
                        "v":"compute|订单数量"
                    },
                    "target_table":"res",
                    "output_method":"insert",
                    "group_variable":"订单数量",
                    "output_strategy":"group"
                }
            ],
            "compute":[
                {
                    "function":"times",
                    "direction":"H",
                    "parameters":[
                        "table|amount",
                        "table|price"
                    ],
                    "variable_name":"total_price"
                },
                {
                    "function":"sum",
                    "direction":"V",
                    "parameters":[
                        "compute|订单总价"
                    ],
                    "variable_name":"全部订单总价"
                },
                {
                    "where":[

                    ],
                    "groupby":[
                        "type"
                    ],
                    "function":"count",
                    "direction":"G",
                    "parameters":[
                        "table|uid"
                    ],
                    "variable_name":"订单数量"
                }
            ],
            "datasource":{
                "field":[
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table":"order",
                "where":[
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ]
            }
        },
        "run_minute":0,
        "id":12,
        "run_by":"hour",
        "run_day":1,
        "run_hour":0,
        "is_active":0,
        "reference":""
    },
    "uniqueid":"167290041063b66f3a387f9",
    "datetime":"2023-01-05 14:33:30"
}
open_hv
{
    "event":"open_hv",
    "block":"tableman",
    "data":{
        "uid":"HV1671524702953648"
    },
    "uniqueid":"167290092863b671400d473",
    "datetime":"2023-01-05 14:42:08"
}
close_hv
{
    "event":"close_hv",
    "block":"tableman",
    "data":{
        "uid":"HV1671524702953648"
    },
    "datetime":"2023-01-05 14:43:05",
    "uniqueid":"167290098563b671796eb3f"
}
run_hv
{
    "event":"run_hv",
    "block":"tableman",
    "data":{
        "run_hour":0,
        "id":15,
        "description":"",
        "is_available":0,
        "created":"2023-01-05 11:30:17",
        "run_day":1,
        "run_by":"hour",
        "run_minute":0,
        "script":{
            "compute":[
                {
                    "function":"times",
                    "direction":"H",
                    "parameters":[
                        "table|amount",
                        "table|price"
                    ],
                    "variable_name":"total_price"
                },
                {
                    "parameters":[
                        "compute|total_price"
                    ],
                    "variable_name":"全部订单总价",
                    "function":"sum",
                    "direction":"V"
                },
                {
                    "parameters":[
                        "table|uid"
                    ],
                    "variable_name":"订单数量",
                    "where":[

                    ],
                    "groupby":[
                        "type"
                    ],
                    "function":"count",
                    "direction":"G"
                }
            ],
            "datasource":{
                "field":[
                    "uid",
                    "name",
                    "amount",
                    "type",
                    "price"
                ],
                "table":"order",
                "where":[
                    [
                        "price",
                        ">",
                        "fix|int|0"
                    ]
                ]
            },
            "output":[
                {
                    "output_strategy":"single",
                    "data":{
                        "k":"fix|string|全部订单总价",
                        "v":"compute|全部订单总价"
                    },
                    "target_table":"res",
                    "output_method":"insert"
                },
                {
                    "data":{
                        "uid":"table|uid",
                        "total_price":"compute|total_price"
                    },
                    "target_table":"order",
                    "output_method":"update",
                    "output_strategy":"multi"
                },
                {
                    "target_table":"res",
                    "output_method":"insert",
                    "group_variable":"订单数量",
                    "output_strategy":"group",
                    "data":{
                        "k":"groupby|订单数量|type",
                        "v":"compute|订单数量"
                    }
                }
            ]
        },
        "last_modified":"2023-01-05 11:30:17",
        "reference":"",
        "is_active":0,
        "uid":"HV010479411786",
        "table_uid":"TBT1631957227230875",
        "name":"test_hv",
        "created_by":"",
        "last_modified_by":""
    },
    "uniqueid":"167290603063b6852e8f2c5",
    "datetime":"2023-01-05 16:07:10"
}
文档更新时间: 2024-12-26 17:28   作者:技术支持