1. hapio接口说明

1.1. 文档说明

本文档为hapio组件API接口说明

1.2. 修订记录

日期 文档版本 修订内容 修改人
2020-10-13 v0.1 添加对象、终端、配置等接口 lizefang
2020-10-21 v0.2 修改对象、终端、配置接口,新增控制、映射接口 lizefang
2020-10-30 v0.3 新增文件接口 lizefang
2020-11-11 v0.4 新增对象组、对象组映射接口 lizefang
2020-12-01 v0.5 新增显示板,对象映射显示板,对象统计接口(5.1.4) cdp
2020-12-12 v0.6 修复接口对象中,查询显示板接口错误的获取对象数据的问题,实际上为获取显示板数据(5.1.7) cdp
2020-12-22 v0.7 修复json字段展示结果为字符串问题,现在为json;object左联接normal,object添加状态查询,输出(5.1.12) cdp

1.3. 接口约定

规则 描述
服务器域名(IP) 以部署为准,如: https://xxx.mixiot.top
接口鉴权 令牌机制,详情请阅接口鉴权
字符编码 统一采用UTF-8编码
响应格式 统一采用JSON格式

1.4. 响应说明

1.4.1. 返回码

code 含义 备注
200 请求成功 Code不为200,则说明请求失败
500 请求错误

1.4.2. 格式

1.单条记录

{
    "code":200,
    "msg":"success",
    "info":"",
    "result":{}
}

2.多条记录

{
    "code":200,
    "msg":"success",
    "info":"",
    "result":{
        "page_index":1,
        "page_size":20,
        "total_pages":0,
        "total_records":0,
        "data":[]
    }
}

2. 对象接口

2.1. 添加对象

请求地址:

属性
URL /api/v1/object/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
name string varchar(64) --- 名称
description string varchar(255) --- 描述
image string varchar(128) --- 图片路径
province string varchar(16) --- 省份
city string varchar(16) --- 城市
file_id int int(11) --- 资源表编号
mapping_id int int(11) --- 映射表编号
control_id int int(11) --- 控制表编号
terminal_list string text --- 终端列表,逗号分隔
model string varchar(32) --- 型号
serial_no string varchar(32) --- 序列号
gis string varchar(128) --- 位置信息
secret string varchar(16) --- 关注密码
control string varchar(16) --- 控制代码
addition string text --- 附加信息
template string text --- 模板:显示板列表
script string text --- 脚本(暂未使用)
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "name": "object1",
    "description": "temperature object",
    "image": "/var/image/default.png",
    "province": "广东省",
    "city": "深圳市",
    "file_id": 1,
    "mapping_id": 1,
    "control_id": 1,
    "terminal_list": "[\"test\",\"test1\"]",
    "model": "model1",
    "serial_no": "1234566778999999",
    "gis": "深圳南山区",
    "secret": "1234567887654321",
    "control": "1234567887654321",
    "addition": "{\"id\":1}",
    "template": "{\"id\":1}",
    "script": "{\"id\":1}",
    "reference": "123456",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/object/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

2.2. 编辑对象

请求地址:

属性
URL /api/v1/object/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
name string varchar(64) --- 终端名
description string varchar(255) --- 描述
image string varchar(128) --- 图片路径
province string varchar(16) --- 省份
city string varchar(16) --- 城市
file_id int int(11) --- 资源表编号
mapping_id int int(11) --- 映射表编号
control_id int int(11) --- 控制表编号
terminal_list string text --- 终端列表,逗号分隔
model string varchar(32) --- 型号
serial_no string varchar(32) --- 序列号
gis string varchar(128) --- 位置信息
secret string varchar(16) --- 关注密码
control string varchar(16) --- 控制代码
addition string text --- 附加信息
template string text --- 模板:显示板列表
script string text --- 脚本(暂未使用)
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1001,
    "name": "object2",
    "description": "temperature object",
    "image": "/var/image/default2.png",
    "province": "湖南省",
    "city": "长沙市",
    "file_id": 2,
    "mapping_id": 2,
    "control_id": 2,
    "terminal_list": "[\"test\",\"test2\"]",
    "model": "model2",
    "serial_no": "1234566778999988",
    "gis": "湖南省长沙市岳麓区",
    "secret": "1234567887654323",
    "control": "1234567887654323",
    "addition": "{\"id\":2}",
    "template": "{\"id\":2}",
    "script": "{\"id\":2}",
    "reference": "123457",
    "created_by": 2,
    "last_modified_by": 2,
    "is_available": 0
}' "https://xxx.mixiot.top/hapio/api/v1/object/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

2.3. 删除对象

请求地址:

属性
URL /api/v1/object/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1011
}' "https://xxx.mixiot.top/hapio/api/v1/object/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

2.4. 获取对象

请求地址:

属性
URL /api/v1/object/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/object/getItem?id=1001"

返回示例:

{
  "code": 200,
  "msg": "成功",
  "info": "",
  "result": {
    "id": 1001,
    "name": "test_cdp",
    "description": "",
    "image": "http://192.168.88.216/mixiot_admin/storage/object/2020/11/13/20201113165952.jpg",
    "province": "广东省",
    "city": "广州市",
    "file_id": 1,
    "mapping_id": 1001,
    "control_id": 1001,
    "terminal_list": "demo,test_terminal",
    "model": "",
    "serial_no": "",
    "gis": "34.64241,108.92663",
    "secret": "",
    "control": "",
    "addition": [
      {
        "data": [
          [
            "燃料类型",
            "天然气"
          ],
          [
            "锅炉重量",
            "2吨"
          ],
          [
            "出厂日期",
            "2018-03-03"
          ]
        ],
        "title": "锅炉信息"
      },
      {
        "data": [
          [
            "热效率",
            0.8
          ],
          [
            "燃料热值",
            7000
          ],
          [
            "*吨汽燃料指标*",
            0.21
          ]
        ],
        "title": "能效指标信息"
      }
    ],
    "template": {},
    "script": {},
    "reference": "",
    "created": "2020-11-03 16:52:05",
    "created_by": 1001,
    "last_modified": "2020-12-10 18:03:47",
    "last_modified_by": 1001,
    "is_available": 1,
    "is_online": 0,
    "is_boot": 0,
    "is_retainer": 0
  }
}

2.5. 获取对象列表

请求地址:

属性
URL /api/v1/object/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" - GET "https://xxx.mixiot.top/hapio/api/v1/object/getList?where_and=[["name","LIKE","%25object1"],["is_online","=","1"]]&where_or=[["object_id","=","1"],["object_id",">","1"]]&where_in=["object_id","1002,1003"]&order_by=["object_id","desc"]&page_index=1&page_size=10

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 1,
        "page_size": 2,
        "total_pages": 7,
        "total_records": 13,
        "data": [
            {
                "id": 1001,
                "name": "test_cdp",
                "description": "",
                "image": "http://192.168.88.216/mixiot_admin/storage/object/2020/11/13/20201113165952.jpg",
                "province": "广东省",
                "city": "广州市",
                "file_id": 1,
                "mapping_id": 1001,
                "control_id": 1001,
                "terminal_list": "demo,test_terminal",
                "model": "",
                "serial_no": "",
                "gis": "34.64241,108.92663",
                "secret": "",
                "control": "",
                "addition": [
                    {
                        "data": [
                            [
                                "燃料类型",
                                "天然气"
                            ],
                            [
                                "锅炉重量",
                                "2吨"
                            ],
                            [
                                "出厂日期",
                                "2018-03-03"
                            ]
                        ],
                        "title": "锅炉信息"
                    },
                    {
                        "data": [
                            [
                                "热效率",
                                0.8
                            ],
                            [
                                "燃料热值",
                                7000
                            ],
                            [
                                "*吨汽燃料指标*",
                                0.21
                            ]
                        ],
                        "title": "能效指标信息"
                    }
                ],
                "template": {},
                "script": {},
                "reference": "",
                "created": "2020-11-03 16:52:05",
                "created_by": 1001,
                "last_modified": "2020-12-10 18:03:47",
                "last_modified_by": 1001,
                "is_available": 1,
                "is_online": 0,
                "is_boot": 0,
                "is_retainer": 0
            },
            {
                "id": 1003,
                "name": "demo",
                "description": "",
                "image": "",
                "province": "",
                "city": "",
                "file_id": 1,
                "mapping_id": 1002,
                "control_id": 1002,
                "terminal_list": "AX2020062300546",
                "model": "",
                "serial_no": "",
                "gis": "",
                "secret": "",
                "control": "",
                "addition": [
                    {
                        "data": [
                            [
                                "燃料类型",
                                "天然气"
                            ],
                            [
                                "锅炉重量",
                                "2吨"
                            ],
                            [
                                "出厂日期",
                                "2018-03-03"
                            ]
                        ],
                        "title": "锅炉信息"
                    },
                    {
                        "data": [
                            [
                                "热效率",
                                0.8
                            ],
                            [
                                "燃料热值",
                                7000
                            ],
                            [
                                "*吨汽燃料指标*",
                                0.21
                            ]
                        ],
                        "title": "能效指标信息"
                    }
                ],
                "template": {},
                "script": {},
                "reference": "",
                "created": "2020-11-05 18:57:25",
                "created_by": 1001,
                "last_modified": "2020-11-14 12:41:14",
                "last_modified_by": 1001,
                "is_available": 1,
                "is_online": 0,
                "is_boot": 0,
                "is_retainer": 0
            }
        ]
    }
}

2.6. 添加关联显示板

请求地址:

属性
URL /api/v1/object/addDashboard
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
dashboard_id int int(11) 1001 显示板编号
object_id int int(11) 1001 对象编号
category string string "pro" 分类

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "dashboard_id": 1,
    "object_id": 1,
    "category":"pro"
}' "https://xxx.mixiot.top/hapio/api/v1/object/addDashboard"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

2.7. 删除关联显示板

请求地址:

属性
URL /api/v1/object/deleteDashboard
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
dashboard_id int int(11) 1001 显示板编号
object_id int int(11) 1001 对象编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "dashboard_id": 1,
    "object_id": 1
}' "https://xxx.mixiot.top/hapio/api/v1/object/deleteDashboard"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

2.8. 查询指定类型显示板记录

请求地址:

