物模型定义
物模型定义
物模型-属性
新建产品属性
POST | /admin-api/iot/tsl-properties/create |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
productId | 产品ID,productId和productKey只需要传一个就可以 | json | - | long |
productKey | 产品productKey,productId和productKey只需要传一个就可以 | json | - | string |
block | 模块名称,默认值:default | json | false | string |
name | 属性名称,支持中文 | json | true | string |
identifier | 属性唯一标识,下划线和英文数字组合,已英文或下划线开头 | json | true | string |
accessMode | 读写权限,1:只读;2:读写 | json | true | int32 |
dataType | 属性数据类型 | json | true | int32 |
tags | 属性标签描述,对于不同的dataType,tags也不同 | json | false | string |
icon | 属性图标 | json | false | string |
description | 属性描述 | json | false | string |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 创建成功返回产品属性Id | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": 1419193028976220,
"msg": ""
}
更新产品属性
PUT | /admin-api/iot/tsl-properties/update |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品属性id | json | true | long |
block | 模块名称 | json | false | string |
name | 属性名称,支持中文 | json | false | string |
accessMode | 读写权限,1:只读;2:读写 | json | false | int32 |
tags | 属性标签描述 | json | false | string |
icon | 属性图标 | json | false | string |
description | 属性描述 | json | false | string |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
提示:不支持更新dataType、identifier,可以删除后重新新建产品属性,但需注意,删除产品属性后,产品下的设备属性数据也会删除
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 更新成功返回true | boolean |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}
获取产品属性
GET | /admin-api/iot/tsl-properties/get |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品属性id | query | true | long |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 创建成功返回对象 | object |
---id | 产品属性id | long |
---name | 产品属性名称 | string |
---identifier | 产品属性唯一标识 | string |
---productId | productId | long |
---productKey | productKey | string |
---block | 模块名称 | string |
---dataType | 数据类型 | int |
---accessMode | 读写权限,1:只读;2:读写 | string |
---icon | 产品属性图标 | string |
---tags | 数据类型描述符 | string |
---description | 产品属性描述 | string |
---createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "teststruct",
"identifier": "teststruct",
"tags": "[{\"name\":\"test123\",\"identifier\":\"test123\",\"dataType\":1},{\"name\":\"test12344\",\"identifier\":\"dadwadwa\",\"dataType\":2}]",
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 8,
"block": "default",
"id": 1417646644035584,
"createTime": 1730525689000
},
"msg": ""
}
获取产品属性分页
GET | /admin-api/iot/tsl-properties/page |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
pageSize | 每页条数,最大值为 100,示例值(10) | query | true | int32 |
productId | 产品Id | query | false | long |
productKey | 产品productKey | query | false | string |
name | 属性名称,模糊查询属性名称 | query | false | string |
identifier | 查询特定属性identifier | query | false | string |
tags | 模糊查询 | query | false | string |
accessMode | 读写权限,1:只读;2:读写 | query | false | int32 |
block | 模块名称 | query | false | string |
dataType | 属性数据类型 | query | false | int32 |
description | 描述,模糊搜索内容 | query | false | string |
createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 成功产品属性分页数据 | object |
---total | 返回结果条数 | int |
---list | 返回数据列表 | array |
------id | 产品属性id | long |
------name | 产品属性名称 | string |
------identifier | 产品属性唯一标识 | string |
------productId | productId | long |
------productKey | productKey | string |
------block | 模块名称 | string |
------dataType | 数据类型 | int |
------accessMode | 读写权限,1:只读;2:读写 | string |
------icon | 产品属性图标 | string |
------tags | 数据类型描述符 | string |
------description | 产品属性描述 | string |
------createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testarr",
"identifier": "testarr",
"tags": "{\"dataType\":8,\"length\":10,\"tags\":[{\"name\":\"test124\",\"identifier\":\"dadwad\",\"dataType\":2},{\"name\":\"teset1243\",\"identifier\":\"dwadwadww\",\"dataType\":4,\"tags\":[{\"value\":1,\"desc\":\"wdadwa\"},{\"value\":213,\"desc\":\"dwadwadwa\"}]}]}",
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 9,
"block": "default",
"id": 1417646682865664,
"createTime": 1730525736000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "teststruct",
"identifier": "teststruct",
"tags": "[{\"name\":\"test123\",\"identifier\":\"test123\",\"dataType\":1},{\"name\":\"test12344\",\"identifier\":\"dadwadwa\",\"dataType\":2}]",
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 8,
"block": "default",
"id": 1417646644035584,
"createTime": 1730525689000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testenum",
"identifier": "testenum",
"tags": "[{\"value\":1,\"desc\":\"test\"},{\"value\":2,\"desc\":\"testttt\"}]",
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 4,
"block": "default",
"id": 1417646602952704,
"createTime": 1730525638000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testdouble",
"identifier": "testdouble",
"tags": null,
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 3,
"block": "default",
"id": 1417646574862336,
"createTime": 1730525604000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testfloat",
"identifier": "testfloat",
"tags": null,
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 2,
"block": "default",
"id": 1417646562836480,
"createTime": 1730525589000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testint",
"identifier": "testint",
"tags": null,
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 1,
"block": "default",
"id": 1417646546354176,
"createTime": 1730525569000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "开机状态",
"identifier": "power_on_status",
"tags": "[{\"value\":0,\"desc\":\"已关机\"},{\"value\":1,\"desc\":\"已开机\"}]",
"icon": null,
"accessMode": 1,
"description": null,
"dataType": 5,
"block": "default",
"id": 1417218623668224,
"createTime": 1730003203000
}
],
"total": 7
},
"msg": ""
}
获取产品属性列表
GET | /admin-api/iot/tsl-properties/list |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
productId | 产品Id | query | false | long |
productKey | 产品productKey | query | false | string |
name | 属性名称,模糊查询属性名称 | query | false | string |
identifier | 查询特定属性identifier | query | false | string |
tags | 模糊查询 | query | false | string |
accessMode | 读写权限,1:只读;2:读写 | query | false | int32 |
block | 模块名称 | query | false | string |
dataType | 属性数据类型 | query | false | int32 |
description | 描述,模糊搜索内容 | query | false | string |
createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 成功返回产品属性列表 | array |
---id | 产品属性id | long |
---name | 产品属性名称 | string |
---identifier | 产品属性唯一标识 | string |
---productId | productId | long |
---productKey | productKey | string |
---block | 模块名称 | string |
---dataType | 数据类型 | int |
---accessMode | 读写权限,1:只读;2:读写 | string |
---icon | 产品属性图标 | string |
---tags | 数据类型描述符 | string |
---description | 产品属性描述 | string |
---createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": [
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testarr",
"identifier": "testarr",
"tags": "{\"dataType\":8,\"length\":10,\"tags\":[{\"name\":\"test124\",\"identifier\":\"dadwad\",\"dataType\":2},{\"name\":\"teset1243\",\"identifier\":\"dwadwadww\",\"dataType\":4,\"tags\":[{\"value\":1,\"desc\":\"wdadwa\"},{\"value\":213,\"desc\":\"dwadwadwa\"}]}]}",
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 9,
"block": "default",
"id": 1417646682865664,
"createTime": 1730525736000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "teststruct",
"identifier": "teststruct",
"tags": "[{\"name\":\"test123\",\"identifier\":\"test123\",\"dataType\":1},{\"name\":\"test12344\",\"identifier\":\"dadwadwa\",\"dataType\":2}]",
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 8,
"block": "default",
"id": 1417646644035584,
"createTime": 1730525689000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testenum",
"identifier": "testenum",
"tags": "[{\"value\":1,\"desc\":\"test\"},{\"value\":2,\"desc\":\"testttt\"}]",
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 4,
"block": "default",
"id": 1417646602952704,
"createTime": 1730525638000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testdouble",
"identifier": "testdouble",
"tags": null,
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 3,
"block": "default",
"id": 1417646574862336,
"createTime": 1730525604000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testfloat",
"identifier": "testfloat",
"tags": null,
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 2,
"block": "default",
"id": 1417646562836480,
"createTime": 1730525589000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "testint",
"identifier": "testint",
"tags": null,
"icon": null,
"accessMode": 2,
"description": null,
"dataType": 1,
"block": "default",
"id": 1417646546354176,
"createTime": 1730525569000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "开机状态",
"identifier": "power_on_status",
"tags": "[{\"value\":0,\"desc\":\"已关机\"},{\"value\":1,\"desc\":\"已开机\"}]",
"icon": null,
"accessMode": 1,
"description": null,
"dataType": 5,
"block": "default",
"id": 1417218623668224,
"createTime": 1730003203000
}
],
"msg": ""
}
删除产品属性
DELETE | /admin-api/iot/tsl-properties/delete |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品属性id | json | true | long |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 删除成功返回布尔状态 | boolean |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}
物模型-服务
新建产品服务
POST | /admin-api/iot/tsl-services/create |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
productId | 产品ID,productId和productKey只需要传一个就可以 | json | - | long |
productKey | 产品productKey,productId和productKey只需要传一个就可以 | json | - | string |
block | 模块名称,默认值:default | json | false | string |
name | 服务名称,支持中文 | json | true | string |
identifier | 服务唯一标识,下划线和英文数字组合,已英文或下划线开头 | json | true | string |
callType | 服务调用类型,1:同步;2:异步 | json | true | int32 |
inputParams | 服务调用入参数 | json | false | string |
outputParams | 服务调用出参数 | json | false | string |
icon | 服务图标 | json | false | string |
description | 服务描述 | json | false | string |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 创建成功返回产品属性Id | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": 1419193028975520,
"msg": ""
}
更新产品服务
PUT | /admin-api/iot/tsl-services/update |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品服务id | json | true | long |
block | 服务名称 | json | false | string |
name | 服务名称,支持中文 | json | false | string |
identifier | 服务唯一标识 | json | false | string |
callType | 读写权限,1:只读;2:读写 | json | false | int32 |
inputParams | 服务调用入参数 | jsonjson | falsefalse | string |
outputParams | 服务调用出参数 | json | false | string |
icon | 服务图标 | jsonjson | falsefalse | string |
description | 服务描述 | json | false | string |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
注意
支持更新identifier,但需注意,更新产品服务identifier后,产品下的设备服务调用数据也会删除
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 更新成功返回true | boolean |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}
获取产品服务
GET | /admin-api/iot/tsl-services/get |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品服务id | query | true | int32 |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 创建成功返回产品Id | object |
---id | 产品服务id | long |
---name | 产品服务名称 | string |
---identifier | 产品服务唯一标识 | string |
---productId | productId | long |
---productKey | productKey | string |
---block | 模块名称 | string |
---inputParams | 服务调用入参数 | json |
---outputParams | 服务调用出参数 | json |
---callType | 服务调用类型,1:同步;2:异步 | string |
---icon | 产品服务图标 | string |
---description | 产品服务描述 | string |
---createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "打开灯光",
"identifier": "open_led_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623791104,
"createTime": 1730003203000
},
"msg": ""
}
获取产品服务分页
GET | /admin-api/iot/tsl-services/page |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
pageSize | 每页条数,最大值为 100,示例值(10) | query | true | int32 |
productId | 产品Id | query | false | long |
productKey | 产品productKey | query | false | string |
name | 服务名称,模糊查询服务名称 | query | false | string |
identifier | 查询特定服务identifier | query | false | string |
inputParams | 模糊查询 | query | false | string |
outputParams | 模糊查询 | query | false | int32 |
block | 模块名称 | query | false | string |
description | 描述,模糊搜索内容 | query | false | string |
createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 成功产品属性分页数据 | object |
---total | 返回结果条数 | int |
---list | 返回数据列表 | array |
------id | 产品服务id | long |
------name | 产品服务名称 | string |
------identifier | 产品服务唯一标识 | string |
------productId | productId | long |
------productKey | productKey | string |
------block | 模块名称 | string |
------inputParams | 服务调用入参数 | json |
------outputParams | 服务调用出参数 | json |
------callType | 服务调用类型,1:同步;2:异步 | string |
------icon | 产品服务图标 | string |
------description | 产品服务描述 | string |
------createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "dwadwadwa",
"identifier": "dwadwadwa",
"callType": 1,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "test123",
"id": 1419702410027008,
"createTime": 1733035168000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "打开灯光",
"identifier": "open_led_service123",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623791104,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "关闭灯光",
"identifier": "close_led_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623782912,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "重启",
"identifier": "restart_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623774720,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "强制关机",
"identifier": "force_power_off_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623766528,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "关机",
"identifier": "power_off_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623758336,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "开机",
"identifier": "power_on_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623733760,
"createTime": 1730003203000
}
],
"total": 7
},
"msg": ""
}
获取产品服务列表
GET | /admin-api/iot/tsl-services/list |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
productId | 产品Id | query | false | long |
productKey | 产品productKey | query | false | string |
name | 服务名称,模糊查询服务名称 | query | false | string |
identifier | 查询特定服务identifier | query | false | string |
inputParams | 模糊查询 | query | false | string |
outputParams | 模糊查询 | query | false | int32 |
block | 模块名称 | query | false | string |
description | 描述,模糊搜索内容 | query | false | string |
createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 成功返回产品属性列表 | array |
---id | 产品服务id | long |
---name | 产品服务名称 | string |
---identifier | 产品服务唯一标识 | string |
---productId | productId | long |
---productKey | productKey | string |
---block | 模块名称 | string |
---inputParams | 服务调用入参数 | json |
---outputParams | 服务调用出参数 | json |
---callType | 服务调用类型,1:同步;2:异步 | string |
---icon | 产品服务图标 | string |
---description | 产品服务描述 | string |
---createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": [
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "dwadwadwa",
"identifier": "dwadwadwa",
"callType": 1,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "test123",
"id": 1419702410027008,
"createTime": 1733035168000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "打开灯光",
"identifier": "open_led_service123",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623791104,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "关闭灯光",
"identifier": "close_led_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623782912,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "重启",
"identifier": "restart_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623774720,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "强制关机",
"identifier": "force_power_off_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623766528,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "关机",
"identifier": "power_off_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623758336,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "开机",
"identifier": "power_on_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623733760,
"createTime": 1730003203000
}
],
"msg": ""
}
删除产品服务
DELETE | /admin-api/iot/tsl-services/delete |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品服务id | json | true | long |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 删除成功返回布尔状态 | boolean |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}
物模型-事件
新建产品事件
POST | /admin-api/iot/tsl-events/create |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
productId | 产品ID,productId和productKey只需要传一个就可以 | json | - | long |
productKey | 产品productKey,productId和productKey只需要传一个就可以 | json | - | string |
block | 模块名称,默认值:default | json | false | string |
name | 事件名称,支持中文 | json | true | string |
identifier | 事件唯一标识,下划线和英文数字组合,已英文或下划线开头 | json | true | string |
eventType | 事件类型,1:info;2:warn;3:error | json | true | int32 |
outputParams | 事件输出参数 | json | false | string |
icon | 事件图标 | json | false | string |
description | 事件描述 | json | false | string |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 创建成功返回产品属性Id | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": 1419193028975520,
"msg": ""
}
更新产品事件
PUT | /admin-api/iot/tsl-events/update |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品属性id | json | true | long |
block | 模块名称,默认值:default | json | false | string |
name | 事件名称,支持中文 | json | false | string |
identifier | 事件唯一标识,下划线和英文数字组合,已英文或下划线开头 | json | false | string |
eventType | 事件类型,1:info;2:warn;3:error | json | false | int32 |
outputParams | 事件输出参数 | json | false | string |
icon | 事件图标 | json | false | string |
descriptionAuthorization | 事件描述认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | jsonheader | falsetrue | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 更新成功返回true | boolean |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}
获取产品事件
GET | /admin-api/iot/tsl-events/get |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品事件id | query | true | int32 |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 创建成功返回产品Id | object |
---id | 产品事件id | long |
---name | 产品事件名称 | string |
---identifier | 产品事件唯一标识 | string |
---productId | productId | long |
---productKey | productKey | string |
---block | 模块名称 | string |
---eventType | 事件类型,1:info;2:warn;3:error | int |
---outputParams | 事件输出参数 | string |
---icon | 产品事件图标 | string |
---description | 产品事件描述 | string |
---createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"productId": 1414626985444560,
"productKey": "WSaSUV",
"name": "开机事件",
"identifier": "power_on_event",
"icon": null,
"eventType": 2,
"description": null,
"outParams": null,
"block": "default",
"id": 1417646644035584,
"createTime": 1730525689000
},
"msg": ""
}
获取产品事件分页
GET | /admin-api/iot/tsl-events/page |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
pageSize | 每页条数,最大值为 100,示例值(10) | query | true | int32 |
productId | 产品Id | query | false | long |
productKey | 产品productKey | query | false | string |
name | 事件名称,模糊查询事件名称 | query | false | string |
identifier | 查询特定事件identifier | query | false | string |
outputParams | 模糊查询 | query | false | string |
block | 模块名称 | query | false | string |
eventType | 事件类型,1:info;2:warn;3:error | query | false | int32 |
description | 描述,模糊搜索内容 | query | false | string |
createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 成功产品事件分页数据 | object |
---total | 返回结果条数 | int |
---list | 返回数据列表 | array |
------id | 产品事件id | long |
------name | 产品事件名称 | string |
------identifier | 产品事件唯一标识 | string |
------productId | productId | long |
------productKey | productKey | string |
------block | 模块名称 | string |
------eventType | 事件类型,1:info;2:warn;3:error | int |
------outputParams | 事件输出参数 | string |
------icon | 产品事件图标 | string |
------description | 产品事件描述 | string |
------createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"productId": 1414626985444560,
"productKey": "WSaSUV",
"name": "开机事件",
"identifier": "power_on_event",
"icon": null,
"eventType": 2,
"description": null,
"outParams": null,
"block": "default",
"id": 1417646644035584,
"createTime": 1730525689000
}
],
"total": 1
},
"msg": ""
}
获取产品属性列表
GET | /admin-api/iot/tsl-events/list |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
productId | 产品Id | query | false | long |
productKey | 产品productKey | query | false | string |
name | 事件名称,模糊查询事件名称 | query | false | string |
identifier | 查询特定事件identifier | query | false | string |
outputParams | 模糊查询 | query | false | string |
block | 模块名称 | query | false | string |
eventType | 事件类型,1:info;2:warn;3:error | query | false | int32 |
description | 描述,模糊搜索内容 | query | false | string |
createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 成功返回产品事件列表 | array |
---id | 产品事件id | long |
---name | 产品事件名称 | string |
---identifier | 产品事件唯一标识 | string |
---productId | productId | long |
---productKey | productKey | string |
---block | 模块名称 | string |
---eventType | 事件类型,1:info;2:warn;3:error | int |
---outputParams | 事件输出参数 | string |
---icon | 产品事件图标 | string |
---description | 产品事件描述 | string |
---createTime | 创建时间,时间戳 | long |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": [
{
"productId": 1414626985444560,
"productKey": "WSaSUV",
"name": "开机事件",
"identifier": "power_on_event",
"icon": null,
"eventType": 2,
"description": null,
"outParams": null,
"block": "default",
"id": 1417646644035584,
"createTime": 1730525689000
}
],
"msg": ""
}
删除产品事件
DELETE | /admin-api/iot/tsl-events/delete |
---|
请求数据类型 :application/json;charset=UTF-8
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
id | 产品事件id | json | true | long |
Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
状态码 | 说明 |
---|---|
200 | OK |
响应参数
参数名称 | 参数说明 | 数据类型 |
---|---|---|
status | 状态码,值为0正常,其他值为异常 | int |
code | 结果同status一样,冗余字段 | int |
data | 删除成功返回布尔状态 | boolean |
msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}