施工模板管理,用于创建模板施工任务,模板可配置安装设备的品类及位置。
API列表
请求方式 |
API |
描述 |
GET |
/v1.0/osaas/projects/{project_id}/construction/templates |
分页查询项目施工模板列表 |
GET |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id} |
获取施工模板详情 |
POST |
/v1.0/osaas/projects/{project_id}/construction/template |
创建施工模板 |
PUT |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id} |
修改施工模板 |
POST |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/replication |
复制施工模板 |
DELETE |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id} |
删除施工模板 |
POST |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/area |
新增施工模板区域 |
PUT |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id} |
修改施工模板区域 |
DELETE |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id} |
删除施工模板区域 |
POST |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/position |
新增施工模板区域位置 |
PUT |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id} |
修改施工模板区域位置 |
DELETE |
/v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id} |
删除施工模板区域位置 |
分页查询项目施工模板列表
接口描述
调用该接口分页查询项目施工模板列表
接口地址
GET /v1.0/osaas/projects/{project_id}/construction/templates
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
page_no |
Integer |
URL |
页码(page_no>0)(默认1) |
否 |
page_size |
Integer |
URL |
页条数(0<page_size<100)(默认20) |
否 |
template_name |
String |
URL |
模板名称 |
否 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Object |
施工模板分页结果 |
result参数说明
参数名 |
类型 |
说明 |
total |
Integer |
总条数 |
page_no |
Integer |
页码 |
page_size |
Integer |
页条数 |
templates |
Arrays |
施工模板列表 |
templates参数说明
参数名 |
类型 |
说明 |
template_id |
String |
模板唯一标识 |
template_name |
String |
模板名称 |
description |
String |
描述 |
has_binding |
Boolean |
是否绑定:true:已绑定/false:未绑定 |
请求示例
GET {url}/v1.0/osaas/projects/1239896663221xx/construction/templates
响应成功示例
{
"success": true,
"t": 1539776581583,
"result": {
"page_no": 1,
"page_size": 1,
"total": 1,
"templates": [
{
"template_id": "1429018",
"template_name": "测试模板",
"description": "朝南户型",
"has_binding": true
}
]
}
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
获取施工模板详情
接口描述
调用该接口获取施工模板详情
接口地址
GET /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Object |
施工模板详情 |
result参数说明
参数名 |
类型 |
说明 |
template_id |
String |
模板唯一标识 |
template_name |
String |
模板名称 |
description |
String |
描述 |
has_binding |
Boolean |
是否绑定:true:已绑定/false:未绑定 |
areas |
Arrays |
区域列表 |
areas参数说明
参数名 |
类型 |
说明 |
template_id |
String |
区域唯一标识 |
area_name |
String |
区域名称 |
positions |
Arrays |
位置列表 |
positions参数说明
参数名 |
类型 |
说明 |
position_id |
String |
位置唯一标识 |
position_name |
String |
位置名称 |
custom_device_name |
String |
自定义设备名称 |
construction_category |
Arrays |
拆分设备列表 |
infrared_devices |
Arrays |
红外设备列表 |
split_devices参数说明
参数名 |
类型 |
说明 |
category_code |
String |
拆分设备品类编码 |
custom_device_name |
String |
自定义设备名称 |
infrared_devices参数说明
参数名 |
类型 |
说明 |
category_id |
String |
红外设备品类唯一标识 |
custom_device_name |
String |
自定义设备名称 |
brand_id |
String |
品牌唯一标识 |
operator_id |
String |
运营商唯一标识 |
remote |
String |
遥控器索引 |
请求示例
GET {url}/v1.0/osaas/projects/1239896663******/construction/templates/147***
响应成功示例
{
"result": {
"areas": [
{
"area_id": "6UN******",
"area_name": "Living room",
"positions": [
{
"construction_category": "wf_wnykq",
"custom_device_name": "Universal remote control",
"infrared_devices": [
{
"area_id": "120116",
"brand_id": "2",
"category_id": "1",
"operator_id": "3170",
"remote": "4469"
}
],
"position_id": "************",
"position_name": "position 1"
},
{
"construction_category": "zig_kg_1",
"custom_device_name": "Switch",
"position_id": "************",
"position_name": "position 2",
"split_devices": [
{
"category_code": "dj",
"custom_device_name": "Lamp"
}
]
}
]
}
],
"description": "Test",
"has_binding": false,
"template_id": "************",
"template_name": "Test Template"
}
"success": true,
"t": 1600670418686
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
创建施工模板
接口描述
调用该接口创建施工模板
接口地址
POST /v1.0/osaas/projects/{project_id}/construction/template
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_name |
String |
BODY |
模板名称(最大80个字符) |
是 |
description |
String |
BODY |
描述(最大100个字符) |
否 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
String |
施工模板唯一标识 |
请求示例
POST {url}/v1.0/osaas/projects/123989666******/construction/template
{
"template_name": "模板名称(最大80个字符)",
"description": "描述(最大100个字符)",
}
响应成功示例
{
"success": true,
"result":"1429***",
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
修改施工模板
接口描述
调用该接口修改施工模板
接口地址
PUT /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
template_name |
String |
BODY |
模板名称(最大80个字符) |
否 |
description |
String |
BODY |
描述(最大100个字符) |
否 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
PUT {url}/v1.0/osaas/projects/123989666******/construction/templates/151***
{
"template_name": "模板名称(最大80个字符)",
"description": "描述(最大100个字符)"
}
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
复制施工模板
接口描述
调用该接口复制施工模板
接口地址
POST /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/replication
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
template_name |
String |
BODY |
模板名称(最大80个字符) |
是 |
description |
String |
BODY |
描述(最大100个字符) |
否 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
POST {url}/v1.0/osaas/projects/1239896663******/construction/templates/157***/replication
{
"description": "朝南户型",
"template_name": "测试模板"
}
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
删除施工模板
接口描述
调用该接口删除施工模板
接口地址
DELETE /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
DELETE {url}/v1.0/osaas/projects/1239896******/construction/templates/157***
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
新增施工模板区域
接口描述
调用该接口新增施工模板区域
接口地址
POST /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/area
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
否 |
template_id |
String |
URI |
模板唯一标识 |
否 |
area_name |
String |
BODY |
区域名称(最大64个字符) |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
String |
区域唯一标识 |
请求示例
POST /v1.0/osaas/projects/132xxxxxxx/construction/templates/123xxxxx/area
{
"area_name": "区域名称(最大64个字符)"
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
修改施工模板区域
接口描述
调用该接口修改施工模板区域
接口地址
PUT /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
area_id |
String |
URI |
区域唯一标识 |
是 |
area_name |
String |
BODY |
区域名称(最大64个字符) |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
PUT {url}/v1.0/osaas/projects/12398966******/construction/templates/142***/areas/ifNS***
{
"area_name": "区域名称"
}
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
删除施工模板区域
接口描述
调用该接口删除施工模板区域
接口地址
DELETE /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
area_id |
String |
URI |
区域唯一标识 |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
DELETE {url}/v1.0/osaas/projects/123989666******/construction/templates/142***/areas/ifNS***
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
新增施工模板设备安装位置
接口描述
调用该接口新增施工模板设备安装位置
接口地址
POST /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/position
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
area_id |
String |
URI |
区域唯一标识 |
是 |
position_name |
String |
BODY |
位置名称 |
是 |
construction_category |
String |
BODY |
施工品类(参考施工品类章 节) |
是 |
custom_device_name |
String |
BODY |
自定义设备名称 |
是 |
split_devices |
Arrays |
BODY |
拆分设备列表 |
否 |
construction_category |
Arrays |
BODY |
红外设备列表 |
否 |
split_devices参数说明
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
category_code |
String |
BODY |
拆分设备品类编码(参考施 工品类章节) |
是 |
custom_device_name |
String |
BODY |
自定义设备名称 |
是 |
infrared_devices参数说明
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
category_id |
String |
BODY |
红外设备品类唯一标识(参 考施工品类章节) |
是 |
custom_device_name |
String |
BODY |
自定义设备名称 |
是 |
brand_id |
String |
BODY |
红外品牌唯一标识(参考万能红外章节) |
是 |
remote |
String |
BODY |
自定义设备名称 |
是 |
area_id |
String |
BODY |
地区唯一标识 |
否 |
operator_id |
String |
BODY |
运营商唯一标识 |
否 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
String |
位置唯一标识 |
请求示例
POST {url}/v1.0/osaas/projects/1239896******/construction/templates/157***/areas/7Xh4g***/position
{
"construction_category": "zig_kg_1",
"custom_device_name": "一路开关",
"position_name": "位置 2",
"split_devices": [
{
"custom_device_name": "灯",
"category_code": "dj"
}
]
}
响应成功示例
{
"success": true,
"result":"233******",
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
修改施工模板区域位置
接口描述
调用该接口修改施工模板区域位置
接口地址
PUT /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
area_id |
String |
URI |
区域唯一标识 |
是 |
position_id |
String |
URI |
位置唯一标识 |
是 |
position_name |
String |
BODY |
位置名称 |
t 是 rue |
construction_category |
String |
BODY |
施工品类(参考施工品类章 节) |
是 |
custom_device_name |
String |
BODY |
自定义设备名称 |
是 |
split_devices |
Arrays |
BODY |
拆分设备列表 |
否 |
construction_category |
Arrays |
BODY |
红外设备列表 |
否 |
split_devices 参数说明
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
category_code |
String |
BODY |
拆分设备品类编码(参考施 工品类章节) |
是 |
custom_device_name |
String |
BODY |
自定义设备名称 |
是 |
infrared_devices 参数说明
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
category_id |
String |
BODY |
红外设备品类唯一标识(参 考施工品类章节) |
是 |
custom_device_name |
String |
BODY |
自定义设备名称 |
是 |
brand_id |
String |
BODY |
红外品牌唯一标识(参考万能红外章节) |
是 |
remote |
String |
BODY |
自定义设备名称 |
是 |
area_id |
String |
BODY |
地区唯一标识 |
否 |
operator_id |
String |
BODY |
运营商唯一标识 |
否 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
PUT {url}/v1.0/osaas/projects/12398966******/construction/templates/15******/areas/7Xh4g***/positions/13163676376******
{
"construction_category": "zig_kg_1",
"custom_device_name": "一路开关",
"position_name": "位置 2",
"split_devices": [
{
"custom_device_name": "灯",
"category_code": "dj"
}
]
}
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
删除施工模板区域位置
接口描述
调用该接口删除施工模板区域位置
接口地址
DELETE /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
template_id |
String |
URI |
模板唯一标识 |
是 |
area_id |
String |
URI |
区域唯一标识 |
是 |
position_id |
String |
URI |
位置唯一标识 |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
DELETE {url}/v1.0/osaas/projects/123989666******/construction/templates/157***/areas/7Xh4g***/positions/13163676376******
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
错误码
以下为该接口常见的业务异常,更多的异常错误,请参见全局错误码。