属性
URL /api/v1/object/getDashboardByCategory
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
object_id int int(11) --- 对象编号
category string string "pro" 分类

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/object/getDashboardByCategory?object_id=1004&category=pro"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "id": 1002,
        "name": "test25",
        "description": "foo",
        "script": {
            "Dashboard-0": {
                "col": 20,
                "data": [
                    {
                        "attribute": "crd_0",
                        "backgroundColor": "#D69999",
                        "fontColor": "#fff",
                        "itemData": [
                            {
                                "id": "S04",
                                "name": "测试A类型",
                                "value": 0
                            }
                        ],
                        "name": "标题2",
                        "size1": "20px",
                        "size2": "32px",
                        "size3": "20px",
                        "theme": "dashboard",
                        "type": "crd",
                        "xys": {
                            "len": [
                                4,
                                4
                            ],
                            "pos": [
                                0,
                                0
                            ]
                        }
                    },
                    {
                        "attribute": "vlu_1",
                        "itemData": [
                            {
                                "backgroundColor": "#72C6A3",
                                "id": "S05",
                                "name": "测试B类型"
                            }
                        ],
                        "name": "标题3",
                        "nameSize": "20px",
                        "theme": "dashboard",
                        "timeSize": "16px",
                        "type": "vlu",
                        "valueSize": "40px",
                        "xys": {
                            "len": [
                                4,
                                4
                            ],
                            "pos": [
                                0,
                                4
                            ]
                        }
                    },
                    {
                        "attribute": "lin_1",
                        "from": [
                            "S07"
                        ],
                        "legendData": [
                            "测试"
                        ],
                        "lineColor": [
                            "#D01515"
                        ],
                        "markLineData": [
                            "null"
                        ],
                        "name": "测试曲线",
                        "series": [
                            {
                                "data": [],
                                "from": "S07",
                                "itemStyle": {
                                    "color": "#D01515"
                                },
                                "lineStyle": {
                                    "color": "#D01515"
                                },
                                "markLine": [],
                                "name": "测试",
                                "type": "line"
                            }
                        ],
                        "theme": "dashboard",
                        "type": "lin",
                        "xAxis": [],
                        "xys": {
                            "len": [
                                4,
                                7
                            ],
                            "pos": [
                                0,
                                8
                            ]
                        }
                    },
                    {
                        "attribute": "gag_1",
                        "data": {
                            "color": [
                                [
                                    "100",
                                    "#67c23a"
                                ],
                                [
                                    "180",
                                    "#C2BB3A"
                                ],
                                [
                                    "200",
                                    "#C2513A"
                                ]
                            ],
                            "max": 200,
                            "min": 0,
                            "name": "测试",
                            "steps": 5,
                            "value": 0
                        },
                        "from": "S08",
                        "name": "测试仪表",
                        "theme": "dashboard",
                        "type": "gag",
                        "xys": {
                            "len": [
                                4,
                                5
                            ],
                            "pos": [
                                0,
                                15
                            ]
                        }
                    },
                    {
                        "attribute": "pie_4",
                        "from": [
                            "S11",
                            "S12",
                            "S13",
                            "S14"
                        ],
                        "legendData": [
                            "音乐",
                            "游戏",
                            "视频",
                            "浏览网页"
                        ],
                        "name": "手机用时",
                        "series": [
                            {
                                "data": [
                                    {
                                        "from": "S11",
                                        "name": "音乐",
                                        "value": 0
                                    },
                                    {
                                        "from": "S12",
                                        "name": "游戏",
                                        "value": 0
                                    },
                                    {
                                        "from": "S13",
                                        "name": "视频",
                                        "value": 0
                                    },
                                    {
                                        "from": "S14",
                                        "name": "浏览网页",
                                        "value": 0
                                    }
                                ]
                            }
                        ],
                        "theme": "dashboard",
                        "type": "pie",
                        "xys": {
                            "len": [
                                5,
                                6
                            ],
                            "pos": [
                                4,
                                0
                            ]
                        }
                    },
                    {
                        "attribute": "rad_5",
                        "from": [
                            "S15",
                            "S16",
                            "S17"
                        ],
                        "indicator": [
                            {
                                "from": "S15",
                                "max": 800,
                                "name": "华为"
                            },
                            {
                                "from": "S14",
                                "max": 400,
                                "name": "小米"
                            },
                            {
                                "from": "S11",
                                "max": 100,
                                "name": "魅族"
                            }
                        ],
                        "legendData": [
                            "雷达图"
                        ],
                        "name": "雷达图",
                        "seriesData": [
                            {
                                "name": "雷达图",
                                "value": []
                            }
                        ],
                        "theme": "dashboard",
                        "type": "rad",
                        "xys": {
                            "len": [
                                5,
                                7
                            ],
                            "pos": [
                                4,
                                6
                            ]
                        }
                    },
                    {
                        "attribute": "bar_6",
                        "from": [
                            "S20",
                            "S28"
                        ],
                        "legendData": [
                            "发电量",
                            "用电量"
                        ],
                        "name": "柱状图测试",
                        "series": [
                            {
                                "color": "#CB0E0E",
                                "from": "S20",
                                "name": "发电量"
                            },
                            {
                                "color": "#137345",
                                "from": "S28",
                                "name": "用电量"
                            }
                        ],
                        "theme": "dashboard",
                        "type": "bar",
                        "xAxis": [],
                        "xys": {
                            "len": [
                                5,
                                7
                            ],
                            "pos": [
                                4,
                                13
                            ]
                        }
                    }
                ],
                "dataType": "images",
                "name": "新增页面",
                "row": 9,
                "screenHeight": 0,
                "screenWidth": 0,
                "tag": "page_1",
                "webSocket": {
                    "objectId": 1004,
                    "projectId": 4,
                    "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                }
            },
            "Dashboard-1": {
                "col": 20,
                "data": [
                    {
                        "attribute": "dzc_7",
                        "from": [
                            "S20"
                        ],
                        "legendData": [
                            "数据"
                        ],
                        "name": "大数据缩放图",
                        "series": [
                            {
                                "downColor": "#C21C11",
                                "from": "S20",
                                "name": "数据",
                                "type": "line",
                                "upColor": "#EBEA90"
                            }
                        ],
                        "theme": "dashboard",
                        "type": "dzc",
                        "xAxis": [],
                        "xys": {
                            "len": [
                                5,
                                8
                            ],
                            "pos": [
                                0,
                                0
                            ]
                        }
                    },
                    {
                        "attribute": "aqi_7",
                        "from": [
                            "S07"
                        ],
                        "legendData": [
                            "指数"
                        ],
                        "name": "指数测试",
                        "pieceArr": [
                            {
                                "yAxis": "80"
                            },
                            {
                                "yAxis": "100"
                            },
                            {
                                "yAxis": "120"
                            }
                        ],
                        "pieces": [
                            {
                                "color": "#A7AE1A",
                                "gt": 0,
                                "lte": 80
                            },
                            {
                                "color": "#0095FF",
                                "gt": 80,
                                "lte": 100
                            },
                            {
                                "color": "#B70808",
                                "gt": 100
                            }
                        ],
                        "series": [
                            {
                                "data": [],
                                "from": "S07",
                                "name": "指数",
                                "type": "line"
                            }
                        ],
                        "theme": "dashboard",
                        "type": "aqi",
                        "xAxis": [],
                        "xys": {
                            "len": [
                                5,
                                7
                            ],
                            "pos": [
                                0,
                                8
                            ]
                        }
                    },
                    {
                        "attribute": "mxa_8",
                        "from": [
                            "S08",
                            "S09"
                        ],
                        "legendData": [
                            "音乐",
                            "电影"
                        ],
                        "name": "双X轴曲线",
                        "series": [
                            {
                                "color": "#EA2222",
                                "from": "S08",
                                "name": "音乐",
                                "type": "line"
                            },
                            {
                                "color": "#0F8562",
                                "from": "S09",
                                "name": "电影",
                                "type": "line"
                            }
                        ],
                        "theme": "dashboard",
                        "type": "mxa",
                        "xAxis": [],
                        "xys": {
                            "len": [
                                5,
                                8
                            ],
                            "pos": [
                                5,
                                0
                            ]
                        }
                    },
                    {
                        "attribute": "scd_9",
                        "background": "20200917173720.png",
                        "height": 200,
                        "itemData": [
                            {
                                "id": "S05",
                                "name": "组态图一",
                                "position": {
                                    "left": "0%",
                                    "position": "absolute",
                                    "top": "0.5%"
                                },
                                "type": "Plate",
                                "value": 0
                            },
                            {
                                "ULG_max": 200,
                                "ULG_min": 0,
                                "ULG_width": "14px",
                                "id": "S08",
                                "name": "组态图二",
                                "position": {
                                    "left": "69.89247311827957%",
                                    "position": "absolute",
                                    "top": "1%"
                                },
                                "showScale": true,
                                "start_value": 0,
                                "step": 5,
                                "type": "ULG",
                                "value": 0
                            },
                            {
                                "id": "H01",
                                "name": "组态图三",
                                "off": "1",
                                "on": "0",
                                "position": {
                                    "left": "31.899641577060933%",
                                    "position": "absolute",
                                    "top": "1.5%"
                                },
                                "type": "Signal",
                                "value": "1"
                            },
                            {
                                "flag": [
                                    {
                                        "code": "1",
                                        "color": "#dd0033",
                                        "text": "离线"
                                    },
                                    {
                                        "code": "0",
                                        "color": "#0048FF",
                                        "text": "在线"
                                    }
                                ],
                                "id": "C01",
                                "name": "组态图四",
                                "position": {
                                    "left": "0%",
                                    "position": "absolute",
                                    "top": "28.609374999999996%"
                                },
                                "type": "Status",
                                "value": 0
                            },
                            {
                                "color": "#C50D0D",
                                "id": "S09",
                                "position": {
                                    "left": "0.7168458781362007%",
                                    "position": "absolute",
                                    "top": "63%"
                                },
                                "type": "Digit",
                                "value": 0
                            }
                        ],
                        "name": "组态图",
                        "style": {
                            "inner": {
                                "background-size": "100%100%",
                                "height": "100%",
                                "width": "90%"
                            },
                            "outer": {
                                "height": "94%",
                                "left": "10%",
                                "top": "6%",
                                "width": "90%"
                            }
                        },
                        "theme": "dashboard",
                        "type": "scd",
                        "xys": {
                            "len": [
                                5,
                                7
                            ],
                            "pos": [
                                5,
                                8
                            ]
                        }
                    },
                    {
                        "attribute": "ddc_7",
                        "from": [
                            "S09"
                        ],
                        "legendData": [
                            "用电量"
                        ],
                        "name": "区段分布",
                        "series": [
                            {
                                "data": [],
                                "from": "S09",
                                "insideColor": "#5F7BB8",
                                "name": "用电量",
                                "outsideColor": "#002FFF",
                                "peakData": [
                                    {
                                        "endNum": "3",
                                        "peakName": "用电高峰",
                                        "startNum": "2"
                                    },
                                    {
                                        "endNum": "8",
                                        "peakName": "用水高峰",
                                        "startNum": "7"
                                    }
                                ],
                                "shadowColor": "#BFBABA",
                                "type": "line"
                            }
                        ],
                        "theme": "dashboard",
                        "type": "ddc",
                        "xAxis": [],
                        "xys": {
                            "len": [
                                5,
                                5
                            ],
                            "pos": [
                                0,
                                15
                            ]
                        }
                    }
                ],
                "dataType": "images",
                "name": "新增页面",
                "row": 12,
                "screenHeight": 0,
                "screenWidth": 0,
                "tag": "page_2",
                "webSocket": {
                    "objectId": 1004,
                    "projectId": 4,
                    "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                }
            }
        },
        "template": {},
        "reference": "test",
        "created_by": 1001,
        "last_modified": "2020-12-12 15:36:04",
        "last_modified_by": 1001,
        "is_available": 1,
        "category": "pro",
        "created": "2020-11-30 14:45:01"
    }
}

2.9. 查询关联显示板列表

请求地址:

