ThingsPanel MCP
Official
by ThingsPanel
{
"openapi": "3.0.1",
"info": {
"title": "ThingsPanel-1.0.0",
"description": "",
"version": "1.0.0"
},
"tags": [
{
"name": "个人信息管理"
},
{
"name": "看板"
},
{
"name": "设备管理"
},
{
"name": "遥测数据"
},
{
"name": "属性数据"
},
{
"name": "命令下发"
}
],
"paths": {
"/api/v1/user/detail": {
"get": {
"summary": "个人信息查看接口",
"deprecated": true,
"description": "该接口用于查看个人信息。",
"tags": [
"个人信息管理"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
},
"headers": {},
"x-apifox-name": "查看个人信息成功"
}
},
"security": [],
"x-apifox-folder": "个人信息管理",
"x-apifox-status": "deprecated",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-142798248-run"
}
},
"/api/v1/user/tenant/id": {
"get": {
"summary": "获取租户ID",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "string"
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"description": "",
"value": {
"code": 200,
"message": "操作成功",
"data": "63a4b529"
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "个人信息管理",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-270081060-run"
}
},
"/api/v1/board/tenant": {
"get": {
"summary": "租户信息",
"deprecated": false,
"description": "租户总数&昨日新增&本月新增&月历史数据",
"tags": [
"看板"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetTenantRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get message successfully!",
"data": {
"user_total": 16,
"user_added_yesterday": 0,
"user_added_month": 1,
"user_list_month": [
{
"mon": 2,
"num": 13
},
{
"mon": 3,
"num": 1
}
]
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "获取信息成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176494-run"
}
},
"/api/v1/board/tenant/device/info": {
"get": {
"summary": "租户下设备信息",
"deprecated": false,
"description": "租户下设备总数&on",
"tags": [
"看板"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetBoardDeviceRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get board list successfully",
"data": {
"device_total": 34,
"device_on": 0,
"device_activity": 3
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "请求成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176495-run"
}
},
"/api/v1/board/tenant/device/activity/info": {
"get": {
"summary": "租户下设备活跃信息",
"deprecated": true,
"description": "",
"tags": [
"看板"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "id"
},
"device_nums": {
"type": "integer",
"description": "设备总数"
},
"device_on": {
"type": "integer",
"description": "设备在线数"
},
"created_at": {
"type": "string",
"description": "创建时间"
},
"tenant_id": {
"type": "string",
"description": "租户id"
}
},
"required": [
"id",
"device_nums",
"device_on",
"created_at",
"tenant_id"
],
"x-apifox-orders": [
"id",
"device_nums",
"device_on",
"created_at",
"tenant_id"
],
"x-apifox-ignore-properties": []
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
}
}
},
"headers": {},
"x-apifox-name": "请求成功"
},
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetBoardDeviceRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
}
}
},
"headers": {},
"x-apifox-name": "无效的请求数据"
},
"500": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetBoardDeviceRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
}
}
},
"headers": {},
"x-apifox-name": "服务器内部错误"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "deprecated",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-159343567-run"
}
},
"/api/v1/telemetry/datas/msg/count": {
"get": {
"summary": "获取租户大致消息数量",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"msg": {
"type": "integer"
}
},
"required": [
"msg"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"msg"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-180626231-run"
}
},
"/api/v1/board/trend": {
"get": {
"summary": "租户下设备在线离线趋势查询",
"deprecated": false,
"description": "租户下已激活设备的24小时在线离线趋势统计",
"tags": [],
"parameters": [
{
"name": "tenant_id",
"in": "query",
"description": "",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"points": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "string"
},
"device_total": {
"type": "integer"
},
"device_online": {
"type": "integer"
},
"device_offline": {
"type": "integer"
}
},
"required": [
"timestamp",
"device_total",
"device_online",
"device_offline"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"timestamp",
"device_total",
"device_online",
"device_offline"
]
}
}
},
"required": [
"points"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"points"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "操作成功",
"data": {
"points": [
{
"timestamp": "2025-02-23T11:00:00.003440717+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T12:00:00.004090059+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T13:00:00.00383393+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T14:00:00.00402364+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T15:00:00.004769211+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T16:00:00.004735571+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T17:00:00.004906737+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T18:00:00.005569004+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T19:00:00.007165295+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T20:00:00.004783272+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T21:00:00.011679245+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T22:00:00.004242989+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T23:00:00.005443453+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T00:00:00.006367481+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T01:00:00.004047403+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T02:00:00.004629344+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T03:00:00.003309673+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T04:00:00.004381009+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T05:00:00.005423937+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T06:00:00.004845785+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T07:00:00.003825451+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T08:00:00.004257565+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T09:00:00.003826976+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T10:00:00.003894123+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
}
]
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-262109784-run"
}
},
"/api/v1/device/detail/{id}": {
"get": {
"summary": "设备详情✅",
"deprecated": false,
"description": "设备详情",
"tags": [
"设备管理"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "设备ID",
"required": true,
"example": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"voucher": {
"type": "string",
"title": "凭证"
},
"tenant_id": {
"type": "string"
},
"is_enabled": {
"type": "string",
"title": "启用/禁用",
"description": "enabled-启用 disabled-禁用 默认禁用,激活后默认启用"
},
"activate_flag": {
"type": "string",
"title": "激活标志",
"description": "inactive-未激活 active-已激活"
},
"created_at": {
"type": "string"
},
"update_at": {
"type": "string"
},
"device_number": {
"type": "string",
"title": "设备编号"
},
"product_id": {
"type": "null"
},
"parent_id": {
"type": "null"
},
"label": {
"type": "string",
"title": "标签",
"description": "单标签,英文逗号隔开"
},
"location": {
"type": "null"
},
"sub_device_addr": {
"type": "null"
},
"current_version": {
"type": "null"
},
"additional_info": {
"type": "string",
"title": "附件信息",
"description": "json字符串"
},
"protocol_config": {
"type": "string",
"title": "协议插件设备配置",
"description": "协议插件相关的设备配置"
},
"remark1": {
"type": "null"
},
"remark2": {
"type": "null"
},
"remark3": {
"type": "null"
},
"device_config_id": {
"type": "string",
"title": "设备配置id"
},
"batch_number": {
"type": "null"
},
"activate_at": {
"type": "null",
"title": "激活时间"
},
"is_online": {
"type": "integer",
"description": "1-在线 0-离线",
"title": "是否在线"
},
"device_config_name": {
"type": "string",
"title": "设备配置名称"
},
"access_way": {
"type": "string"
},
"device_config": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"device_template_id": {
"type": "string"
},
"device_type": {
"type": "string"
},
"protocol_type": {
"type": "string"
},
"voucher_type": {
"type": "string"
},
"protocol_config": {
"type": "null"
},
"device_conn_type": {
"type": "null"
},
"additional_info": {
"type": "string"
},
"description": {
"type": "null"
},
"tenant_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"remark": {
"type": "null"
}
},
"required": [
"id",
"name",
"device_template_id",
"device_type",
"protocol_type",
"voucher_type",
"protocol_config",
"device_conn_type",
"additional_info",
"description",
"tenant_id",
"created_at",
"updated_at",
"remark"
],
"x-apifox-orders": [
"id",
"name",
"device_template_id",
"device_type",
"protocol_type",
"voucher_type",
"protocol_config",
"device_conn_type",
"additional_info",
"description",
"tenant_id",
"created_at",
"updated_at",
"remark"
],
"x-apifox-ignore-properties": []
},
"protocol": {
"type": "null"
}
},
"required": [
"access_way",
"activate_at",
"activate_flag",
"additional_info",
"batch_number",
"created_at",
"current_version",
"device_config",
"device_config_id",
"device_config_name",
"device_number",
"id",
"is_enabled",
"is_online",
"label",
"location",
"name",
"parent_id",
"product_id",
"protocol",
"protocol_config",
"remark1",
"remark2",
"remark3",
"sub_device_addr",
"tenant_id",
"update_at",
"voucher"
],
"x-apifox-orders": [
"id",
"name",
"voucher",
"tenant_id",
"is_enabled",
"activate_flag",
"created_at",
"update_at",
"device_number",
"product_id",
"parent_id",
"label",
"location",
"sub_device_addr",
"current_version",
"additional_info",
"protocol_config",
"remark1",
"remark2",
"remark3",
"device_config_id",
"batch_number",
"activate_at",
"is_online",
"device_config_name",
"access_way",
"device_config",
"protocol"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "GetDevice successfully",
"data": {
"access_way": "A",
"activate_at": null,
"activate_flag": "",
"additional_info": "{}",
"batch_number": null,
"created_at": "2024-04-01T08:37:39.055041Z",
"current_version": null,
"device_config": {
"id": "e79f54b9-a117-1ce2-734a-3db1f6170d8b",
"name": "sensor1",
"device_template_id": "d670a256-090e-2a7c-fab7-f8e14eebe204",
"device_type": "1",
"protocol_type": "MQTT",
"voucher_type": "ACCESSTOKEN",
"protocol_config": null,
"device_conn_type": null,
"additional_info": "{}",
"description": null,
"tenant_id": "f2c67e1a",
"created_at": "2024-04-01T09:06:59.471498Z",
"updated_at": "2024-04-03T01:15:37.194231Z",
"remark": null
},
"device_config_id": "e79f54b9-a117-1ce2-734a-3db1f6170d8b",
"device_config_name": "sensor1",
"device_number": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"is_enabled": "",
"is_online": 0,
"label": "",
"location": null,
"name": "sensor1",
"parent_id": null,
"product_id": null,
"protocol": null,
"protocol_config": "{}",
"remark1": null,
"remark2": null,
"remark3": null,
"sub_device_addr": null,
"tenant_id": "f2c67e1a",
"update_at": "2024-04-01T08:37:39.055041Z",
"voucher": "{\"username\":\"sensor1\"}"
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176516-run"
}
},
"/api/v1/device": {
"get": {
"summary": "设备列表分页查询✅",
"deprecated": false,
"description": "分页查询设备\n产品预注册列表查询product_id必输",
"tags": [
"设备管理"
],
"parameters": [
{
"name": "activate_flag",
"in": "query",
"description": "激活状态(inactive-未激活 active-已激活)",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "current_version",
"in": "query",
"description": "当前版本",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "device_config_id",
"in": "query",
"description": "设备配置ID",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "device_number",
"in": "query",
"description": "设备编号",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "device_type",
"in": "query",
"description": "设备类型 1-直连设备 2-网关设备3-网关子设备",
"required": false,
"example": ",",
"schema": {
"type": "string"
}
},
{
"name": "group_id",
"in": "query",
"description": "组id",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "is_enabled",
"in": "query",
"description": "是否启用(enabled-启用 disabled-禁用 默认禁用,激活后默认启用)",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "label",
"in": "query",
"description": "标签",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "name",
"in": "query",
"description": "设备名称",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "page",
"in": "query",
"description": "页码",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "page_size",
"in": "query",
"description": "每页数量",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "product_id",
"in": "query",
"description": "产品ID",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "search",
"in": "query",
"description": "设备名称或编号模糊匹配",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "warn_status",
"in": "query",
"description": "告警状态 Y-告警 N未告警",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "is_online",
"in": "query",
"description": "在线状态1-在线 0-在线",
"required": false,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "access_way",
"in": "query",
"description": "接入方式 A-协议接入 B-服务接入",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "batch_number",
"in": "query",
"description": "批次编号",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "protocol_type",
"in": "query",
"description": "协议类型",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "service_identifier",
"in": "query",
"description": "服务/协议标识符",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "service_access_id",
"in": "query",
"description": "服务接入点ID",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"device_number": {
"type": "string",
"title": "设备编号"
},
"name": {
"type": "string",
"title": "设备名称"
},
"device_config_id": {
"type": "string",
"title": "设备配置id"
},
"device_config_name": {
"type": "string",
"title": "设备配置名称",
"description": "web端的(通过服务/协议)"
},
"ts": {
"type": "string",
"title": "上次遥测上报时间",
"description": "如:2024-03-05T12:55:48.698934Z"
},
"activate_flag": {
"type": "string",
"title": "激活标志",
"description": "inactive-未激活 active-已激活"
},
"activate_at": {
"type": "string",
"title": "激活日期",
"description": "如:2024-03-05T12:55:48.698934Z"
},
"batch_number": {
"type": "string",
"title": "批次编号"
},
"current_version": {
"type": "string",
"title": "当前固件版本"
},
"created_at": {
"type": "string",
"title": "创建时间",
"description": "如:2024-03-05T12:55:48.698934Z"
},
"is_online": {
"type": "string",
"title": "在线状态",
"description": "1-在线 0-在线"
},
"access_way": {
"type": "string",
"description": "A-通过协议 B通过服",
"title": "接入方式"
},
"warn_status": {
"type": "string",
"title": "告警状态",
"description": "Y-告警 N未告警"
},
"location": {
"type": "string",
"title": "位置(经度在前)",
"description": "119.078597,31.139775"
},
"protocol_type": {
"type": "string",
"title": "协议类型"
}
},
"required": [
"id",
"device_number",
"name",
"device_config_id",
"ts",
"activate_flag",
"activate_at",
"batch_number",
"current_version",
"created_at",
"is_online",
"access_way",
"warn_status",
"location"
],
"x-apifox-orders": [
"id",
"device_number",
"name",
"device_config_id",
"device_config_name",
"ts",
"activate_flag",
"activate_at",
"batch_number",
"current_version",
"created_at",
"is_online",
"access_way",
"warn_status",
"location",
"protocol_type"
],
"x-apifox-ignore-properties": []
}
},
"total": {
"type": "string"
}
},
"required": [
"list",
"total"
],
"x-apifox-orders": [
"list",
"total"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get product successfully",
"data": {
"list": [
{
"id": "aecde324-a6f7-e70d-c30a-cf3e532fc832",
"device_number": "0001-0002",
"name": "aecde324-a6f7-e70d-c30a-cf3e532fc832",
"device_config_id": "",
"device_config_name": "",
"ts": null,
"activate_flag": "N",
"activate_at": null,
"batch_number": "0001",
"current_version": "0.1",
"created_at": "2024-03-05T15:40:10.019767Z"
},
{
"id": "0528fc8e-c0d7-bfa4-c34f-a75829f753a0",
"device_number": "0001-0001",
"name": "0528fc8e-c0d7-bfa4-c34f-a75829f753a0",
"device_config_id": "",
"device_config_name": "",
"ts": null,
"activate_flag": "N",
"activate_at": null,
"batch_number": "0001",
"current_version": "0.1",
"created_at": "2024-03-05T15:40:10.019767Z"
}
],
"total": 2
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功-自动创建"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176517-run"
}
},
"/api/v1/device/check/{deviceNumber}": {
"get": {
"summary": "编号校验✅",
"deprecated": false,
"description": "编号校验",
"tags": [
"设备管理"
],
"parameters": [
{
"name": "deviceNumber",
"in": "path",
"description": "设备编号",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"is_available": {
"type": "boolean",
"title": "是否可用",
"description": "true可用"
}
},
"required": [
"is_available"
],
"x-apifox-orders": [
"is_available"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "设备编号可用",
"data": {
"is_available": true
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176521-run"
}
},
"/api/v1/device/online/status/{id}": {
"get": {
"summary": "设备在线离线状态查询接口",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "id",
"in": "path",
"description": "",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"is_online": {
"type": "integer"
},
"device_status": {
"type": "integer",
"title": "1在线 0离线"
}
},
"required": [
"is_online",
"device_status"
],
"x-apifox-orders": [
"is_online",
"device_status"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "success",
"data": {
"is_online": 0,
"device_status": 1
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-167983829-run"
}
},
"/api/v1/telemetry/datas/pub": {
"post": {
"summary": "下发遥测✅",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"device_id": {
"type": "string",
"description": "设备id"
},
"value": {
"type": "string"
}
},
"x-apifox-orders": [
"device_id",
"value"
],
"required": [
"device_id",
"value"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"value": {
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"value": {
"switch": false
}
},
"description": ""
}
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Success"
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-154047089-run"
}
},
"/api/v1/telemetry/datas/current/{id}": {
"get": {
"summary": "设备遥测当前值查询✅",
"deprecated": false,
"description": "设备当前值查询,获取设备每个key的最新一条数据",
"tags": [
"遥测数据"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "设备ID",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"device_id": {
"type": "string"
},
"key": {
"type": "string",
"title": "数据名称"
},
"tenant_id": {
"type": "string"
},
"ts": {
"type": "string",
"title": "时间戳",
"description": "如:2024-03-13T00:28:11.039675Z"
},
"value": {
"type": "integer"
},
"label": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"device_id",
"key",
"tenant_id",
"ts",
"value"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"device_id",
"key",
"tenant_id",
"ts",
"value",
"label",
"unit"
]
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get current data successfully",
"data": [
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "humidity",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T18:02:21.458+08:00",
"value": 35
},
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "temperature",
"label": "温度",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T18:02:21.458+08:00",
"unit": "℃",
"value": -9.4
},
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "test_data1",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T14:26:41.135+08:00",
"value": 25.5
},
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "test_data2",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T14:26:41.135+08:00",
"value": 60
}
]
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176577-run"
}
},
"/api/v1/telemetry/datas/current/keys": {
"get": {
"summary": "根据key查询遥测当前值✅",
"deprecated": false,
"description": "设备当前值查询,获取设备每个key的最新一条数据",
"tags": [
"遥测数据"
],
"parameters": [
{
"name": "device_id",
"in": "query",
"description": "",
"required": true,
"example": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"schema": {
"type": "string"
}
},
{
"name": "keys",
"in": "query",
"description": "",
"required": true,
"example": [
"temperature"
],
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"device_id": {
"type": "string"
},
"key": {
"type": "string",
"title": "数据名称"
},
"label": {
"type": "string"
},
"tenant_id": {
"type": "string"
},
"ts": {
"type": "string",
"title": "时间戳",
"description": "如:2024-03-13T00:28:11.039675Z"
},
"unit": {
"type": "string"
},
"value": {
"type": "number"
}
},
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"device_id",
"key",
"label",
"tenant_id",
"ts",
"unit",
"value"
]
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get current data successfully",
"data": [
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "temperature",
"label": "温度",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T18:04:51.465+08:00",
"unit": "℃",
"value": -9.21
}
]
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-168570121-run"
}
},
"/api/v1/telemetry/datas/statistic": {
"get": {
"summary": "遥测聚合数据查询🔷",
"deprecated": false,
"description": "### 部分参数说明:\n\n#### *time_range [时间范围]\n- 支持的参数:**custom,last_5m,last_15m,last_30m,last_1h,last_3h,last_6h,last_12h,last_24h,last_3d,last_7d,last_15d,last_30d,last_60d,last_90d,last_6m,last_1y**\n- 当选择自定义时,要送start_time和end_time\n- 如果time_range>=3小时,则aggregate_window不能是no_aggregate(不聚合)\n\n#### *aggregate_window [聚合间隔]\n- 支持的参数:\"no_aggregate\",\"30s\",\"1m\",\"2m\",\"5m\",\"10m\",\"30m\",\"1h\",\"3h\",\"6h\",\"1d\",\"7d\",\"1mo\"\n- 不聚合\n \n#### aggregate_function [聚合方法]\n- **avg** 平均数\n- **max** 最大值\n- 当aggregate_window为no_aggregate的时候,前端不显示aggregate_function下拉,接口不送aggregate_function\n- 当aggregate_window不为no_aggregate,aggregate_function必输,前端可默认平均值\n\n### 前端筛选联动规则\n\n#### 页面初始化:\n- **time_range:** \"last_1h\"\n- **aggregate_window:** \"no_aggregate\"\n- **aggregate_function:** 不送\n\n#### time_range不为custom的选择:\n\n- **3小时内的数据 (time_range: last_5m, last_15m, last_30m, last_1h)**:\n - **aggregate_window:** 支持任何选项\n\n- **最近3小时 (time_range: last_3h)**:\n - **aggregate_window:** 不支持\"no_aggregate\",其他都支持\n\n- **最近6小时 (time_range: last_6h)**:\n - **aggregate_window:** 不支持小于等于\"30s\"的选项:不支持\"no_aggregate\", \"30s\",其他都支持\n\n- **最近12小时 (time_range: last_12h)**:\n - **aggregate_window:** 不支持小于等于\"1m\"的选项:不支持\"no_aggregate\", \"30s\", \"1m\",其他都支持\n\n- **最近24小时 (time_range: last_24h)**:\n - **aggregate_window:** 不支持小于等于\"2m\"的选项:\n\n- **最近3天 (time_range: last_3d)**:\n - **aggregate_window:** 不支持小于等于\"5m\"的选项:\n\n- **最近7天 (time_range: last_7d)**:\n - **aggregate_window:** 不支持小于等于\"10m\"的选项:\n\n- **最近15天 (time_range: last_15d)**:\n - **aggregate_window:** 不支持小于等于\"30m\"的选项:\n\n- **最近30天 (time_range: last_30d)**:\n - **aggregate_window:** 不支持小于等于\"1h\"的选项:\n\n- **最近60天 (time_range: last_60d)**:\n - **aggregate_window:** 不支持小于等于\"3h\"的选项:\n\n- **最近90天 (time_range: last_90d)**:\n - **aggregate_window:** 不支持小于等于\"6h\"的选项:\n\n- **最近6个月 (time_range: last_6m)**:\n - **aggregate_window:** 不支持小于等于\"1d\"的选项:\n\n- **最近1年 (time_range: last_1y)**:\n - **aggregate_window:** 不支持小于等于\"7d\"的选项:\n\n#### 当用户选择custom或手动设置时间区间的时候:\n\n- time_range要变成\"custom\"\n- 区间<3小时\n - **aggregate_window:** 支持任何选项\n- 区间>=3小时\n - **aggregate_window:** 不支持小于等于\"30s\"的选项:不支持\"no_aggregate\", \"30s\",其他都支持\n- 其他与上面类推\n\n请求参数示例:\n\n```\n{\n \"device_id\": \"4a5b326c-ba99-9ea2-34a9-1c484d69a1ab\",\n \"key\": \"temperature\",\n \"start_time\": 1711864176268,\n \"end_time\": 1711864177268,\n \"aggregate_window\": \"no_aggregate\",\n \"time_range\": \"custom\"\n}\n```\n\n\n```\n{\n \"device_id\": \"4a5b326c-ba99-9ea2-34a9-1c484d69a1ab\",\n \"key\": \"temperature\",\n \"time_range\": \"last_1h\"\n \"aggregate_window\": \"30s\",\n \"aggregate_function\":\"max\"\n}\n```",
"tags": [
"遥测数据"
],
"parameters": [
{
"name": "aggregate_function",
"in": "query",
"description": "聚合方法 avg-平均数 max-最大值 mix-最小值 sum-求和 diff-最大最小的差值",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "aggregate_window",
"in": "query",
"description": "聚合间隔 no_aggregate,30s,1m,2m,5m,10m,30m,1h,3h,6h,1d,7d,1mo",
"required": true,
"example": "no_aggregate",
"schema": {
"type": "string"
}
},
{
"name": "device_id",
"in": "query",
"description": "设备ID",
"required": true,
"example": "f3625aae-1283-1afc-259e-f43a58ba7070",
"schema": {
"type": "string"
}
},
{
"name": "end_time",
"in": "query",
"description": "结束时间(time_range为custom时候必输)",
"required": false,
"example": 1711864177268,
"schema": {
"type": "integer"
}
},
{
"name": "key",
"in": "query",
"description": "",
"required": true,
"example": "temp",
"schema": {
"type": "string"
}
},
{
"name": "start_time",
"in": "query",
"description": "开始时间(time_range为custom时候必输)",
"required": false,
"example": 1711864177268,
"schema": {
"type": "integer"
}
},
{
"name": "time_range",
"in": "query",
"description": "时间范围 custom,last_5m,last_15m,last_30m,last_1h,last_3h,last_6h,last_12h,last_24h,last_3d,last_7d,last_15d,last_30d,last_60d,last_90d,last_6m,last_1y",
"required": true,
"example": "custom",
"schema": {
"type": "string"
}
},
{
"name": "is_export",
"in": "query",
"description": "是否导出",
"required": false,
"example": "true",
"schema": {
"type": "boolean"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"time_series": {
"type": "array",
"items": {
"type": "object",
"properties": {
"x": {
"type": "string"
},
"y": {
"type": "number"
}
},
"required": [
"x",
"y"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"x",
"y"
]
}
},
"x_time_range": {
"type": "object",
"properties": {
"end": {
"type": "string"
},
"start": {
"type": "string"
}
},
"required": [
"end",
"start"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"end",
"start"
]
}
},
"required": [
"time_series",
"x_time_range"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"time_series",
"x_time_range"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": {
"time_series": [
{
"x": "2024-03-20T16:31:10.508174Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:10.095501Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.924351Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.770282Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.580654Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.42025Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.166655Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:08.991563Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:03.970267Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:03.723987Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:03.468516Z",
"y": 25.933
}
],
"x_time_range": {
"end": "2024-03-20T17:00:00Z",
"start": "2024-03-20T14:00:00Z"
}
}
}
},
"2": {
"summary": "导出返回示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": {
"file_name": "fd1f887c-75d2-b793-b04d-f5bd5197ebcc_CSQs_1726550916006_1726554516006.csv",
"file_path": "files\\excel\\telemetry\\fd1f887c-75d2-b793-b04d-f5bd5197ebcc_CSQs_1726550916006_1726554516006.csv"
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
},
"x-200-2": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"file_name": {
"type": "string"
},
"file_path": {
"type": "string"
}
},
"required": [
"file_name",
"file_path"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"file_name",
"file_path"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
}
}
},
"headers": {},
"x-apifox-name": "导出返回响应定义"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152269064-run"
}
},
"/api/v1/attribute/datas/{id}": {
"get": {
"summary": "设备属性列表查询✅",
"deprecated": false,
"description": "设备属性列表查询",
"tags": [
"属性数据"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "设备ID",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"data_name": {
"type": "string",
"title": "属性名称",
"nullable": true
},
"device_id": {
"type": "string"
},
"id": {
"type": "string"
},
"key": {
"type": "string",
"title": "属性标识符"
},
"ts": {
"type": "string"
},
"unit": {
"type": "string",
"title": "单位",
"nullable": true
},
"value": {
"type": "number",
"title": "值"
}
},
"required": [
"data_name",
"device_id",
"id",
"key",
"ts",
"unit",
"value"
],
"x-apifox-orders": [
"data_name",
"device_id",
"id",
"key",
"ts",
"unit",
"value"
],
"x-apifox-ignore-properties": []
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": [
{
"data_name": "温度",
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "880e5c73-c6cc-3e24-4d57-4600df0036e5",
"key": "temp",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": "℃",
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "345cff35-6317-bfaf-4187-fe6fd2a02bb8",
"key": "hum4",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "f243f21c-7d30-bfa3-c6ed-fff3c0d8e399",
"key": "hum6",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "efdba7f3-6614-ed57-a1e6-51f1025389e2",
"key": "temp2",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "18205562-904d-df7f-f73f-60a93010a417",
"key": "hum",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "10cc4023-31aa-bae5-691c-d0087b455f0c",
"key": "temp5",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "db7f0ce7-bf44-6c63-86b2-239b580a314b",
"key": "hum1",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "7924fbf2-78ee-362d-d801-85a4cc2de499",
"key": "temp3",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "d4ef7f94-dac2-eab4-2ea3-7e15ca74b0ed",
"key": "hum7",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "90ea6359-a77d-9cab-473a-4894a88fa8c9",
"key": "temp4",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "2ca7a5dd-43eb-3db5-8b9b-4e4b24b1f7c1",
"key": "temp1",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "cd55395a-320f-c109-f363-35bbfd956e18",
"key": "hum2",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "3c37b799-92ba-7c4d-2c39-c5491e7a5ee9",
"key": "hum3",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "04b814c1-2c21-b61b-389a-7bb6ed08984c",
"key": "temp7",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "75f018d4-479f-f800-c2d5-12d99ae29a34",
"key": "hum5",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "426a3a88-a877-c607-95f5-8a23c0f4d1d1",
"key": "temp6",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
}
]
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "属性数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176487-run"
}
},
"/api/v1/command/datas/set/logs": {
"get": {
"summary": "命令下发记录查询(分页)✅",
"deprecated": false,
"description": "命令下发记录查询(分页)",
"tags": [
"命令下发"
],
"parameters": [
{
"name": "device_id",
"in": "query",
"description": "设备ID",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "identify",
"in": "query",
"description": "数据标识符",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "page",
"in": "query",
"description": "页码",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "page_size",
"in": "query",
"description": "每页数量",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "status",
"in": "query",
"description": "1-发送成功 2- 发送失败3返回成功 4-返回失败",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "operation_type",
"in": "query",
"description": "操作类型 1-手动操作 2-自动触发",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "identify_name",
"in": "query",
"description": "命令名称 模糊匹配",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"device_id": {
"type": "string"
},
"operation_type": {
"type": "string",
"description": "1-手动操作 2-自动触发",
"title": "操作类型"
},
"message_id": {
"type": "string"
},
"data": {
"type": "string",
"title": "发送内容"
},
"rsp_data": {
"type": "string"
},
"status": {
"type": "string",
"description": "1-发送成功 2- 发送失败2-返回成功 3-返回失败",
"title": "状态"
},
"error_message": {
"type": "string"
},
"created_at": {
"type": "string"
},
"user_id": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"id",
"device_id",
"operation_type",
"message_id",
"data",
"rsp_data",
"status",
"error_message",
"created_at",
"user_id",
"description"
],
"x-apifox-orders": [
"id",
"device_id",
"operation_type",
"message_id",
"data",
"rsp_data",
"status",
"error_message",
"created_at",
"user_id",
"description"
],
"x-apifox-ignore-properties": []
}
}
},
"required": [
"count",
"value"
],
"x-apifox-orders": [
"count",
"value"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": {
"count": 11,
"list": [
{
"id": "46495a51-5946-bdcc-9618-38f2b6c427c2",
"device_id": "66c172a3-f75c-b966-a547-0254f45d8d0d",
"operation_type": "1",
"message_id": "2806102",
"data": "{\"method\":\"DEVICE_CONTROL\",\"params\":{\"switchSprinkling\":1}}",
"rsp_data": null,
"status": "1",
"error_message": "",
"created_at": "2024-04-11T03:28:22.942458Z",
"user_id": "e7cc3359-54f3-e23b-801b-e3b82446378e",
"description": "下发命令日志记录",
"identify": "DEVICE_CONTROL"
},
{
"id": "9032a3e2-6851-c78f-64db-9958c0b21f77",
"device_id": "66c172a3-f75c-b966-a547-0254f45d8d0d",
"operation_type": "1",
"message_id": "2805897",
"data": "{\"method\":\"DEVICE_CONTROL\",\"params\":{\"switchSprinkling\":1}}",
"rsp_data": null,
"status": "1",
"error_message": "",
"created_at": "2024-04-11T03:24:57.83269Z",
"user_id": "e7cc3359-54f3-e23b-801b-e3b82446378e",
"description": "下发命令日志记录",
"identify": "DEVICE_CONTROL"
},
{
"id": "6f047ea7-defa-7cb1-d687-375eff9f72d8",
"device_id": "66c172a3-f75c-b966-a547-0254f45d8d0d",
"operation_type": "1",
"message_id": "2805740",
"data": "{\"method\":\"DEVICE_CONTROL\",\"params\":{\"switchSprinkling\":1}}",
"rsp_data": null,
"status": "1",
"error_message": "",
"created_at": "2024-04-11T03:22:20.703616Z",
"user_id": "e7cc3359-54f3-e23b-801b-e3b82446378e",
"description": "下发命令日志记录",
"identify": "DEVICE_CONTROL"
}
]
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "命令下发",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176509-run"
}
}
},
"components": {
"schemas": {
"model.GetBoardDeviceRes": {
"type": "object",
"properties": {
"device_on": {
"type": "integer",
"description": "设备在线数"
},
"device_total": {
"type": "integer",
"description": "设备总数"
},
"device_activity": {
"type": "string",
"description": "激活数"
}
},
"x-apifox-orders": [
"device_on",
"device_total",
"device_activity"
],
"required": [
"device_activity"
],
"x-apifox-ignore-properties": [],
"x-apifox-folder": "Schemas"
},
"model.GetBoardUserListMonth": {
"type": "object",
"properties": {
"mon": {
"type": "integer",
"description": "月份"
},
"num": {
"type": "integer",
"description": "新增数"
}
},
"x-apifox-orders": [
"mon",
"num"
],
"x-apifox-ignore-properties": [],
"x-apifox-folder": "Schemas"
},
"model.GetTenantRes": {
"type": "object",
"properties": {
"user_added_month": {
"type": "integer",
"description": "上月新增数"
},
"user_added_yesterday": {
"type": "integer",
"description": "昨日新增数"
},
"user_list_month": {
"type": "array",
"items": {
"$ref": "#/components/schemas/model.GetBoardUserListMonth"
},
"description": "历史数据"
},
"user_total": {
"type": "integer",
"description": "用户总数"
}
},
"x-apifox-orders": [
"user_added_month",
"user_added_yesterday",
"user_list_month",
"user_total"
],
"x-apifox-ignore-properties": [],
"x-apifox-folder": "Schemas"
}
},
"securitySchemes": {}
},
"servers": [],
"security": []
}