遍历产品模版
-
请求地址:
GET /products/{productName}/templates
-
接口概述:
遍历指定产品的模版数据。
-
请求参数:
参数名 参数类型 参数说明 必需 备注 offset integer 响应结果起始下标 否 默认0 limit integer 响应结果的数量 否 默认50,最大1000 地址参数
参数名 参数类型 参数说明 必需 备注 productName string 产品名 是 -
请求体:
无
-
请求示例:
GET /bitanswer/api/products/{productName}/templates?limit=1 HTTP/1.1 Host: back-office-api.bitanswer.cn bitkey: ••••••
-
响应示例:
{ "status": 0, "data": { "total": 1, "items": [ { "regDate": "2023-08-16 15:51:44", "name": "Default", "status": 0 } ] } }
查询模版特征项
-
请求地址:
POST /products/{productName}/templates/{templateName}/features/data
POST /products/ref/{refId}/templates/{templateName}/features/data
-
接口概述:
指定产品与模版,根据限定的条件查询、排序模版下符合的特征项。
-
请求参数:
参数名 参数类型 参数说明 必需 备注 offset integer 响应结果起始下标 否 默认0 limit integer 响应结果的数量 否 默认50,最大1000 地址参数
参数名 参数类型 参数说明 必需 备注 productName string 产品名 是 templateName string 模板名 是 -
请求体:
参数名 参数类型 参数说明 必需 备注 querys array 查询参数 否 sorts array 排序参数 否 querys
支持:
guid
,name
,status
。sorts
支持:
id
,name
,featureId
,version
,status
。 -
请求示例:
使用产品名与模版名,获取指定产品的指定模版,根据限定的条件查询、排序符合的特征项:
POST /bitanswer/api/products/{productName}/templates/{templateName}/features/data?limit=1 HTTP/1.1 Host: back-office-api.bitanswer.cn bitkey: •••••• { "querys": [ { "name": "name", "op": "like", "values": [ "foo" ] } ], "sorts": [ { "name": "name" } ] }
使用产品引用id与模版名,获取指定产品的指定模版,根据限定的条件查询、排序符合的特征项:
POST /bitanswer/api/products/ref/{refId}/templates/{templateName}/features/data?limit=1 HTTP/1.1 Host: back-office-api.bitanswer.cn bitkey: •••••• { "querys": [ { "name": "name", "op": "like", "values": [ "foo" ] } ], "sorts": [ { "name": "name" } ] }
-
响应示例:
{ "status": 0, "data": { "total": 1, "items": [ { "id": 1, "guid": "xxx", "name": "foo", "featureId": 1, "value": 0, "source": "PRODUCT", "hidden": false, "display": false, "online": false, "overwrite": true, "ignoreSnUser": false, "status": 3, "type": "ReadOnly" } ] } }
添加模版
-
请求地址:
POST /products/{productName}/templates
-
接口概述:
在指定产品下添加模版数据。
-
请求参数:
地址参数
参数名 参数类型 参数说明 必需 备注 productName string 产品名 是 -
请求体:
参数名 参数类型 参数说明 必需 备注 name string 模版名称 是 模版名称不能超过32个字符 description string 模版说明 否 -
请求示例:
POST /bitanswer/api/products/{productName}/templates HTTP/1.1 Host: back-office-api.bitanswer.cn bitkey: •••••• { "name":"demo_template", "description": "This is description." }
-
响应示例:
{ "status": 0, "data": { "total": 1, "items": [ { "regDate": "2025-09-19 15:46:27", "name": "demo_template", "status": 0, "description": "This is description." } ] } }
查询产品指定模版
-
请求地址:
GET /products/{productName}/templates/{templateName}
-
接口概述:
在指定产品下查询指定的模版数据。
-
请求参数:
地址参数
参数名 参数类型 参数说明 必需 备注 productName string 产品名 是 templateName string 模版名 是 -
请求体:
无
-
请求示例:
GET /products/{productName}/templates/{templateName} HTTP/1.1 Host: back-office-api.bitanswer.cn bitkey: ••••••
-
响应示例:
{ "status": 0, "data": { "total": 1, "items": [ { "regDate": "2025-09-19 15:46:27", "name": "demo_template", "status": 0, "description": "This is description." } ] } }
更新产品指定模版
-
请求地址:
-
PATCH /products/{productName}/templates/{templateName}
-
POST /products/{productName}/templates/{templateName}
-
-
接口概述:
在指定产品下修改指定的模版数据。
PATCH 方法仅更新输入的内容;
POST 方法除输入的内容外,未输入的内容按默认值处理,适用于重置数据。
-
请求参数:
地址参数
参数名 参数类型 参数说明 必需 备注 productName string 产品名 是 templateName string 模版名 是 -
请求体:
参数名 参数类型 参数说明 必需 备注 name string 业务名称 否 模版名称不能超过32个字符 description string 业务说明 否 -
请求示例:
PATCH /products/{productName}/templates/{templateName} HTTP/1.1 Host: back-office-api.bitanswer.cn bitkey: •••••• { "name":"demo_template", "description": "修改描述" }
-
响应示例:
{ "status": 0, "data": { "total": 1, "items": [ { "regDate": "2025-09-19 15:46:27", "name": "demo_template", "status": 0, "description": "修改描述" } ] } }
删除产品指定模版
-
请求地址:
DELETE /products/{productName}/templates/{templateName}
-
接口概述:
在指定产品下删除指定的模版数据。模版下存在SN时删除会报错。
-
请求参数:
地址参数
参数名 参数类型 参数说明 必需 备注 productName string 产品名 是 templateName string 模版名 是 -
请求体:
无
-
请求示例:
DELETE /products/{productName}/templates/{templateName} HTTP/1.1 Host: back-office-api.bitanswer.cn bitkey: ••••••
-
响应示例:
{ "status": 0, "data": { "total": 1, "items": [ { "name":"demo_template" } ] } }