属性
URL /api/v1/object/getDashboardList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
object_id int int(11) --- 对象组编号
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/object/getDashboardList?object_id=1004

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 2,
        "data": [
            {
                "id": 1003,
                "name": "test26",
                "description": "foo",
                "script": {
                    "Dashboard-0": {
                        "col": 20,
                        "data": [
                            {
                                "attribute": "crd_0",
                                "backgroundColor": "#D69999",
                                "fontColor": "#fff",
                                "itemData": [
                                    {
                                        "id": "S04",
                                        "name": "测试A类型",
                                        "value": 0
                                    }
                                ],
                                "name": "标题2",
                                "size1": "20px",
                                "size2": "32px",
                                "size3": "20px",
                                "theme": "dashboard",
                                "type": "crd",
                                "xys": {
                                    "len": [
                                        4,
                                        4
                                    ],
                                    "pos": [
                                        0,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "vlu_1",
                                "itemData": [
                                    {
                                        "backgroundColor": "#72C6A3",
                                        "id": "S05",
                                        "name": "测试B类型"
                                    }
                                ],
                                "name": "标题3",
                                "nameSize": "20px",
                                "theme": "dashboard",
                                "timeSize": "16px",
                                "type": "vlu",
                                "valueSize": "40px",
                                "xys": {
                                    "len": [
                                        4,
                                        4
                                    ],
                                    "pos": [
                                        0,
                                        4
                                    ]
                                }
                            },
                            {
                                "attribute": "lin_1",
                                "from": [
                                    "S07"
                                ],
                                "legendData": [
                                    "测试"
                                ],
                                "lineColor": [
                                    "#D01515"
                                ],
                                "markLineData": [
                                    "null"
                                ],
                                "name": "测试曲线",
                                "series": [
                                    {
                                        "data": [],
                                        "from": "S07",
                                        "itemStyle": {
                                            "color": "#D01515"
                                        },
                                        "lineStyle": {
                                            "color": "#D01515"
                                        },
                                        "markLine": [],
                                        "name": "测试",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "lin",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        4,
                                        7
                                    ],
                                    "pos": [
                                        0,
                                        8
                                    ]
                                }
                            },
                            {
                                "attribute": "gag_1",
                                "data": {
                                    "color": [
                                        [
                                            "100",
                                            "#67c23a"
                                        ],
                                        [
                                            "180",
                                            "#C2BB3A"
                                        ],
                                        [
                                            "200",
                                            "#C2513A"
                                        ]
                                    ],
                                    "max": 200,
                                    "min": 0,
                                    "name": "测试",
                                    "steps": 5,
                                    "value": 0
                                },
                                "from": "S08",
                                "name": "测试仪表",
                                "theme": "dashboard",
                                "type": "gag",
                                "xys": {
                                    "len": [
                                        4,
                                        5
                                    ],
                                    "pos": [
                                        0,
                                        15
                                    ]
                                }
                            },
                            {
                                "attribute": "pie_4",
                                "from": [
                                    "S11",
                                    "S12",
                                    "S13",
                                    "S14"
                                ],
                                "legendData": [
                                    "音乐",
                                    "游戏",
                                    "视频",
                                    "浏览网页"
                                ],
                                "name": "手机用时",
                                "series": [
                                    {
                                        "data": [
                                            {
                                                "from": "S11",
                                                "name": "音乐",
                                                "value": 0
                                            },
                                            {
                                                "from": "S12",
                                                "name": "游戏",
                                                "value": 0
                                            },
                                            {
                                                "from": "S13",
                                                "name": "视频",
                                                "value": 0
                                            },
                                            {
                                                "from": "S14",
                                                "name": "浏览网页",
                                                "value": 0
                                            }
                                        ]
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "pie",
                                "xys": {
                                    "len": [
                                        5,
                                        6
                                    ],
                                    "pos": [
                                        4,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "rad_5",
                                "from": [
                                    "S15",
                                    "S16",
                                    "S17"
                                ],
                                "indicator": [
                                    {
                                        "from": "S15",
                                        "max": 800,
                                        "name": "华为"
                                    },
                                    {
                                        "from": "S14",
                                        "max": 400,
                                        "name": "小米"
                                    },
                                    {
                                        "from": "S11",
                                        "max": 100,
                                        "name": "魅族"
                                    }
                                ],
                                "legendData": [
                                    "雷达图"
                                ],
                                "name": "雷达图",
                                "seriesData": [
                                    {
                                        "name": "雷达图",
                                        "value": []
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "rad",
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        4,
                                        6
                                    ]
                                }
                            },
                            {
                                "attribute": "bar_6",
                                "from": [
                                    "S20",
                                    "S28"
                                ],
                                "legendData": [
                                    "发电量",
                                    "用电量"
                                ],
                                "name": "柱状图测试",
                                "series": [
                                    {
                                        "color": "#CB0E0E",
                                        "from": "S20",
                                        "name": "发电量"
                                    },
                                    {
                                        "color": "#137345",
                                        "from": "S28",
                                        "name": "用电量"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "bar",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        4,
                                        13
                                    ]
                                }
                            }
                        ],
                        "dataType": "images",
                        "name": "新增页面",
                        "row": 9,
                        "screenHeight": 0,
                        "screenWidth": 0,
                        "tag": "page_1",
                        "webSocket": {
                            "objectId": 1004,
                            "projectId": 4,
                            "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                        }
                    },
                    "Dashboard-1": {
                        "col": 20,
                        "data": [
                            {
                                "attribute": "dzc_7",
                                "from": [
                                    "S20"
                                ],
                                "legendData": [
                                    "数据"
                                ],
                                "name": "大数据缩放图",
                                "series": [
                                    {
                                        "downColor": "#C21C11",
                                        "from": "S20",
                                        "name": "数据",
                                        "type": "line",
                                        "upColor": "#EBEA90"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "dzc",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        8
                                    ],
                                    "pos": [
                                        0,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "aqi_7",
                                "from": [
                                    "S07"
                                ],
                                "legendData": [
                                    "指数"
                                ],
                                "name": "指数测试",
                                "pieceArr": [
                                    {
                                        "yAxis": "80"
                                    },
                                    {
                                        "yAxis": "100"
                                    },
                                    {
                                        "yAxis": "120"
                                    }
                                ],
                                "pieces": [
                                    {
                                        "color": "#A7AE1A",
                                        "gt": 0,
                                        "lte": 80
                                    },
                                    {
                                        "color": "#0095FF",
                                        "gt": 80,
                                        "lte": 100
                                    },
                                    {
                                        "color": "#B70808",
                                        "gt": 100
                                    }
                                ],
                                "series": [
                                    {
                                        "data": [],
                                        "from": "S07",
                                        "name": "指数",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "aqi",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        0,
                                        8
                                    ]
                                }
                            },
                            {
                                "attribute": "mxa_8",
                                "from": [
                                    "S08",
                                    "S09"
                                ],
                                "legendData": [
                                    "音乐",
                                    "电影"
                                ],
                                "name": "双X轴曲线",
                                "series": [
                                    {
                                        "color": "#EA2222",
                                        "from": "S08",
                                        "name": "音乐",
                                        "type": "line"
                                    },
                                    {
                                        "color": "#0F8562",
                                        "from": "S09",
                                        "name": "电影",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "mxa",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        8
                                    ],
                                    "pos": [
                                        5,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "scd_9",
                                "background": "20200917173720.png",
                                "height": 200,
                                "itemData": [
                                    {
                                        "id": "S05",
                                        "name": "组态图一",
                                        "position": {
                                            "left": "0%",
                                            "position": "absolute",
                                            "top": "0.5%"
                                        },
                                        "type": "Plate",
                                        "value": 0
                                    },
                                    {
                                        "ULG_max": 200,
                                        "ULG_min": 0,
                                        "ULG_width": "14px",
                                        "id": "S08",
                                        "name": "组态图二",
                                        "position": {
                                            "left": "69.89247311827957%",
                                            "position": "absolute",
                                            "top": "1%"
                                        },
                                        "showScale": true,
                                        "start_value": 0,
                                        "step": 5,
                                        "type": "ULG",
                                        "value": 0
                                    },
                                    {
                                        "id": "H01",
                                        "name": "组态图三",
                                        "off": "1",
                                        "on": "0",
                                        "position": {
                                            "left": "31.899641577060933%",
                                            "position": "absolute",
                                            "top": "1.5%"
                                        },
                                        "type": "Signal",
                                        "value": "1"
                                    },
                                    {
                                        "flag": [
                                            {
                                                "code": "1",
                                                "color": "#dd0033",
                                                "text": "离线"
                                            },
                                            {
                                                "code": "0",
                                                "color": "#0048FF",
                                                "text": "在线"
                                            }
                                        ],
                                        "id": "C01",
                                        "name": "组态图四",
                                        "position": {
                                            "left": "0%",
                                            "position": "absolute",
                                            "top": "28.609374999999996%"
                                        },
                                        "type": "Status",
                                        "value": 0
                                    },
                                    {
                                        "color": "#C50D0D",
                                        "id": "S09",
                                        "position": {
                                            "left": "0.7168458781362007%",
                                            "position": "absolute",
                                            "top": "63%"
                                        },
                                        "type": "Digit",
                                        "value": 0
                                    }
                                ],
                                "name": "组态图",
                                "style": {
                                    "inner": {
                                        "background-size": "100%100%",
                                        "height": "100%",
                                        "width": "90%"
                                    },
                                    "outer": {
                                        "height": "94%",
                                        "left": "10%",
                                        "top": "6%",
                                        "width": "90%"
                                    }
                                },
                                "theme": "dashboard",
                                "type": "scd",
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        5,
                                        8
                                    ]
                                }
                            },
                            {
                                "attribute": "ddc_7",
                                "from": [
                                    "S09"
                                ],
                                "legendData": [
                                    "用电量"
                                ],
                                "name": "区段分布",
                                "series": [
                                    {
                                        "data": [],
                                        "from": "S09",
                                        "insideColor": "#5F7BB8",
                                        "name": "用电量",
                                        "outsideColor": "#002FFF",
                                        "peakData": [
                                            {
                                                "endNum": "3",
                                                "peakName": "用电高峰",
                                                "startNum": "2"
                                            },
                                            {
                                                "endNum": "8",
                                                "peakName": "用水高峰",
                                                "startNum": "7"
                                            }
                                        ],
                                        "shadowColor": "#BFBABA",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "ddc",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        5
                                    ],
                                    "pos": [
                                        0,
                                        15
                                    ]
                                }
                            }
                        ],
                        "dataType": "images",
                        "name": "新增页面",
                        "row": 12,
                        "screenHeight": 0,
                        "screenWidth": 0,
                        "tag": "page_2",
                        "webSocket": {
                            "objectId": 1004,
                            "projectId": 4,
                            "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                        }
                    }
                },
                "template": {
                    "foo": "this is json"
                },
                "reference": "test",
                "created_by": 1001,
                "last_modified": "2020-12-12 15:36:22",
                "last_modified_by": 1001,
                "is_available": 1,
                "category": "notpro",
                "created": "2020-11-30 14:59:08"
            },
            {
                "id": 1002,
                "name": "test25",
                "description": "foo",
                "script": {
                    "Dashboard-0": {
                        "col": 20,
                        "data": [
                            {
                                "attribute": "crd_0",
                                "backgroundColor": "#D69999",
                                "fontColor": "#fff",
                                "itemData": [
                                    {
                                        "id": "S04",
                                        "name": "测试A类型",
                                        "value": 0
                                    }
                                ],
                                "name": "标题2",
                                "size1": "20px",
                                "size2": "32px",
                                "size3": "20px",
                                "theme": "dashboard",
                                "type": "crd",
                                "xys": {
                                    "len": [
                                        4,
                                        4
                                    ],
                                    "pos": [
                                        0,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "vlu_1",
                                "itemData": [
                                    {
                                        "backgroundColor": "#72C6A3",
                                        "id": "S05",
                                        "name": "测试B类型"
                                    }
                                ],
                                "name": "标题3",
                                "nameSize": "20px",
                                "theme": "dashboard",
                                "timeSize": "16px",
                                "type": "vlu",
                                "valueSize": "40px",
                                "xys": {
                                    "len": [
                                        4,
                                        4
                                    ],
                                    "pos": [
                                        0,
                                        4
                                    ]
                                }
                            },
                            {
                                "attribute": "lin_1",
                                "from": [
                                    "S07"
                                ],
                                "legendData": [
                                    "测试"
                                ],
                                "lineColor": [
                                    "#D01515"
                                ],
                                "markLineData": [
                                    "null"
                                ],
                                "name": "测试曲线",
                                "series": [
                                    {
                                        "data": [],
                                        "from": "S07",
                                        "itemStyle": {
                                            "color": "#D01515"
                                        },
                                        "lineStyle": {
                                            "color": "#D01515"
                                        },
                                        "markLine": [],
                                        "name": "测试",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "lin",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        4,
                                        7
                                    ],
                                    "pos": [
                                        0,
                                        8
                                    ]
                                }
                            },
                            {
                                "attribute": "gag_1",
                                "data": {
                                    "color": [
                                        [
                                            "100",
                                            "#67c23a"
                                        ],
                                        [
                                            "180",
                                            "#C2BB3A"
                                        ],
                                        [
                                            "200",
                                            "#C2513A"
                                        ]
                                    ],
                                    "max": 200,
                                    "min": 0,
                                    "name": "测试",
                                    "steps": 5,
                                    "value": 0
                                },
                                "from": "S08",
                                "name": "测试仪表",
                                "theme": "dashboard",
                                "type": "gag",
                                "xys": {
                                    "len": [
                                        4,
                                        5
                                    ],
                                    "pos": [
                                        0,
                                        15
                                    ]
                                }
                            },
                            {
                                "attribute": "pie_4",
                                "from": [
                                    "S11",
                                    "S12",
                                    "S13",
                                    "S14"
                                ],
                                "legendData": [
                                    "音乐",
                                    "游戏",
                                    "视频",
                                    "浏览网页"
                                ],
                                "name": "手机用时",
                                "series": [
                                    {
                                        "data": [
                                            {
                                                "from": "S11",
                                                "name": "音乐",
                                                "value": 0
                                            },
                                            {
                                                "from": "S12",
                                                "name": "游戏",
                                                "value": 0
                                            },
                                            {
                                                "from": "S13",
                                                "name": "视频",
                                                "value": 0
                                            },
                                            {
                                                "from": "S14",
                                                "name": "浏览网页",
                                                "value": 0
                                            }
                                        ]
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "pie",
                                "xys": {
                                    "len": [
                                        5,
                                        6
                                    ],
                                    "pos": [
                                        4,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "rad_5",
                                "from": [
                                    "S15",
                                    "S16",
                                    "S17"
                                ],
                                "indicator": [
                                    {
                                        "from": "S15",
                                        "max": 800,
                                        "name": "华为"
                                    },
                                    {
                                        "from": "S14",
                                        "max": 400,
                                        "name": "小米"
                                    },
                                    {
                                        "from": "S11",
                                        "max": 100,
                                        "name": "魅族"
                                    }
                                ],
                                "legendData": [
                                    "雷达图"
                                ],
                                "name": "雷达图",
                                "seriesData": [
                                    {
                                        "name": "雷达图",
                                        "value": []
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "rad",
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        4,
                                        6
                                    ]
                                }
                            },
                            {
                                "attribute": "bar_6",
                                "from": [
                                    "S20",
                                    "S28"
                                ],
                                "legendData": [
                                    "发电量",
                                    "用电量"
                                ],
                                "name": "柱状图测试",
                                "series": [
                                    {
                                        "color": "#CB0E0E",
                                        "from": "S20",
                                        "name": "发电量"
                                    },
                                    {
                                        "color": "#137345",
                                        "from": "S28",
                                        "name": "用电量"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "bar",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        4,
                                        13
                                    ]
                                }
                            }
                        ],
                        "dataType": "images",
                        "name": "新增页面",
                        "row": 9,
                        "screenHeight": 0,
                        "screenWidth": 0,
                        "tag": "page_1",
                        "webSocket": {
                            "objectId": 1004,
                            "projectId": 4,
                            "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                        }
                    },
                    "Dashboard-1": {
                        "col": 20,
                        "data": [
                            {
                                "attribute": "dzc_7",
                                "from": [
                                    "S20"
                                ],
                                "legendData": [
                                    "数据"
                                ],
                                "name": "大数据缩放图",
                                "series": [
                                    {
                                        "downColor": "#C21C11",
                                        "from": "S20",
                                        "name": "数据",
                                        "type": "line",
                                        "upColor": "#EBEA90"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "dzc",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        8
                                    ],
                                    "pos": [
                                        0,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "aqi_7",
                                "from": [
                                    "S07"
                                ],
                                "legendData": [
                                    "指数"
                                ],
                                "name": "指数测试",
                                "pieceArr": [
                                    {
                                        "yAxis": "80"
                                    },
                                    {
                                        "yAxis": "100"
                                    },
                                    {
                                        "yAxis": "120"
                                    }
                                ],
                                "pieces": [
                                    {
                                        "color": "#A7AE1A",
                                        "gt": 0,
                                        "lte": 80
                                    },
                                    {
                                        "color": "#0095FF",
                                        "gt": 80,
                                        "lte": 100
                                    },
                                    {
                                        "color": "#B70808",
                                        "gt": 100
                                    }
                                ],
                                "series": [
                                    {
                                        "data": [],
                                        "from": "S07",
                                        "name": "指数",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "aqi",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        0,
                                        8
                                    ]
                                }
                            },
                            {
                                "attribute": "mxa_8",
                                "from": [
                                    "S08",
                                    "S09"
                                ],
                                "legendData": [
                                    "音乐",
                                    "电影"
                                ],
                                "name": "双X轴曲线",
                                "series": [
                                    {
                                        "color": "#EA2222",
                                        "from": "S08",
                                        "name": "音乐",
                                        "type": "line"
                                    },
                                    {
                                        "color": "#0F8562",
                                        "from": "S09",
                                        "name": "电影",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "mxa",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        8
                                    ],
                                    "pos": [
                                        5,
                                        0
                                    ]
                                }
                            },
                            {
                                "attribute": "scd_9",
                                "background": "20200917173720.png",
                                "height": 200,
                                "itemData": [
                                    {
                                        "id": "S05",
                                        "name": "组态图一",
                                        "position": {
                                            "left": "0%",
                                            "position": "absolute",
                                            "top": "0.5%"
                                        },
                                        "type": "Plate",
                                        "value": 0
                                    },
                                    {
                                        "ULG_max": 200,
                                        "ULG_min": 0,
                                        "ULG_width": "14px",
                                        "id": "S08",
                                        "name": "组态图二",
                                        "position": {
                                            "left": "69.89247311827957%",
                                            "position": "absolute",
                                            "top": "1%"
                                        },
                                        "showScale": true,
                                        "start_value": 0,
                                        "step": 5,
                                        "type": "ULG",
                                        "value": 0
                                    },
                                    {
                                        "id": "H01",
                                        "name": "组态图三",
                                        "off": "1",
                                        "on": "0",
                                        "position": {
                                            "left": "31.899641577060933%",
                                            "position": "absolute",
                                            "top": "1.5%"
                                        },
                                        "type": "Signal",
                                        "value": "1"
                                    },
                                    {
                                        "flag": [
                                            {
                                                "code": "1",
                                                "color": "#dd0033",
                                                "text": "离线"
                                            },
                                            {
                                                "code": "0",
                                                "color": "#0048FF",
                                                "text": "在线"
                                            }
                                        ],
                                        "id": "C01",
                                        "name": "组态图四",
                                        "position": {
                                            "left": "0%",
                                            "position": "absolute",
                                            "top": "28.609374999999996%"
                                        },
                                        "type": "Status",
                                        "value": 0
                                    },
                                    {
                                        "color": "#C50D0D",
                                        "id": "S09",
                                        "position": {
                                            "left": "0.7168458781362007%",
                                            "position": "absolute",
                                            "top": "63%"
                                        },
                                        "type": "Digit",
                                        "value": 0
                                    }
                                ],
                                "name": "组态图",
                                "style": {
                                    "inner": {
                                        "background-size": "100%100%",
                                        "height": "100%",
                                        "width": "90%"
                                    },
                                    "outer": {
                                        "height": "94%",
                                        "left": "10%",
                                        "top": "6%",
                                        "width": "90%"
                                    }
                                },
                                "theme": "dashboard",
                                "type": "scd",
                                "xys": {
                                    "len": [
                                        5,
                                        7
                                    ],
                                    "pos": [
                                        5,
                                        8
                                    ]
                                }
                            },
                            {
                                "attribute": "ddc_7",
                                "from": [
                                    "S09"
                                ],
                                "legendData": [
                                    "用电量"
                                ],
                                "name": "区段分布",
                                "series": [
                                    {
                                        "data": [],
                                        "from": "S09",
                                        "insideColor": "#5F7BB8",
                                        "name": "用电量",
                                        "outsideColor": "#002FFF",
                                        "peakData": [
                                            {
                                                "endNum": "3",
                                                "peakName": "用电高峰",
                                                "startNum": "2"
                                            },
                                            {
                                                "endNum": "8",
                                                "peakName": "用水高峰",
                                                "startNum": "7"
                                            }
                                        ],
                                        "shadowColor": "#BFBABA",
                                        "type": "line"
                                    }
                                ],
                                "theme": "dashboard",
                                "type": "ddc",
                                "xAxis": [],
                                "xys": {
                                    "len": [
                                        5,
                                        5
                                    ],
                                    "pos": [
                                        0,
                                        15
                                    ]
                                }
                            }
                        ],
                        "dataType": "images",
                        "name": "新增页面",
                        "row": 12,
                        "screenHeight": 0,
                        "screenWidth": 0,
                        "tag": "page_2",
                        "webSocket": {
                            "objectId": 1004,
                            "projectId": 4,
                            "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                        }
                    }
                },
                "template": {},
                "reference": "test",
                "created_by": 1001,
                "last_modified": "2020-12-12 15:36:04",
                "last_modified_by": 1001,
                "is_available": 1,
                "category": "pro",
                "created": "2020-11-30 14:45:01"
            }
        ]
    }
}

3. 终端接口

3.1. 添加终端

请求地址:

属性
URL /api/v1/terminal/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
terminal_id string varchar(64) --- 终端编号
name string varchar(64) --- 终端名
description string varchar(255) --- 描述
type string varchar(16) --- 适配器类型:Aprus-Ⅱ、Aprus-Ⅲ、Aprus-X、Apieco、Other
maker string varchar(64) --- 生产厂家
config_id int int(11) --- 适配器配置编号
is_route int tinyint(1) --- 是否Boss路由:0否,1是
mode string varchar(16) --- 鉴权方式:auto-自动算法校验、pwd-用户密码校验
username string varchar(32) --- 鉴权用户名
pin string varchar(16) --- 鉴权验证码
access string varchar(16) --- 报文权限(单选):all,pub,sub
topic string varchar(64) --- 报文主题(多选):all:all;pub:r,a,v,p,i,n;sub:g/#
server string varchar(32) --- gards服务器
session_expiry int int(11) --- 会话生存时间
keep_alive int int(11) --- 客户端心跳时间
encryption int tinyint(1) --- 内容是否加密:0否,1是
dixie int tinyint(1) --- 是否启用scram-sha-1高级鉴权:0否,1是
rsa_privatekey string text --- rsa私钥
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "terminal_id": "test",
    "name": "terminal1",
    "description": "terminal1",
    "type": "Aprus-Ⅱ",
    "maker": "智物联",
    "config_id": 1,
    "is_route": 1,
    "mode": "auto",
    "username": "test",
    "pin": "test",
    "access": "all",
    "topic": "all",
    "server": "192.168.0.132",
    "session_expiry": 120,
    "keep_alive": 30,
    "encryption": 0,
    "dixie": 1,
    "rsa_privatekey": "12345678",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/terminal/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

3.2. 编辑终端

请求地址:

属性
URL /api/v1/terminal/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
terminal_id string varchar(64) --- 终端编号
name string varchar(64) --- 终端名
description string varchar(255) --- 描述
maker string varchar(64) --- 生产厂家
type string varchar(16) --- 适配器类型:Aprus-Ⅱ、Aprus-Ⅲ、Aprus-X、Apieco、Other
is_route int tinyint(1) --- 是否Boss路由:0否,1是
mode string varchar(16) --- 鉴权方式:auto-自动算法校验、pwd-用户密码校验
username string varchar(32) --- 鉴权用户名
pin string varchar(16) --- 鉴权验证码
access string varchar(16) --- 报文权限(单选):all,pub,sub
topic string varchar(64) --- 报文主题(多选):all:all;pub:r,a,v,p,i,n;sub:g/#
activated string --- --- 激活时间
config_id int int(11) --- 适配器配置编号
server string varchar(32) --- gards服务器
session_expiry int int(11) --- 会话生存时间
keep_alive int int(11) --- 客户端心跳时间
encryption int tinyint(1) --- 内容是否加密:0否,1是
dixie int tinyint(1) --- 是否启用scram-sha-1高级鉴权:0否,1是
rsa_privatekey string text --- rsa私钥
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified string --- --- 最后修改时间(编辑更新)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1001,
    "terminal_id": "test2",
    "name": "terminal2",
    "description": "terminal2",
    "type": "Aprus-Ⅱ",
    "maker": "智物联",
    "config_id": 2,
    "is_route": 2,
    "mode": "pwd",
    "username": "1",
    "pin": "test1",
    "access": "all",
    "topic": "all",
    "server": "192.168.0.132",
    "session_expiry": 120,
    "keep_alive": 30,
    "encryption": 1,
    "dixie": 1,
    "rsa_privatekey": "12345678",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/terminal/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

3.3. 删除终端

请求地址:

属性
URL /api/v1/terminal/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1011
}' "https://xxx.mixiot.top/hapio/api/v1/terminal/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

3.4. 获取终端

请求地址:

属性
URL /api/v1/terminal/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/terminal/getItem?id=1001"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "id": 1001,
        "terminal_id": "test2",
        "name": "terminal2",
        "description": "terminal2",
        "type": "Aprus-Ⅱ",
        "maker": "智物联",
        "config_id": 2,
        "is_route": 2,
        "mode": "pwd",
        "username": "1",
        "pin": "test1",
        "access": "all",
        "topic": "all",
        "server": "192.168.0.132",
        "session_expiry": 120,
        "keep_alive": 30,
        "encryption": 1,
        "dixie": 1,
        "rsa_privatekey": "12345678",
        "reference": "参考号123",
        "created": "2020-10-21 07:13:08",
        "created_by": 1,
        "last_modified": "2020-10-21 07:17:55",
        "last_modified_by": 1,
        "is_available": 1
    }
}

3.5. 获取终端列表

请求地址:

属性
URL /api/v1/terminal/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/terminal/getList?where_and=[["name","LIKE","%25terminal2"],["id",">","1"]]&where_or=[["id","=","1"],["id",">","1"]]&where_in=["id","1001,1002"]&page_index=1&page_size=10"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 1,
        "page_size": 10,
        "total_pages": 1,
        "total_records": 1,
        "data": [
            {
                "id": 1001,
                "terminal_id": "test2",
                "name": "terminal2",
                "description": "terminal2",
                "type": "Aprus-Ⅱ",
                "maker": "智物联",
                "config_id": 2,
                "is_route": 2,
                "mode": "pwd",
                "username": "1",
                "pin": "test1",
                "access": "all",
                "topic": "all",
                "server": "192.168.0.132",
                "session_expiry": 120,
                "keep_alive": 30,
                "encryption": 1,
                "dixie": 1,
                "rsa_privatekey": "12345678",
                "reference": "参考号123",
                "created": "2020-10-21 07:13:08",
                "created_by": 1,
                "last_modified": "2020-10-21 07:17:55",
                "last_modified_by": 1,
                "is_available": 1
            }
        ]
    }
}

4. 配置接口

4.1. 添加配置

请求地址:

属性
URL /api/v1/config/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
name string varchar(64) --- 名称
description string varchar(255) --- 描述
hardware string varchar(64) --- 硬件
mcu_file string varchar(128) --- MCU文件路径
mcu_version string varchar(32) --- MCU版本号
remosu_file string varchar(128) --- Remosu文件路径
remosu_version string varchar(32) --- Remosu版本号
lua_file string varchar(128) --- Lua文件路径
lua_version string varchar(32) --- Lua版本号
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "name": "config1",
    "description": "config number 1",
    "hardware": "arm",
    "mcu_file": "/var/image/default",
    "mcu_version": "v1.0.0",
    "remosu_file": "var/image/default",
    "remosu_version": "v1.0.0",
    "lua_file": "var/image/default",
    "lua_version": "v1.0.0",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/config/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

4.2. 编辑配置

请求地址:

属性
URL /api/v1/config/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
name string varchar(64) --- 名称
description string varchar(255) --- 描述
hardware string varchar(64) --- 硬件
mcu_file string varchar(128) --- MCU文件路径
mcu_version string varchar(32) --- MCU版本号
remosu_file string varchar(128) --- Remosu文件路径
remosu_version string varchar(32) --- Remosu版本号
lua_file string varchar(128) --- Lua文件路径
lua_version string varchar(32) --- Lua版本号
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1011,
    "name": "config1",
    "description": "config number 1",
    "hardware": "arm",
    "mcu_file": "/var/image/default",
    "mcu_version": "v1.0.0",
    "remosu_file": "var/image/default",
    "remosu_version": "v1.0.0",
    "lua_file": "var/image/default",
    "lua_version": "v1.0.0",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/config/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

4.3. 删除配置

请求地址:

属性
URL /api/v1/config/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1011
}' "https://xxx.mixiot.top/hapio/api/v1/config/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

4.4. 获取配置

请求地址:

属性
URL /api/v1/config/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/config/getItem?id=1014"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "id": 1014,
        "name": "config1",
        "description": "config number 1",
        "hardware": "arm",
        "mcu_file": "/var/image/default",
        "mcu_version": "v1.0.0",
        "remosu_file": "var/image/default",
        "remosu_version": "v1.0.0",
        "lua_file": "var/image/default",
        "lua_version": "v1.0.0",
        "reference": "参考号123",
        "created": "2020-09-28 14:44:01",
        "created_by": 1,
        "last_modified": "2020-09-28 14:44:01",
        "last_modified_by": 1,
        "is_available": 1
    }
}

4.5. 获取配置列表

请求地址:

属性
URL /api/v1/config/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/config/getList?where_and=[["name","LIKE","%25config1"],["id","<>","1001"]]&where_or=[["created","=","2020-10-21 07:24:46"],["created","=","2020-09-28 14:44:02"]]&where_in=["id","1002"]&page_index=1&page_size=10"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 1,
        "page_size": 10,
        "total_pages": 1,
        "total_records": 1,
        "data": [
            {
                "id": 1002,
                "name": "config1",
                "description": "config number 1",
                "hardware": "arm",
                "mcu_file": "/var/image/default",
                "mcu_version": "v1.0.0",
                "remosu_file": "var/image/default",
                "remosu_version": "v1.0.0",
                "lua_file": "var/image/default",
                "lua_version": "v1.0.0",
                "reference": "参考号123",
                "created": "2020-10-21 07:24:46",
                "created_by": 1,
                "last_modified": "2020-10-21 07:24:46",
                "last_modified_by": 1,
                "is_available": 1
            }
        ]
    }
}

5. 控制接口

5.1. 添加控制

请求地址:

属性
URL /api/v1/control/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
name string varchar(64) --- 名称
description string varchar(255) --- 描述
script string json --- 脚本(控制码)
template string json --- 模板(暂未使用)
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "name": "control1",
    "description": "control number 1",
    "script": "{\"id\":1}",
    "template": "{\"id\":1}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/control/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

5.2. 编辑控制

请求地址:

属性
URL /api/v1/control/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
name string varchar(64) --- 名称
description string varchar(255) --- 描述
script string json --- 脚本(控制码)
template string json --- 模板(暂未使用)
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1003,
    "name": "control2",
    "description": "control number 2",
    "script": "{\"id\":2}",
    "template": "{\"id\":2}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/control/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

5.3. 删除控制

请求地址:

属性
URL /api/v1/control/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1011
}' "https://xxx.mixiot.top/hapio/api/v1/control/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

5.4. 获取控制

请求地址:

属性
URL /api/v1/control/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/control/getItem?id=1003"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "id": 1001,
        "name": "test_cdp",
        "description": "",
        "script": [
            ["Control_01", "Set Temperature", "设置温度", "OBJ", "$AprusID-1.L1_2_123", ""],
            ["Control_02", "Device Boot", "设备开机", "OBJ", "$AprusID-2.L1_2_234", "1"],
            ["Control_03", "Device Shutdown", "设备关机", "OBJ", "$AprusID-1.L1_2_345", "0"],
            ["AXUpgrade", "Aprus Upgrade", "适配器升级", "APR", "$AprusID-1", "LUA"],
            ["Reboot", "Aprus Reboot", "适配器重启", "APR", "$AprusID-2", ""]
        ],
        "template": {},
        "reference": "",
        "created": "2020-11-03 16:51:53",
        "created_by": 1001,
        "last_modified": "2020-11-03 16:51:53",
        "last_modified_by": 1001,
        "is_available": 1
    }
}

5.5. 获取控制列表

请求地址:

属性
URL /api/v1/control/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/control/getList?page_index=1&page_size=10&where_and=[["name","LIKE","%25control1"],["id",">","1"]]&where_or=[["id","=","1"],["id",">","1"]]&where_in=["id","1001,1003"]"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 0,
        "page_size": 2,
        "total_pages": 3,
        "total_records": 5,
        "data": [{
            "id": 1001,
            "name": "test_cdp",
            "description": "",
            "script": [
                ["Control_01", "Set Temperature", "设置温度", "OBJ", "$AprusID-1.L1_2_123", ""],
                ["Control_02", "Device Boot", "设备开机", "OBJ", "$AprusID-2.L1_2_234", "1"],
                ["Control_03", "Device Shutdown", "设备关机", "OBJ", "$AprusID-1.L1_2_345", "0"],
                ["AXUpgrade", "Aprus Upgrade", "适配器升级", "APR", "$AprusID-1", "LUA"],
                ["Reboot", "Aprus Reboot", "适配器重启", "APR", "$AprusID-2", ""]
            ],
            "template": {},
            "reference": "",
            "created": "2020-11-03 16:51:53",
            "created_by": 1001,
            "last_modified": "2020-11-03 16:51:53",
            "last_modified_by": 1001,
            "is_available": 1
        }, {
            "id": 1002,
            "name": "demo",
            "description": "",
            "script": [
                ["Control_01", "Set Temperature", "设置温度", "OBJ", "$AprusID-1.L1_2_123", ""],
                ["Control_02", "Device Boot", "设备开机", "OBJ", "$AprusID-1.L1_2_234", "1"],
                ["Control_03", "Device Shutdown", "设备关机", "OBJ", "$AprusID-1", "0"],
                ["AXUpgrade", "Aprus Upgrade", "适配器升级", "APR", "$AprusID-1", "LUA"],
                ["Reboot", "Aprus Reboot", "适配器重启", "APR", "$AprusID-1", ""],
                ["Diag", "Aprus Diag", "适配器Diag", "APR", "$AprusID-1", ""]
            ],
            "template": {},
            "reference": "",
            "created": "2020-11-05 19:27:37",
            "created_by": 1001,
            "last_modified": "2020-11-05 19:27:37",
            "last_modified_by": 1001,
            "is_available": 1
        }]
    }
}

6. 映射接口

6.1. 添加映射

请求地址:

属性
URL /api/v1/mapping/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
name string varchar(64) --- 名称
description string varchar(255) --- 描述
script string json --- 脚本(控制码)
template string json --- 模板(暂未使用)
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "name": "mapping1",
    "description": "mapping number 1",
    "script": "{\"id\":1}",
    "template": "{\"id\":1}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/mapping/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

6.2. 编辑映射

请求地址:

属性
URL /api/v1/mapping/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
name string varchar(64) --- 名称
description string varchar(255) --- 描述
script string json --- 脚本(控制码)
template string json --- 模板(暂未使用)
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1003,
    "name": "mapping2",
    "description": "mapping number 2",
    "script": "{\"id\":2}",
    "template": "{\"id\":2}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/mapping/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

6.3. 删除映射

请求地址:

属性
URL /api/v1/mapping/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1011
}' "https://xxx.mixiot.top/hapio/api/v1/mapping/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

6.4. 获取映射

请求地址:

属性
URL /api/v1/mapping/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/mapping/getItem?id=1003"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "id": 1001,
        "name": "test_cdp",
        "description": "",
        "script": [
            ["v1", "v1_en_label", "v1的中文标签", "STA", "Changed", "$AprusID-1.L1_3_7_3", "", ""],
            ["v2", "v2_en_label", "v2的中文标签", "STA", "Changed", "$AprusID-1.L1_3_8_15", "", ""],
            ["expr", "", "测试计算函数", "FUNC", "Changed", "", "@Expr", {
                "digit": 3,
                "expr": "min((v1),(v2))"
            }],
            ["compare", "", "测试比较函数", "FUNC", "Changed", "", "@Compare", {
                "args": [
                    ["v1\u003ev2", "v1"],
                    ["v1\u003cv2", "v2"]
                ]
            }],
            ["1001", "", "测试事件1", "EVNT", "Changed", "$AprusID-1.L1_3_8_15", "==", "0"],
            ["1002", "", "测试事件2", "EVNT", "Changed", "v1", "==", "1"],
            ["M03", "CollectVariable", "离线类变量", "COL", "Cycled", "10s", "@Condition", {
                "collect_id": "1",
                "equipment_id": "1001",
                "reply": "float64"
            }],
            ["M04", "StatisticsVariable", "统计类变量", "STT", "Cycled", "10s", "@Condition", {
                "equipment_id": "1010",
                "reply": "float64",
                "statistics": "1"
            }]
        ],
        "template": {},
        "reference": "",
        "created": "2020-11-03 16:50:26",
        "created_by": 1001,
        "last_modified": "2020-12-10 18:43:02",
        "last_modified_by": 1001,
        "is_available": 1
    }
}

