查询模版

请求地址: GET /templates

接口说明

  • 查询模版列表,返回结果按照产品名称分组。

请求参数

  • Query
    参数名 类型 必需 示例值 说明
    offset integer 0 起始下标
    limit integer 50 范围(小于1000,默认50)

请求示例

GET https://back-office-api.bitanswer.cn/bitanswer/api/templates?offset=0&limit=2
bitkey: xxx

响应示例

{
    "status": 0,
    "data": {
        "total": 7,
        "items": [
            {
                "productName": "demo",
                "templates": [
                    {
                        "regDate": "2022-08-30 08:26:00",
                        "name": "unitTestTemplate1",
                        "status": 0
                    },
                    {
                        "regDate": "2022-08-30 08:26:00",
                        "name": "unitTestTemplate2",
                        "status": 0
                    }
                ]
            }
        ]
    }
}

响应体参数说明

按条件检索模版

请求地址: POST /templates/data

接口说明

  • 按条件查询模版,结果按产品名称分组。

请求参数

  • Query
    参数名 类型 必需 示例值 说明
    offset integer 0 起始下标
    limit integer 50 范围(小于1000,默认50)
  • Body
    参数名 类型 必需 中文名
    querys array 查询条件
    sorts array 排序条件

支持的参数见下表,检索类型query表示可用于查询,sort表示可用于排序,query|sort表示可用于查询和排序。

参数名 类型 检索类型 必需 中文名
name string query|sort 模版名称

请求示例

POST https://back-office-api.bitanswer.cn/bitanswer/api/templates/data?offset=0&limit=10
bitkey: xxx
Content-Type: application/json

{
    "querys":[
        {
            "name":"name",
            "op":"=",
            "values":[
                "unitTestTemplate1"
            ]
        }
    ]
}

检索请求参数用法

响应示例

{
    "status": 0,
    "data": {
        "total": 1,
        "items": [
            {
                "productName": "demo",
                "templates": [
                    {
                        "regDate": "2022-08-29 18:23:35",
                        "name": "unitTestTemplate1",
                        "status": 0
                    }
                ]
            }
        ]
    }
}

响应体参数说明

查询产品关联模版

请求地址: GET /products/{productName}/templates

接口说明

  • 查询某产品下的所有模版。

请求参数

  • Path

    参数名 类型 必需 示例值 说明
    productName string product 产品名称
  • Query

    参数名 类型 必需 示例值 说明
    offset integer 0 起始下标
    limit integer 50 范围(小于1000,默认50)

请求示例

GET https://back-office-api.bitanswer.cn/bitanswer/api/products/xxx/templates?offset=0&limit=1
bitkey: xxx

响应示例

{
    "status": 0,
    "data": {
        "total": 3,
        "items": [
            {
                "regDate": "2022-08-29 18:23:35",
                "name": "template_name",
                "status": 0
            }
        ]
    }
}

响应体参数说明