遍历一个产品的全部特征项
请求地址: GET /products/{productName}/features
接口说明
- 分页遍历指定名称产品的所有特征项
请求参数
- Path
参数名 类型 必需 示例值 说明 productName string 是 product 产品名称 - Query
参数名 类型 必需 示例值 说明 offset integer 否 0 起始下标 limit integer 否 50 范围(小于1000,默认50)
请求示例
GET https://back-office-api.bitanswer.cn/bitanswer/api/products/product/features?offset=0&limit=2
bitkey: xxx
响应示例
{
"status": 0,
"data": {
"total": 22,
"items": [
{
"id": 1,
"name": "xx",
"featureId": 1,
"value": 0
},
{
"id": 2,
"name": "xxx",
"featureId": 101,
"value": 1110
}
]
}
}
条件检索一个产品的特征项
请求地址: POST /products/{productName}/features/data
接口说明
- 检索指定名称产品的特征项
请求参数
-
Path
参数名 类型 必需 示例值 说明 productName string 是 product 产品名称 -
Query
参数名 类型 必需 示例值 说明 offset integer 否 0 起始下标 limit integer 否 50 范围(小于1000,默认50) -
Body
参数名 类型 必需 中文名 querys array 否 查询条件 sorts array 否 排序条件
支持的参数见下表,检索类型query表示可用于查询,sort表示可用于排序,query|sort表示可用于查询和排序
参数名 类型 检索类型 必需 中文名 id integer sort 否 特征项ID guid string query 否 特征项GUID name string query|sort 否 特征项名称 featureId integer sort 否 FID version string sort 否 特征项版本
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api/products/foo/features/data?offset=0&limit=2
bitkey: xxx
Content-Type: application/json
{
"querys": [{
"name": "name",
"op": "like",
"values": ["%1%"]
}]
}
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"id": 18491,
"name": "feature-1",
"featureId": 1,
"value": 0,
"hidden": false,
"overwrite": false,
"description": "",
"status": 3
}
]
}
}
为指定产品创建特征项
请求地址: POST /products/{productName}/features
接口说明
- 为指定名称的产品创建特征项,名称已存在的特征项信息会被覆盖。
- 返回创建后的特征项。
请求参数
-
Path
参数名 类型 必需 示例值 说明 productName string 是 product 产品名称 -
Body
参数名 类型 必需 中文名 name string 是 名称(不允许重复) featureId integer 否 特征项FID(为空时自增) endDate string 否 结束日期,格式“yyyy-MM-dd”或“yyyy-MM-dd hh:mm:ss” expirationDays integer 否 有效期天数 users integer 否 用户数 value integer 否 值 description string 否 特征项描述信息
注:请求体需以数组形式输入。
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api/products/foo/features
bitkey: xxx
Content-Type: application/json
[
{
"name": "test-test-005"
}
]
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"id": 313,
"guid": "d35e7c54f6a5483eb27a813ce05959e4",
"name": "test-test-005",
"featureId": 6,
"value": 6,
"hidden": false,
"overwrite": false,
"status": 0
}
]
}
}
更新一个产品的特征项
请求地址: PATCH /products/{productName}/features
接口说明
- 指定产品的名称和特征项的ID/GUID更新特征项的信息。
- 同时输入ID和GUID时要求必须匹配,允许更新名称、结束日期、有效期、用户数、值、描述信息
- 返回更新后的特征项信息。
请求参数
-
Path
参数名 类型 必需 示例值 说明 productName string 是 product 产品名称 -
Body
参数名 类型 必需 中文名 name string 否 名称(不允许重复) endDate string 否 结束日期,格式“yyyy-MM-dd”或“yyyy-MM-dd hh:mm:ss” expirationDays integer 否 有效期天数 users integer 否 用户数 value integer 否 值 description string 否 特征项描述信息
注:请求体需以数组形式输入。
请求示例
PATCH https://back-office-api.bitanswer.cn/bitanswer/api/products/foo/features
bitkey: xxx
Content-Type: application/json
[
{
"id": 312,
"name": "foo-foo-001"
},
{
"id": 313,
"guid": "d35e7c54f6a5483eb27a813ce05959e4",
"name": "foo-foo-002"
}
]
响应示例
{
"status": 0,
"data": {
"total": 2,
"items": [
{
"id": 312,
"guid": "3c7591197db2487bab26c269a04dbcfb",
"name": "foo-foo-001",
"featureId": 5,
"value": 5,
"hidden": false,
"overwrite": false,
"status": 0
},
{
"id": 313,
"guid": "d35e7c54f6a5483eb27a813ce05959e4",
"name": "foo-foo-002",
"featureId": 6,
"value": 6,
"hidden": false,
"overwrite": false,
"status": 0
}
]
}
}
废弃或删除一个产品的特征项
请求地址: DELETE /products/{productName}/features
接口说明
- 指定产品的名称和特征项的ID/FID/GUID删除特征项。
- 指定特征项如果是草稿状态直接删除、如果是已发布等其他状态默认废弃,也可以指定状态直接删除。
- 返回删除的特征项信息。
请求参数
-
Path
参数名 类型 必需 示例值 说明 productName string 是 product 产品名称 -
Body
参数名 类型 必需 中文名 id integer 否 ID featureId integer 否 FID guid string 否 GUID status integer 否 32 表示强制删除
注:请求体需以数组形式输入。
请求示例
DELETE https://back-office-api.bitanswer.cn/bitanswer/api/products/foo/features
bitkey: xxx
Content-Type: application/json
[
{
"id": 312
},
{
"guid": "d35e7c54f6a5483eb27a813ce05959e4"
}
]
响应示例
{
"status": 0,
"data": {
"total": 2,
"items": [
{
"id": 312,
"guid": "f0ef66d34fc44918accbaadb406f14b1",
"name": "xxx",
"featureId": 400,
"value": 0,
"hidden": false,
"overwrite": false,
"description": "xxx",
"status": 16
},
{
"id": 296,
"guid": "d35e7c54f6a5483eb27a813ce05959e4",
"name": "xxx",
"featureId": 399,
"value": 0,
"hidden": false,
"overwrite": false,
"description": "xxx",
"status": 32
}
]
}
}
指定产品引用ID检索特征项
请求地址: POST /products/ref/{refId}/features/data
接口说明
- 指定产品引用ID,根据条件检索产品的特征项。
- 返回符合条件的特征项列表。
请求参数
-
Path
参数名 类型 必需 示例值 说明 refId string 是 xxx 产品引用ID -
Query
参数名 类型 必需 示例值 说明 offset integer 否 0 起始下标 limit integer 否 50 范围(小于1000,默认50) -
Body
参数名 类型 必需 中文名 querys array 否 查询条件 sorts array 否 排序条件
支持的参数见下表,检索类型query表示可用于查询,sort表示可用于排序,query|sort表示可用于查询和排序
参数名 类型 检索类型 必需 中文名 id integer sort 否 特征项ID guid string query 否 特征项GUID name string query|sort 否 特征项名称 featureId integer sort 否 FID version string sort 否 特征项版本
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api/products/refId/xxx/features/data?offset=0&limit=2
bitkey: xxx
Content-Type: application/json
{
"querys": [{
"name": "name",
"op": "like",
"values": ["%1%"]
}]
}
响应示例
{
"status": 0,
"data": {
"total": 205,
"items": [
{
"id": 2,
"name": "test_fid_101_v_0",
"featureId": 101,
"value": 1110,
"hidden": false,
"overwrite": true,
"description": "",
"status": 3
},
{
"id": 28,
"name": "test_fid_101_v_1",
"featureId": 101,
"value": 1111,
"hidden": false,
"overwrite": false,
"description": "foo",
"status": 3
}
]
}
}
指定引用ID创建特征项
请求地址: POST /products/ref/{refID}/features
接口说明
- 为指定引用ID的产品创建特征项,同名特征项的信息会被覆盖。
- 返回创建后的特征项。
请求参数
- Path
参数名 类型 必需 示例值 说明 refID string 是 ProductRefId 产品引用id - Body
参数名 类型 必需 中文名 name string 是 名称(不允许重复) featureId integer 否 特征项FID(为空时自增) endDate string 否 结束日期,格式“yyyy-MM-dd”或“yyyy-MM-dd hh:mm:ss” expirationDays integer 否 有效期天数 users integer 否 用户数 value integer 否 值 description string 否 特征项描述信息
注:请求体需以数组形式输入。
请求示例
POST https://back-office-api.bitanswer.cn/bitanswer/api/products/ref/xxx/features
bitkey: xxx
Content-Type: application/json
[
{
"name": "test-test-005"
}
]
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"id": 314,
"guid": "652cafeb1dcd4ae5879aaf6325dffa83",
"name": "test-test-005",
"featureId": 411,
"value": 411,
"hidden": false,
"overwrite": false,
"status": 0
}
]
}
}
指定引用ID更新特征项
请求地址: PATCH /products/ref/{refID}/features
接口说明
- 指定产品的引用ID和特征项的ID/GUID更新特征项的信息。
- 同时输入ID和GUID时要求必须匹配,允许更新名称、结束日期、有效期、用户数、值、描述信息
- 返回更新后的特征项信息。
请求参数
-
Path
参数名 类型 必需 示例值 说明 refID string 是 ProductRefId 产品引用id -
Body
参数名 类型 必需 中文名 name string 否 名称(不允许重复) endDate string 否 结束日期,格式“yyyy-MM-dd”或“yyyy-MM-dd hh:mm:ss” expirationDays integer 否 有效期天数 users integer 否 用户数 value integer 否 值 description string 否 特征项描述信息
注:请求体需以数组形式输入。
请求示例
PATCH https://back-office-api.bitanswer.cn/bitanswer/api/products/ref/xxx/features
bitkey: xxx
Content-Type: application/json
[
{
"id": 314,
"name": "foo-foo-001"
}
]
响应示例
{
"status": 0,
"data": {
"total": 1,
"items": [
{
"id": 314,
"guid": "652cafeb1dcd4ae5879aaf6325dffa83",
"name": "foo-foo-001",
"featureId": 411,
"value": 411,
"hidden": false,
"overwrite": false,
"status": 0
}
]
}
}
废弃或删除指定引用ID产品的特征项
请求地址: DELETE /products/ref/{refID}/features
接口说明
- 指定产品的引用ID和特征项的ID/FID/GUID删除特征项。
- 指定特征项如果是草稿状态直接删除、如果是已发布等其他状态默认废弃,也可以指定状态直接删除。
- 返回删除的特征项信息。
请求参数
-
Path
参数名 类型 必需 示例值 说明 productName string 是 product 产品名称 -
Body
参数名 类型 必需 中文名 id integer 否 ID featureId integer 否 FID guid string 否 GUID status integer 否 32 表示强制删除
注:请求体需以数组形式输入。
请求示例
DELETE https://back-office-api.bitanswer.cn/bitanswer/api/products/ref/xxx/features
bitkey: xxx
Content-Type: application/json
[
{
"id": 312
},
{
"guid": "d35e7c54f6a5483eb27a813ce05959e4"
}
]
响应示例
{
"status": 0,
"data": {
"total": 2,
"items": [
{
"id": 312,
"guid": "f0ef66d34fc44918accbaadb406f14b1",
"name": "xxx",
"featureId": 400,
"value": 0,
"hidden": false,
"overwrite": false,
"description": "xxx",
"status": 16
},
{
"id": 296,
"guid": "d35e7c54f6a5483eb27a813ce05959e4",
"name": "xxx",
"featureId": 399,
"value": 0,
"hidden": false,
"overwrite": false,
"description": "xxx",
"status": 32
}
]
}
}