6.5. 获取映射列表

请求地址:

属性
URL /api/v1/mapping/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/mapping/getList?page_index=1&page_size=10&where_and=[["name","LIKE","%25control1"],["id",">","1"]]&where_or=[["id","=","1"],["id",">","1"]]&where_in=["id","1001,1003"]"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 0,
        "page_size": 2,
        "total_pages": 4,
        "total_records": 8,
        "data": [{
            "id": 1001,
            "name": "test_cdp",
            "description": "",
            "script": [
                ["v1", "v1_en_label", "v1的中文标签", "STA", "Changed", "$AprusID-1.L1_3_7_3", "", ""],
                ["v2", "v2_en_label", "v2的中文标签", "STA", "Changed", "$AprusID-1.L1_3_8_15", "", ""],
                ["expr", "", "测试计算函数", "FUNC", "Changed", "", "@Expr", {
                    "digit": 3,
                    "expr": "min((v1),(v2))"
                }],
                ["compare", "", "测试比较函数", "FUNC", "Changed", "", "@Compare", {
                    "args": [
                        ["v1\u003ev2", "v1"],
                        ["v1\u003cv2", "v2"]
                    ]
                }],
                ["1001", "", "测试事件1", "EVNT", "Changed", "$AprusID-1.L1_3_8_15", "==", "0"],
                ["1002", "", "测试事件2", "EVNT", "Changed", "v1", "==", "1"],
                ["M03", "CollectVariable", "离线类变量", "COL", "Cycled", "10s", "@Condition", {
                    "collect_id": "1",
                    "equipment_id": "1001",
                    "reply": "float64"
                }],
                ["M04", "StatisticsVariable", "统计类变量", "STT", "Cycled", "10s", "@Condition", {
                    "equipment_id": "1010",
                    "reply": "float64",
                    "statistics": "1"
                }]
            ],
            "template": {},
            "reference": "",
            "created": "2020-11-03 16:50:26",
            "created_by": 1001,
            "last_modified": "2020-12-10 18:43:02",
            "last_modified_by": 1001,
            "is_available": 1
        }, {
            "id": 1002,
            "name": "demo",
            "description": "",
            "script": [
                ["S01", "", "控制箱编号", "$AprusID-1", "L1_3_4696", "SET"],
                ["S02", "", "联系电话", "$AprusID-1", "L1_3_4704", "SET"],
                ["S03", "", "协助请求标志", "$AprusID-1", "L1_3_4710", "SET"],
                ["S04", "", "锅炉压力", "$AprusID-1", "L1_3_4711", "STA"],
                ["S05", "", "锅炉水位", "$AprusID-1", "L1_3_4712", "STA"],
                ["S06", "", "本体排烟温度", "$AprusID-1", "L1_3_4713", "STA"],
                ["S07", "", "排烟温度", "$AprusID-1", "L1_3_4714", "STA"],
                ["S08", "", "冷凝器进水温度", "$AprusID-1", "L1_3_4715", "STA"],
                ["S09", "", "冷凝器出水温度", "$AprusID-1", "L1_3_4716", "STA"],
                ["S10", "", "节能器出烟温度", "$AprusID-1", "L1_3_4717", "STA"],
                ["S11", "", "节能器进水温度", "$AprusID-1", "L1_3_4718", "STA"],
                ["S12", "", "节能器出水温度", "$AprusID-1", "L1_3_4719", "STA"],
                ["S84", "", "烟室温度", "$AprusID-1", "L1_3_4720", "STA"],
                ["S13", "", "炉膛温度", "$AprusID-1", "L1_3_4721", "STA"],
                ["S14", "", "水垢指标", "$AprusID-1", "L1_3_4722", "STA"],
                ["S15", "", "水位检测", "$AprusID-1", "L1_3_4723", "STA"],
                ["S16", "", "液位开关转换值", "$AprusID-1", "L1_3_4724", "STA"],
                ["S17", "", "燃烧风机频率", "$AprusID-1", "L1_3_4725", "STA"],
                ["S18", "", "给水瞬时流量", "$AprusID-1", "L1_3_4726", "STA"],
                ["T02", "", "给水累积流量", "$AprusID-1", "L1_3_4728", "STA"],
                ["S20", "", "蒸汽瞬时流量", "$AprusID-1", "L1_3_4730", "STA"],
                ["T01", "", "蒸汽累积流量", "$AprusID-1", "L1_3_4732", "STA"],
                ["S22", "", "烟气氧含量", "$AprusID-1", "L1_3_4734", "STA"],
                ["S23", "", "变频器输出频率", "$AprusID-1", "L1_3_4735", "STA"],
                ["S24", "", "加热PID输出比例", "$AprusID-1", "L1_3_4736", "STA"],
                ["S26", "", "控制模式", "$AprusID-1", "L1_3_4739", "SET"],
                ["S27", "", "燃烧器负荷调节时间", "$AprusID-1", "L1_3_47", "SET"],
                ["S28", "", "燃烧器启动时间", "$AprusID-1", "L1_3_4741", "SET"],
                ["S29", "", "燃烧段数设定", "$AprusID-1", "L1_3_4742", "SET"],
                ["S30", "", "燃烧段位切换启动间隔", "$AprusID-1", "L1_3_4743", "SET"],
                ["S31", "", "燃烧段位切换停止间隔", "$AprusID-1", "L1_3_4744", "SET"],
                ["S32", "", "目标压力", "$AprusID-1", "L1_3_4745", "SET"],
                ["S33", "", "目标上限偏差", "$AprusID-1", "L1_3_4746", "SET"],
                ["S34", "", "燃烧设定-积分", "$AprusID-1", "L1_3_4750", "SET"],
                ["S35", "", "燃烧设定-微分", "$AprusID-1", "L1_3_4751", "SET"],
                ["S36", "", "目标水位", "$AprusID-1", "L1_3_4752", "SET"],
                ["S37", "", "补水积分", "$AprusID-1", "L1_3_4754", "SET"],
                ["S38", "", "补水微分", "$AprusID-1", "L1_3_4755", "SET"],
                ["S39", "", "水位基准值", "$AprusID-1", "L1_3_4756", "SET"],
                ["S40", "", "水位校准比例", "$AprusID-1", "L1_3_4757", "SET"],
                ["H01", "", "燃烧器累记工作时间", "$AprusID-1", "L1_3_4759", "STA"],
                ["C01", "", "燃烧器启停次数", "$AprusID-1", "L1_3_4760", "STA"],
                ["S43", "", "1#泵累记工作时间", "$AprusID-1", "L1_3_4761", "STA"],
                ["S44", "", "2#泵累记工作时间", "$AprusID-1", "L1_3_4762", "STA"],
                ["S45", "", "蒸汽温度", "$AprusID-1", "L1_3_4763", "STA"],
                ["S46", "", "炉膛压力", "$AprusID-1", "L1_3_4764", "STA"],
                ["S47", "", "过热器进口烟温", "$AprusID-1", "L1_3_4782", "STA"],
                ["S48", "", "空气预热器出烟温度", "$AprusID-1", "L1_3_4795", "STA"],
                ["S49", "", "空气预热器进风温度", "$AprusID-1", "L1_3_4796", "STA"],
                ["S50", "", "空气预热器出风温度", "$AprusID-1", "L1_3_4797", "STA"],
                ["E01", "", "超高水位", "$AprusID-1", "L1_3_4801", "STA"],
                ["E02", "", "高水位", "$AprusID-1", "L1_3_4802", "STA"],
                ["E03", "", "低水位", "$AprusID-1", "L1_3_4803", "STA"],
                ["E04", "", "极低水位", "$AprusID-1", "L1_3_4804", "STA"]
            ],
            "template": [{
                "data": [
                    ["燃料类型", "天然气"],
                    ["锅炉重量", "2吨"],
                    ["出厂日期", "2018-03-03"]
                ],
                "title": "锅炉信息"
            }, {
                "data": [
                    ["热效率", 0.8],
                    ["燃料热值", 7000],
                    ["*吨汽燃料指标*", 0.21]
                ],
                "title": "能效指标信息"
            }],
            "reference": "",
            "created": "2020-11-05 19:27:27",
            "created_by": 1001,
            "last_modified": "2020-11-14 10:39:35",
            "last_modified_by": 1001,
            "is_available": 1
        }]
    }
}

7. 文件接口

7.1. 添加文件

请求地址:

属性
URL /api/v1/file/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
name string varchar(64) --- 名称
description string varchar(255) --- 描述
type string varchar(16) --- 类型:datasheet数据表/control控制点表/export项目导出/design设计图纸/video 图片视频/reference 参考资料/other 其他
file string json --- [{"name":"xxx.pdf","url":"datasheet/2020/10/xxx.pdf","uid":1568889445406}]
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "name": "file1",
    "description": "file number 1",
    "type": "datasheet数据表",
    "file": "[{\"name\":\"xxx.pdf\",\"url\":\"datasheet/2020/10/xxx.pdf\",\"uid\":1568889445406}]",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/file/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

7.2. 编辑文件

请求地址:

属性
URL /api/v1/file/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
name string varchar(64) --- 名称
description string varchar(255) --- 描述
type string varchar(16) --- 类型:datasheet数据表/control控制点表/export项目导出/design设计图纸/video 图片视频/reference 参考资料/other 其他
file string json --- [{"name":"xxx.pdf","url":"datasheet/2020/10/xxx.pdf","uid":1568889445406}]
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int tinyint(1) --- 是否有效:1是、0否

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1001,
    "name": "file1",
    "description": "file number 1",
    "type": "datasheet数据表",
    "file": "[{\"name\":\"xxx.pdf\",\"url\":\"datasheet/2020/10/xxx.pdf\",\"uid\":1568889445406}]",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' "https://xxx.mixiot.top/hapio/api/v1/file/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

7.3. 删除文件

请求地址:

属性
URL /api/v1/file/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1011
}' "https://xxx.mixiot.top/hapio/api/v1/file/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

7.4. 获取文件

请求地址:

属性
URL /api/v1/file/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/file/getItem?id=1001"

返回示例:

{
  "code": 200,
  "msg": "成功",
  "info": "",
  "result": {
    "id": 3,
    "name": "测试2",
    "description": "",
    "type": "control",
    "file": [
      {
        "name": "20201210174939.jpg",
        "uid": "0eb53fd12f910fda58fbaacf4d4a77bd5fd1ef35111e2",
        "url": "http://local.admin.com/storage\\file\\2020\\12\\10/20201210174939.jpg"
      }
    ],
    "reference": "",
    "created": "2020-12-10 15:53:06",
    "created_by": 1001,
    "last_modified": "2020-12-10 17:49:41",
    "last_modified_by": 1001,
    "is_available": 1
  }
}

7.5. 获取文件列表

请求地址:

属性
URL /api/v1/file/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/file/getList?page_index=1&page_size=10&where_and=[["name","LIKE","%25file1"],["id",">","1"]]&where_or=[["id","=","1"],["id",">","1"]]&where_in=["id","1001,1003"]"

返回示例:

{
  "code": 200,
  "msg": "成功",
  "info": "",
  "result": {
    "page_index": 0,
    "page_size": 2,
    "total_pages": 3,
    "total_records": 5,
    "data": [
      {
        "id": 1,
        "name": "test",
        "description": "",
        "type": "",
        "file": null,
        "reference": "",
        "created": "2020-11-25 11:04:53",
        "created_by": 0,
        "last_modified": "0001-01-01 00:00:00",
        "last_modified_by": 0,
        "is_available": 1
      },
      {
        "id": 3,
        "name": "测试2",
        "description": "",
        "type": "control",
        "file": [
          {
            "name": "20201210174939.jpg",
            "uid": "0eb53fd12f910fda58fbaacf4d4a77bd5fd1ef35111e2",
            "url": "http://local.admin.com/storage\\file\\2020\\12\\10/20201210174939.jpg"
          }
        ],
        "reference": "",
        "created": "2020-12-10 15:53:06",
        "created_by": 1001,
        "last_modified": "2020-12-10 17:49:41",
        "last_modified_by": 1001,
        "is_available": 1
      }
    ]
  }
}

8. 对象组接口

8.1. 添加对象组

请求地址:

属性
URL /api/v1/group/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
name string varchar(64) --- 名称
description string varchar(255) --- 描述
object_id int int(11) --- 对象表编号
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "name": "group1",
    "description": "group1",
    "object_id": 1001,
    "reference": "参考号1",
    "created_by": 1,
    "last_modified_by": 1
}' "https://xxx.mixiot.top/hapio/api/v1/group/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

8.2. 编辑对象组

请求地址:

属性
URL /api/v1/group/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
name string varchar(64) --- 名称
description string varchar(255) --- 描述
object_id int int(11) --- 对象表编号
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1,
    "name": "group2",
    "description": "group2",
    "object_id": 1001,
    "reference": "参考号1",
    "created_by": 1,
    "last_modified_by": 1
}' "https://xxx.mixiot.top/hapio/api/v1/group/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

8.3. 删除对象组

请求地址:

属性
URL /api/v1/group/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1
}' "https://xxx.mixiot.top/hapio/api/v1/group/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

8.4. 获取对象组

请求地址:

属性
URL /api/v1/group/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/group/getItem?id=1"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "id": 1,
        "name": "group2",
        "description": "group2",
        "object_id": 1001,
        "reference": "参考号1",
        "created": "2020-11-10 17:43:36",
        "created_by": 1,
        "last_modified": "2020-11-10 17:49:03",
        "last_modified_by": 1,
        "is_available": 1
    }
}

8.5. 获取对象组列表

请求地址:

属性
URL /api/v1/group/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/group/getList?page_index=1&page_size=10&where_and=[["name","LIKE","%25group1"],["id",">=","1"]]&where_or=[["id","=","1"],["id",">","1"]]&where_in=["id","1,3"]

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 1,
        "page_size": 10,
        "total_pages": 1,
        "total_records": 1,
        "data": [
            {
                "id": 3,
                "name": "group1",
                "description": "group1",
                "object_id": 1001,
                "reference": "参考号1",
                "created": "2020-11-10 17:50:10",
                "created_by": 1,
                "last_modified": "2020-11-10 17:50:10",
                "last_modified_by": 1,
                "is_available": 1
            }
        ]
    }
}

9. 对象组映射接口

9.1. 添加对象组映射

请求地址:

属性
URL /api/v1/group/addObject
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
group_id int int(11) --- 对象组表编号
object_id string "1001,1002,1003" 对象编号列表

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "group_id": 1,
    "object_id": "1001,1003,1004,1005"
}' "https://xxx.mixiot.top/hapio/api/v1/group/addObject"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

9.2. 编辑对象组映射

请求地址:

属性
URL /api/v1/group/editObject
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
group_id int int(11) --- 对象组编号
object_id int int(11) --- 对象编号
list_order int int(11) --- 排序序号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "group_id": 1,
    "object_id": 1001,
    "list_order": 99
}' "https://xxx.mixiot.top/hapio/api/v1/group/editObject"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

9.3. 删除对象组映射

请求地址:

属性
URL /api/v1/group/deleteObject
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
group_id int int(11) --- 对象组表编号
object_id string "1001,1002,1003" 对象编号列表

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "group_id": 1,
    "object_id": "1001,1003,1004"
}' "https://xxx.mixiot.top/hapio/api/v1/group/deleteObject"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

9.4. 获取对象组映射

请求地址:

属性
URL /api/v1/group/getObjectItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
group_id int int(11) --- 对象组编号
object_id int int(11) --- 对象编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/group/getObjectItem?group_id=1&object_id=1001"

返回示例:

{
  "code": 200,
  "msg": "成功",
  "info": "",
  "result": {
    "id": 1010,
    "name": "气站-001",
    "description": "",
    "image": "",
    "province": "广东省",
    "city": "",
    "file_id": 1,
    "mapping_id": 1003,
    "control_id": 1001,
    "terminal_list": "D20201109000001,D20201113000001",
    "model": "QZ001",
    "serial_no": "",
    "gis": "",
    "secret": "",
    "control": "",
    "addition": {},
    "template": {},
    "script": {},
    "reference": "",
    "created_by": 1001,
    "last_modified": "2020-12-09 14:10:53",
    "last_modified_by": 1001,
    "is_available": 1,
    "list_order": 1001,
    "created": "2020-11-28 10:50:37"
  }
}

9.5. 获取对象组列表映射

请求地址:

属性
URL /api/v1/group/getObjectList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
group_id int int(11) --- 对象组编号
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/group/getObjectList?group_id=1&page_index=1&page_size=10

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 0,
        "page_size": 2,
        "total_pages": 4,
        "total_records": 7,
        "data": [{
            "id": 1009,
            "name": "锅炉-332",
            "description": "",
            "image": "",
            "province": "",
            "city": "",
            "file_id": 1,
            "mapping_id": 1002,
            "control_id": 1002,
            "terminal_list": "demo",
            "model": "GL332",
            "serial_no": "",
            "gis": "123.456,123.456",
            "secret": "",
            "control": "",
            "addition": [{
                "data": [
                    ["燃料类型", "天然气"],
                    ["锅炉重量", "2吨"],
                    ["出厂日期", "2018-03-03"]
                ],
                "title": "锅炉信息"
            }, {
                "data": [
                    ["热效率", 0.8],
                    ["燃料热值", 7000],
                    ["*吨汽燃料指标*", 0.21]
                ],
                "title": "能效指标信息"
            }],
            "template": {},
            "script": {},
            "reference": "",
            "created_by": 1001,
            "last_modified": "2020-12-09 14:10:40",
            "last_modified_by": 1001,
            "is_available": 1,
            "list_order": 1,
            "created": "2020-11-14 09:21:31"
        }, {
            "id": 1008,
            "name": "test",
            "description": "",
            "image": "http://local.admin.com/storage\\object\\2020\\12\\07/20201207172057.jpg",
            "province": "",
            "city": "",
            "file_id": 1,
            "mapping_id": 1002,
            "control_id": 1001,
            "terminal_list": "demo",
            "model": "",
            "serial_no": "",
            "gis": "123.456,123.456",
            "secret": "",
            "control": "",
            "addition": [{
                "data": [
                    ["燃料类型", "天然气"],
                    ["锅炉重量", "1吨"],
                    ["出厂日期", "2018-03-03"]
                ],
                "title": "锅炉信息"
            }, {
                "data": [
                    ["热效率", 0.8],
                    ["燃料热值", "4000"],
                    ["*吨汽燃料指标*", 0.21]
                ],
                "title": "能效指标信息"
            }],
            "template": {},
            "script": {},
            "reference": "",
            "created_by": 1001,
            "last_modified": "2020-12-07 17:20:59",
            "last_modified_by": 1001,
            "is_available": 1,
            "list_order": 2,
            "created": "2020-11-13 15:31:56"
        }]
    }
}

10. 显示板接口

10.1. 添加显示板

请求地址:

属性
URL /api/v1/dashboardx/add
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
name string varchar(64) --- 名称
description string varchar(255) --- 描述
script string json --- 脚本
template string json --- 模板
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int int(11) --- 是否有效

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "name": "dashboardx1",
    "description": "dashboardx1",
    "is_available": 1,
    "script": "{\"id\":1}",
    "template": "{\"id\":1}",
    "reference": "参考号1",
    "created_by": 1,
    "last_modified_by": 1
}' "https://xxx.mixiot.top/hapio/api/v1/dashboardx/add"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

10.2. 编辑显示板

请求地址:

属性
URL /api/v1/dashboardx/edit
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号
name string varchar(64) --- 名称
description string varchar(255) --- 描述
script string json --- 脚本
template string json --- 模板
reference string varchar(64) --- 参考号
created_by int int(11) --- 创建人(用户编号)
last_modified_by int int(11) --- 最后修改人(用户编号)
is_available int int(11) --- 是否有效

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1,
    "name": "dashboardx1",
    "description": "dashboardx1",
    "is_available": 1,
    "script": "{\"id\":1}",
    "template": "{\"id\":1}",
    "reference": "参考号1",
    "created_by": 1,
    "last_modified_by": 1
}' "https://xxx.mixiot.top/hapio/api/v1/dashboardx/edit"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

10.3. 删除显示板

请求地址:

属性
URL /api/v1/dashboardx/delete
Method post
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X POST -d '{
    "id": 1
}' "https://xxx.mixiot.top/hapio/api/v1/dashboardx/delete"

返回示例:

{
    "code": 200,
    "msg": "成功"
}

10.4. 获取显示板

请求地址:

属性
URL /api/v1/dashboardx/getItem
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
id int int(11) --- 编号

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/dashboardx/getItem?id=1"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "id": 1002,
        "name": "test25",
        "description": "foo",
        "script": {
            "Dashboard-0": {
                "col": 20,
                "data": [{
                    "attribute": "crd_0",
                    "backgroundColor": "#D69999",
                    "fontColor": "#fff",
                    "itemData": [{
                        "id": "S04",
                        "name": "测试A类型",
                        "value": 0
                    }],
                    "name": "标题2",
                    "size1": "20px",
                    "size2": "32px",
                    "size3": "20px",
                    "theme": "dashboard",
                    "type": "crd",
                    "xys": {
                        "len": [4, 4],
                        "pos": [0, 0]
                    }
                }, {
                    "attribute": "vlu_1",
                    "itemData": [{
                        "backgroundColor": "#72C6A3",
                        "id": "S05",
                        "name": "测试B类型"
                    }],
                    "name": "标题3",
                    "nameSize": "20px",
                    "theme": "dashboard",
                    "timeSize": "16px",
                    "type": "vlu",
                    "valueSize": "40px",
                    "xys": {
                        "len": [4, 4],
                        "pos": [0, 4]
                    }
                }, {
                    "attribute": "lin_1",
                    "from": ["S07"],
                    "legendData": ["测试"],
                    "lineColor": ["#D01515"],
                    "markLineData": ["null"],
                    "name": "测试曲线",
                    "series": [{
                        "data": [],
                        "from": "S07",
                        "itemStyle": {
                            "color": "#D01515"
                        },
                        "lineStyle": {
                            "color": "#D01515"
                        },
                        "markLine": [],
                        "name": "测试",
                        "type": "line"
                    }],
                    "theme": "dashboard",
                    "type": "lin",
                    "xAxis": [],
                    "xys": {
                        "len": [4, 7],
                        "pos": [0, 8]
                    }
                }, {
                    "attribute": "gag_1",
                    "data": {
                        "color": [
                            ["100", "#67c23a"],
                            ["180", "#C2BB3A"],
                            ["200", "#C2513A"]
                        ],
                        "max": 200,
                        "min": 0,
                        "name": "测试",
                        "steps": 5,
                        "value": 0
                    },
                    "from": "S08",
                    "name": "测试仪表",
                    "theme": "dashboard",
                    "type": "gag",
                    "xys": {
                        "len": [4, 5],
                        "pos": [0, 15]
                    }
                }, {
                    "attribute": "pie_4",
                    "from": ["S11", "S12", "S13", "S14"],
                    "legendData": ["音乐", "游戏", "视频", "浏览网页"],
                    "name": "手机用时",
                    "series": [{
                        "data": [{
                            "from": "S11",
                            "name": "音乐",
                            "value": 0
                        }, {
                            "from": "S12",
                            "name": "游戏",
                            "value": 0
                        }, {
                            "from": "S13",
                            "name": "视频",
                            "value": 0
                        }, {
                            "from": "S14",
                            "name": "浏览网页",
                            "value": 0
                        }]
                    }],
                    "theme": "dashboard",
                    "type": "pie",
                    "xys": {
                        "len": [5, 6],
                        "pos": [4, 0]
                    }
                }, {
                    "attribute": "rad_5",
                    "from": ["S15", "S16", "S17"],
                    "indicator": [{
                        "from": "S15",
                        "max": 800,
                        "name": "华为"
                    }, {
                        "from": "S14",
                        "max": 400,
                        "name": "小米"
                    }, {
                        "from": "S11",
                        "max": 100,
                        "name": "魅族"
                    }],
                    "legendData": ["雷达图"],
                    "name": "雷达图",
                    "seriesData": [{
                        "name": "雷达图",
                        "value": []
                    }],
                    "theme": "dashboard",
                    "type": "rad",
                    "xys": {
                        "len": [5, 7],
                        "pos": [4, 6]
                    }
                }, {
                    "attribute": "bar_6",
                    "from": ["S20", "S28"],
                    "legendData": ["发电量", "用电量"],
                    "name": "柱状图测试",
                    "series": [{
                        "color": "#CB0E0E",
                        "from": "S20",
                        "name": "发电量"
                    }, {
                        "color": "#137345",
                        "from": "S28",
                        "name": "用电量"
                    }],
                    "theme": "dashboard",
                    "type": "bar",
                    "xAxis": [],
                    "xys": {
                        "len": [5, 7],
                        "pos": [4, 13]
                    }
                }],
                "dataType": "images",
                "name": "新增页面",
                "row": 9,
                "screenHeight": 0,
                "screenWidth": 0,
                "tag": "page_1",
                "webSocket": {
                    "objectId": 1004,
                    "projectId": 4,
                    "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                }
            },
            "Dashboard-1": {
                "col": 20,
                "data": [{
                    "attribute": "dzc_7",
                    "from": ["S20"],
                    "legendData": ["数据"],
                    "name": "大数据缩放图",
                    "series": [{
                        "downColor": "#C21C11",
                        "from": "S20",
                        "name": "数据",
                        "type": "line",
                        "upColor": "#EBEA90"
                    }],
                    "theme": "dashboard",
                    "type": "dzc",
                    "xAxis": [],
                    "xys": {
                        "len": [5, 8],
                        "pos": [0, 0]
                    }
                }, {
                    "attribute": "aqi_7",
                    "from": ["S07"],
                    "legendData": ["指数"],
                    "name": "指数测试",
                    "pieceArr": [{
                        "yAxis": "80"
                    }, {
                        "yAxis": "100"
                    }, {
                        "yAxis": "120"
                    }],
                    "pieces": [{
                        "color": "#A7AE1A",
                        "gt": 0,
                        "lte": 80
                    }, {
                        "color": "#0095FF",
                        "gt": 80,
                        "lte": 100
                    }, {
                        "color": "#B70808",
                        "gt": 100
                    }],
                    "series": [{
                        "data": [],
                        "from": "S07",
                        "name": "指数",
                        "type": "line"
                    }],
                    "theme": "dashboard",
                    "type": "aqi",
                    "xAxis": [],
                    "xys": {
                        "len": [5, 7],
                        "pos": [0, 8]
                    }
                }, {
                    "attribute": "mxa_8",
                    "from": ["S08", "S09"],
                    "legendData": ["音乐", "电影"],
                    "name": "双X轴曲线",
                    "series": [{
                        "color": "#EA2222",
                        "from": "S08",
                        "name": "音乐",
                        "type": "line"
                    }, {
                        "color": "#0F8562",
                        "from": "S09",
                        "name": "电影",
                        "type": "line"
                    }],
                    "theme": "dashboard",
                    "type": "mxa",
                    "xAxis": [],
                    "xys": {
                        "len": [5, 8],
                        "pos": [5, 0]
                    }
                }, {
                    "attribute": "scd_9",
                    "background": "20200917173720.png",
                    "height": 200,
                    "itemData": [{
                        "id": "S05",
                        "name": "组态图一",
                        "position": {
                            "left": "0%",
                            "position": "absolute",
                            "top": "0.5%"
                        },
                        "type": "Plate",
                        "value": 0
                    }, {
                        "ULG_max": 200,
                        "ULG_min": 0,
                        "ULG_width": "14px",
                        "id": "S08",
                        "name": "组态图二",
                        "position": {
                            "left": "69.89247311827957%",
                            "position": "absolute",
                            "top": "1%"
                        },
                        "showScale": true,
                        "start_value": 0,
                        "step": 5,
                        "type": "ULG",
                        "value": 0
                    }, {
                        "id": "H01",
                        "name": "组态图三",
                        "off": "1",
                        "on": "0",
                        "position": {
                            "left": "31.899641577060933%",
                            "position": "absolute",
                            "top": "1.5%"
                        },
                        "type": "Signal",
                        "value": "1"
                    }, {
                        "flag": [{
                            "code": "1",
                            "color": "#dd0033",
                            "text": "离线"
                        }, {
                            "code": "0",
                            "color": "#0048FF",
                            "text": "在线"
                        }],
                        "id": "C01",
                        "name": "组态图四",
                        "position": {
                            "left": "0%",
                            "position": "absolute",
                            "top": "28.609374999999996%"
                        },
                        "type": "Status",
                        "value": 0
                    }, {
                        "color": "#C50D0D",
                        "id": "S09",
                        "position": {
                            "left": "0.7168458781362007%",
                            "position": "absolute",
                            "top": "63%"
                        },
                        "type": "Digit",
                        "value": 0
                    }],
                    "name": "组态图",
                    "style": {
                        "inner": {
                            "background-size": "100%100%",
                            "height": "100%",
                            "width": "90%"
                        },
                        "outer": {
                            "height": "94%",
                            "left": "10%",
                            "top": "6%",
                            "width": "90%"
                        }
                    },
                    "theme": "dashboard",
                    "type": "scd",
                    "xys": {
                        "len": [5, 7],
                        "pos": [5, 8]
                    }
                }, {
                    "attribute": "ddc_7",
                    "from": ["S09"],
                    "legendData": ["用电量"],
                    "name": "区段分布",
                    "series": [{
                        "data": [],
                        "from": "S09",
                        "insideColor": "#5F7BB8",
                        "name": "用电量",
                        "outsideColor": "#002FFF",
                        "peakData": [{
                            "endNum": "3",
                            "peakName": "用电高峰",
                            "startNum": "2"
                        }, {
                            "endNum": "8",
                            "peakName": "用水高峰",
                            "startNum": "7"
                        }],
                        "shadowColor": "#BFBABA",
                        "type": "line"
                    }],
                    "theme": "dashboard",
                    "type": "ddc",
                    "xAxis": [],
                    "xys": {
                        "len": [5, 5],
                        "pos": [0, 15]
                    }
                }],
                "dataType": "images",
                "name": "新增页面",
                "row": 12,
                "screenHeight": 0,
                "screenWidth": 0,
                "tag": "page_2",
                "webSocket": {
                    "objectId": 1004,
                    "projectId": 4,
                    "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                }
            }
        },
        "template": {},
        "reference": "test",
        "created": "2020-11-30 14:45:01",
        "created_by": 1001,
        "last_modified": "2020-12-12 15:36:04",
        "last_modified_by": 1001,
        "is_available": 1
    }
}

10.5. 获取显示板列表

请求地址:

属性
URL /api/v1/dashboardx/getList
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
page_index int --- 1 查询页码(默认1)
page_size int --- 20 每页记录数(默认20)
where_and string --- [["id","=","1"],["name","like","%test%"]] AND查询条件
where_or string --- [["id","=","1"],["name","like","%test%"]] OR查询条件
where_in string --- ["object_id","1001,1002"] IN查询条件
order_by string --- ["object_id","desc"] 排序

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果
+ page_index --- int 页索引
+ page_size --- int 页条数
+ total_pages --- int 总页数
+ total_records --- int 总条数
+ data --- array 返回数据列表

请求示例

curl -H "Content-Type: application/json" -X GET "https://xxx.mixiot.top/hapio/api/v1/dashboardx/getList?page_index=1&page_size=10&where_and=[["name","LIKE","%25group1"],["id",">=","1"]]&where_or=[["id","=","1"],["id",">","1"]]&where_in=["id","1,3"]

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "page_index": 0,
        "page_size": 2,
        "total_pages": 2,
        "total_records": 4,
        "data": [{
            "id": 1002,
            "name": "test25",
            "description": "foo",
            "script": {
                "Dashboard-0": {
                    "col": 20,
                    "data": [{
                        "attribute": "crd_0",
                        "backgroundColor": "#D69999",
                        "fontColor": "#fff",
                        "itemData": [{
                            "id": "S04",
                            "name": "测试A类型",
                            "value": 0
                        }],
                        "name": "标题2",
                        "size1": "20px",
                        "size2": "32px",
                        "size3": "20px",
                        "theme": "dashboard",
                        "type": "crd",
                        "xys": {
                            "len": [4, 4],
                            "pos": [0, 0]
                        }
                    }, {
                        "attribute": "vlu_1",
                        "itemData": [{
                            "backgroundColor": "#72C6A3",
                            "id": "S05",
                            "name": "测试B类型"
                        }],
                        "name": "标题3",
                        "nameSize": "20px",
                        "theme": "dashboard",
                        "timeSize": "16px",
                        "type": "vlu",
                        "valueSize": "40px",
                        "xys": {
                            "len": [4, 4],
                            "pos": [0, 4]
                        }
                    }, {
                        "attribute": "lin_1",
                        "from": ["S07"],
                        "legendData": ["测试"],
                        "lineColor": ["#D01515"],
                        "markLineData": ["null"],
                        "name": "测试曲线",
                        "series": [{
                            "data": [],
                            "from": "S07",
                            "itemStyle": {
                                "color": "#D01515"
                            },
                            "lineStyle": {
                                "color": "#D01515"
                            },
                            "markLine": [],
                            "name": "测试",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "lin",
                        "xAxis": [],
                        "xys": {
                            "len": [4, 7],
                            "pos": [0, 8]
                        }
                    }, {
                        "attribute": "gag_1",
                        "data": {
                            "color": [
                                ["100", "#67c23a"],
                                ["180", "#C2BB3A"],
                                ["200", "#C2513A"]
                            ],
                            "max": 200,
                            "min": 0,
                            "name": "测试",
                            "steps": 5,
                            "value": 0
                        },
                        "from": "S08",
                        "name": "测试仪表",
                        "theme": "dashboard",
                        "type": "gag",
                        "xys": {
                            "len": [4, 5],
                            "pos": [0, 15]
                        }
                    }, {
                        "attribute": "pie_4",
                        "from": ["S11", "S12", "S13", "S14"],
                        "legendData": ["音乐", "游戏", "视频", "浏览网页"],
                        "name": "手机用时",
                        "series": [{
                            "data": [{
                                "from": "S11",
                                "name": "音乐",
                                "value": 0
                            }, {
                                "from": "S12",
                                "name": "游戏",
                                "value": 0
                            }, {
                                "from": "S13",
                                "name": "视频",
                                "value": 0
                            }, {
                                "from": "S14",
                                "name": "浏览网页",
                                "value": 0
                            }]
                        }],
                        "theme": "dashboard",
                        "type": "pie",
                        "xys": {
                            "len": [5, 6],
                            "pos": [4, 0]
                        }
                    }, {
                        "attribute": "rad_5",
                        "from": ["S15", "S16", "S17"],
                        "indicator": [{
                            "from": "S15",
                            "max": 800,
                            "name": "华为"
                        }, {
                            "from": "S14",
                            "max": 400,
                            "name": "小米"
                        }, {
                            "from": "S11",
                            "max": 100,
                            "name": "魅族"
                        }],
                        "legendData": ["雷达图"],
                        "name": "雷达图",
                        "seriesData": [{
                            "name": "雷达图",
                            "value": []
                        }],
                        "theme": "dashboard",
                        "type": "rad",
                        "xys": {
                            "len": [5, 7],
                            "pos": [4, 6]
                        }
                    }, {
                        "attribute": "bar_6",
                        "from": ["S20", "S28"],
                        "legendData": ["发电量", "用电量"],
                        "name": "柱状图测试",
                        "series": [{
                            "color": "#CB0E0E",
                            "from": "S20",
                            "name": "发电量"
                        }, {
                            "color": "#137345",
                            "from": "S28",
                            "name": "用电量"
                        }],
                        "theme": "dashboard",
                        "type": "bar",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 7],
                            "pos": [4, 13]
                        }
                    }],
                    "dataType": "images",
                    "name": "新增页面",
                    "row": 9,
                    "screenHeight": 0,
                    "screenWidth": 0,
                    "tag": "page_1",
                    "webSocket": {
                        "objectId": 1004,
                        "projectId": 4,
                        "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                    }
                },
                "Dashboard-1": {
                    "col": 20,
                    "data": [{
                        "attribute": "dzc_7",
                        "from": ["S20"],
                        "legendData": ["数据"],
                        "name": "大数据缩放图",
                        "series": [{
                            "downColor": "#C21C11",
                            "from": "S20",
                            "name": "数据",
                            "type": "line",
                            "upColor": "#EBEA90"
                        }],
                        "theme": "dashboard",
                        "type": "dzc",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 8],
                            "pos": [0, 0]
                        }
                    }, {
                        "attribute": "aqi_7",
                        "from": ["S07"],
                        "legendData": ["指数"],
                        "name": "指数测试",
                        "pieceArr": [{
                            "yAxis": "80"
                        }, {
                            "yAxis": "100"
                        }, {
                            "yAxis": "120"
                        }],
                        "pieces": [{
                            "color": "#A7AE1A",
                            "gt": 0,
                            "lte": 80
                        }, {
                            "color": "#0095FF",
                            "gt": 80,
                            "lte": 100
                        }, {
                            "color": "#B70808",
                            "gt": 100
                        }],
                        "series": [{
                            "data": [],
                            "from": "S07",
                            "name": "指数",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "aqi",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 7],
                            "pos": [0, 8]
                        }
                    }, {
                        "attribute": "mxa_8",
                        "from": ["S08", "S09"],
                        "legendData": ["音乐", "电影"],
                        "name": "双X轴曲线",
                        "series": [{
                            "color": "#EA2222",
                            "from": "S08",
                            "name": "音乐",
                            "type": "line"
                        }, {
                            "color": "#0F8562",
                            "from": "S09",
                            "name": "电影",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "mxa",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 8],
                            "pos": [5, 0]
                        }
                    }, {
                        "attribute": "scd_9",
                        "background": "20200917173720.png",
                        "height": 200,
                        "itemData": [{
                            "id": "S05",
                            "name": "组态图一",
                            "position": {
                                "left": "0%",
                                "position": "absolute",
                                "top": "0.5%"
                            },
                            "type": "Plate",
                            "value": 0
                        }, {
                            "ULG_max": 200,
                            "ULG_min": 0,
                            "ULG_width": "14px",
                            "id": "S08",
                            "name": "组态图二",
                            "position": {
                                "left": "69.89247311827957%",
                                "position": "absolute",
                                "top": "1%"
                            },
                            "showScale": true,
                            "start_value": 0,
                            "step": 5,
                            "type": "ULG",
                            "value": 0
                        }, {
                            "id": "H01",
                            "name": "组态图三",
                            "off": "1",
                            "on": "0",
                            "position": {
                                "left": "31.899641577060933%",
                                "position": "absolute",
                                "top": "1.5%"
                            },
                            "type": "Signal",
                            "value": "1"
                        }, {
                            "flag": [{
                                "code": "1",
                                "color": "#dd0033",
                                "text": "离线"
                            }, {
                                "code": "0",
                                "color": "#0048FF",
                                "text": "在线"
                            }],
                            "id": "C01",
                            "name": "组态图四",
                            "position": {
                                "left": "0%",
                                "position": "absolute",
                                "top": "28.609374999999996%"
                            },
                            "type": "Status",
                            "value": 0
                        }, {
                            "color": "#C50D0D",
                            "id": "S09",
                            "position": {
                                "left": "0.7168458781362007%",
                                "position": "absolute",
                                "top": "63%"
                            },
                            "type": "Digit",
                            "value": 0
                        }],
                        "name": "组态图",
                        "style": {
                            "inner": {
                                "background-size": "100%100%",
                                "height": "100%",
                                "width": "90%"
                            },
                            "outer": {
                                "height": "94%",
                                "left": "10%",
                                "top": "6%",
                                "width": "90%"
                            }
                        },
                        "theme": "dashboard",
                        "type": "scd",
                        "xys": {
                            "len": [5, 7],
                            "pos": [5, 8]
                        }
                    }, {
                        "attribute": "ddc_7",
                        "from": ["S09"],
                        "legendData": ["用电量"],
                        "name": "区段分布",
                        "series": [{
                            "data": [],
                            "from": "S09",
                            "insideColor": "#5F7BB8",
                            "name": "用电量",
                            "outsideColor": "#002FFF",
                            "peakData": [{
                                "endNum": "3",
                                "peakName": "用电高峰",
                                "startNum": "2"
                            }, {
                                "endNum": "8",
                                "peakName": "用水高峰",
                                "startNum": "7"
                            }],
                            "shadowColor": "#BFBABA",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "ddc",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 5],
                            "pos": [0, 15]
                        }
                    }],
                    "dataType": "images",
                    "name": "新增页面",
                    "row": 12,
                    "screenHeight": 0,
                    "screenWidth": 0,
                    "tag": "page_2",
                    "webSocket": {
                        "objectId": 1004,
                        "projectId": 4,
                        "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                    }
                }
            },
            "template": {},
            "reference": "test",
            "created": "2020-11-30 14:45:01",
            "created_by": 1001,
            "last_modified": "2020-12-12 15:36:04",
            "last_modified_by": 1001,
            "is_available": 1
        }, {
            "id": 1003,
            "name": "test26",
            "description": "foo",
            "script": {
                "Dashboard-0": {
                    "col": 20,
                    "data": [{
                        "attribute": "crd_0",
                        "backgroundColor": "#D69999",
                        "fontColor": "#fff",
                        "itemData": [{
                            "id": "S04",
                            "name": "测试A类型",
                            "value": 0
                        }],
                        "name": "标题2",
                        "size1": "20px",
                        "size2": "32px",
                        "size3": "20px",
                        "theme": "dashboard",
                        "type": "crd",
                        "xys": {
                            "len": [4, 4],
                            "pos": [0, 0]
                        }
                    }, {
                        "attribute": "vlu_1",
                        "itemData": [{
                            "backgroundColor": "#72C6A3",
                            "id": "S05",
                            "name": "测试B类型"
                        }],
                        "name": "标题3",
                        "nameSize": "20px",
                        "theme": "dashboard",
                        "timeSize": "16px",
                        "type": "vlu",
                        "valueSize": "40px",
                        "xys": {
                            "len": [4, 4],
                            "pos": [0, 4]
                        }
                    }, {
                        "attribute": "lin_1",
                        "from": ["S07"],
                        "legendData": ["测试"],
                        "lineColor": ["#D01515"],
                        "markLineData": ["null"],
                        "name": "测试曲线",
                        "series": [{
                            "data": [],
                            "from": "S07",
                            "itemStyle": {
                                "color": "#D01515"
                            },
                            "lineStyle": {
                                "color": "#D01515"
                            },
                            "markLine": [],
                            "name": "测试",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "lin",
                        "xAxis": [],
                        "xys": {
                            "len": [4, 7],
                            "pos": [0, 8]
                        }
                    }, {
                        "attribute": "gag_1",
                        "data": {
                            "color": [
                                ["100", "#67c23a"],
                                ["180", "#C2BB3A"],
                                ["200", "#C2513A"]
                            ],
                            "max": 200,
                            "min": 0,
                            "name": "测试",
                            "steps": 5,
                            "value": 0
                        },
                        "from": "S08",
                        "name": "测试仪表",
                        "theme": "dashboard",
                        "type": "gag",
                        "xys": {
                            "len": [4, 5],
                            "pos": [0, 15]
                        }
                    }, {
                        "attribute": "pie_4",
                        "from": ["S11", "S12", "S13", "S14"],
                        "legendData": ["音乐", "游戏", "视频", "浏览网页"],
                        "name": "手机用时",
                        "series": [{
                            "data": [{
                                "from": "S11",
                                "name": "音乐",
                                "value": 0
                            }, {
                                "from": "S12",
                                "name": "游戏",
                                "value": 0
                            }, {
                                "from": "S13",
                                "name": "视频",
                                "value": 0
                            }, {
                                "from": "S14",
                                "name": "浏览网页",
                                "value": 0
                            }]
                        }],
                        "theme": "dashboard",
                        "type": "pie",
                        "xys": {
                            "len": [5, 6],
                            "pos": [4, 0]
                        }
                    }, {
                        "attribute": "rad_5",
                        "from": ["S15", "S16", "S17"],
                        "indicator": [{
                            "from": "S15",
                            "max": 800,
                            "name": "华为"
                        }, {
                            "from": "S14",
                            "max": 400,
                            "name": "小米"
                        }, {
                            "from": "S11",
                            "max": 100,
                            "name": "魅族"
                        }],
                        "legendData": ["雷达图"],
                        "name": "雷达图",
                        "seriesData": [{
                            "name": "雷达图",
                            "value": []
                        }],
                        "theme": "dashboard",
                        "type": "rad",
                        "xys": {
                            "len": [5, 7],
                            "pos": [4, 6]
                        }
                    }, {
                        "attribute": "bar_6",
                        "from": ["S20", "S28"],
                        "legendData": ["发电量", "用电量"],
                        "name": "柱状图测试",
                        "series": [{
                            "color": "#CB0E0E",
                            "from": "S20",
                            "name": "发电量"
                        }, {
                            "color": "#137345",
                            "from": "S28",
                            "name": "用电量"
                        }],
                        "theme": "dashboard",
                        "type": "bar",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 7],
                            "pos": [4, 13]
                        }
                    }],
                    "dataType": "images",
                    "name": "新增页面",
                    "row": 9,
                    "screenHeight": 0,
                    "screenWidth": 0,
                    "tag": "page_1",
                    "webSocket": {
                        "objectId": 1004,
                        "projectId": 4,
                        "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                    }
                },
                "Dashboard-1": {
                    "col": 20,
                    "data": [{
                        "attribute": "dzc_7",
                        "from": ["S20"],
                        "legendData": ["数据"],
                        "name": "大数据缩放图",
                        "series": [{
                            "downColor": "#C21C11",
                            "from": "S20",
                            "name": "数据",
                            "type": "line",
                            "upColor": "#EBEA90"
                        }],
                        "theme": "dashboard",
                        "type": "dzc",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 8],
                            "pos": [0, 0]
                        }
                    }, {
                        "attribute": "aqi_7",
                        "from": ["S07"],
                        "legendData": ["指数"],
                        "name": "指数测试",
                        "pieceArr": [{
                            "yAxis": "80"
                        }, {
                            "yAxis": "100"
                        }, {
                            "yAxis": "120"
                        }],
                        "pieces": [{
                            "color": "#A7AE1A",
                            "gt": 0,
                            "lte": 80
                        }, {
                            "color": "#0095FF",
                            "gt": 80,
                            "lte": 100
                        }, {
                            "color": "#B70808",
                            "gt": 100
                        }],
                        "series": [{
                            "data": [],
                            "from": "S07",
                            "name": "指数",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "aqi",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 7],
                            "pos": [0, 8]
                        }
                    }, {
                        "attribute": "mxa_8",
                        "from": ["S08", "S09"],
                        "legendData": ["音乐", "电影"],
                        "name": "双X轴曲线",
                        "series": [{
                            "color": "#EA2222",
                            "from": "S08",
                            "name": "音乐",
                            "type": "line"
                        }, {
                            "color": "#0F8562",
                            "from": "S09",
                            "name": "电影",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "mxa",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 8],
                            "pos": [5, 0]
                        }
                    }, {
                        "attribute": "scd_9",
                        "background": "20200917173720.png",
                        "height": 200,
                        "itemData": [{
                            "id": "S05",
                            "name": "组态图一",
                            "position": {
                                "left": "0%",
                                "position": "absolute",
                                "top": "0.5%"
                            },
                            "type": "Plate",
                            "value": 0
                        }, {
                            "ULG_max": 200,
                            "ULG_min": 0,
                            "ULG_width": "14px",
                            "id": "S08",
                            "name": "组态图二",
                            "position": {
                                "left": "69.89247311827957%",
                                "position": "absolute",
                                "top": "1%"
                            },
                            "showScale": true,
                            "start_value": 0,
                            "step": 5,
                            "type": "ULG",
                            "value": 0
                        }, {
                            "id": "H01",
                            "name": "组态图三",
                            "off": "1",
                            "on": "0",
                            "position": {
                                "left": "31.899641577060933%",
                                "position": "absolute",
                                "top": "1.5%"
                            },
                            "type": "Signal",
                            "value": "1"
                        }, {
                            "flag": [{
                                "code": "1",
                                "color": "#dd0033",
                                "text": "离线"
                            }, {
                                "code": "0",
                                "color": "#0048FF",
                                "text": "在线"
                            }],
                            "id": "C01",
                            "name": "组态图四",
                            "position": {
                                "left": "0%",
                                "position": "absolute",
                                "top": "28.609374999999996%"
                            },
                            "type": "Status",
                            "value": 0
                        }, {
                            "color": "#C50D0D",
                            "id": "S09",
                            "position": {
                                "left": "0.7168458781362007%",
                                "position": "absolute",
                                "top": "63%"
                            },
                            "type": "Digit",
                            "value": 0
                        }],
                        "name": "组态图",
                        "style": {
                            "inner": {
                                "background-size": "100%100%",
                                "height": "100%",
                                "width": "90%"
                            },
                            "outer": {
                                "height": "94%",
                                "left": "10%",
                                "top": "6%",
                                "width": "90%"
                            }
                        },
                        "theme": "dashboard",
                        "type": "scd",
                        "xys": {
                            "len": [5, 7],
                            "pos": [5, 8]
                        }
                    }, {
                        "attribute": "ddc_7",
                        "from": ["S09"],
                        "legendData": ["用电量"],
                        "name": "区段分布",
                        "series": [{
                            "data": [],
                            "from": "S09",
                            "insideColor": "#5F7BB8",
                            "name": "用电量",
                            "outsideColor": "#002FFF",
                            "peakData": [{
                                "endNum": "3",
                                "peakName": "用电高峰",
                                "startNum": "2"
                            }, {
                                "endNum": "8",
                                "peakName": "用水高峰",
                                "startNum": "7"
                            }],
                            "shadowColor": "#BFBABA",
                            "type": "line"
                        }],
                        "theme": "dashboard",
                        "type": "ddc",
                        "xAxis": [],
                        "xys": {
                            "len": [5, 5],
                            "pos": [0, 15]
                        }
                    }],
                    "dataType": "images",
                    "name": "新增页面",
                    "row": 12,
                    "screenHeight": 0,
                    "screenWidth": 0,
                    "tag": "page_2",
                    "webSocket": {
                        "objectId": 1004,
                        "projectId": 4,
                        "url": "ws://192.168.88.215/dashbos/api/v1/subscribe"
                    }
                }
            },
            "template": {
                "foo": "this is json"
            },
            "reference": "test",
            "created": "2020-11-30 14:59:08",
            "created_by": 1001,
            "last_modified": "2020-12-12 15:36:22",
            "last_modified_by": 1001,
            "is_available": 1
        }]
    }
}

11. 数据统计接口

11.1. 对象数量统计

请求地址:

属性
URL /api/v1/statistics/objectQuantity
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
where_in string --- --- IN查询条件

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET -g "https://xxx.mixiot.top/hapio/api/v1/statistics/objectQuantity?where_in=["object_id","1,3"]"

返回示例:

{
  "code": 200,
  "msg": "成功",
  "info": "",
  "result": {
    "abnormal": 0,
    "boot": 0,
    "down": 1,
    "normal": 0,
    "offline": 1,
    "online": 1,
    "total": 2
  }
}

11.2. 对象地区分布统计

请求地址:

属性
URL /api/v1/statistics/objectDistribution
Method get
Content-Type application/json

请求参数:

参数名称 是否必选 数据类型 数据约束 示例数据 描述
where_in string --- --- IN查询条件

响应参数:

参数名称 是否必选 数据类型 描述
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

curl -H "Content-Type: application/json" -X GET -g "https://xxx.mixiot.top/hapio/api/v1/statistics/objectDistribution?where_in=["id","1,3"]"

返回示例:

{
    "code": 200,
    "msg": "成功",
    "info": "",
    "result": {
        "central_china": 0,
        "east_china": 0,
        "north_china": 0,
        "northeast": 0,
        "northwest": 0,
        "south_china": 2,
        "southwest": 0,
        "unknown": 11
    }
}
© Mixlinker all right reserved,powered by Gitbook文件修订时间: 2021-03-05 16:09:24

results matching ""

    No results matching ""