> For the complete documentation index, see [llms.txt](https://liu-tongtong.gitbook.io/dba/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liu-tongtong.gitbook.io/dba/siber-ji-cheng-ce-shi-ping-tai/siber-jie-kou-wen-dang/mo-ban-template.md).

# 模板 template

检查模板相关的接口、proto file 定义

## 模板的增、删、改、查

### uri

```
/siberhttp/manage/check_template
```

### request

```
{
    "manage_mode": "CREATE",
    "check_template": {
        "template_name": "测试",
        "checker": [
            {
                "key": "$ResponseStatus",
                "relation": "=",
                "content": 200
            }
        ]
    }
}
```

manage\_mode：

* CREATE：创建
* QUERY：查询
* UPDATE：更新
* DELETE：删除

### response

```
{
    "template_id": "60f91dedbdbbe1f8432bf023",
    "template_name": "测试",
    "checker": [
        {
            "key": "$ResponseStatus",
            "relation": "=",
            "content": 200
        }
    ],
    "insert_time": "1626938861",
    "update_time": "1626938861"
}
```

## 模板列表

### uri

```
/siberhttp/list/check_template
```

### request

因为这个数据量不会很大，所以当前都是全量返回，需要搜索的，直接使用浏览器搜索就成。

```
{
    "filterContent": {
        "": ""
    }
}
```

### response

```
{
    "check_template": [
        {
            "template_id": "60f94f40bdbbe1f8432bf024",
            "template_name": "测试",
            "update_time": "1626951488"
        }
    ]
}
```

## 模板的 proto 定义

### \[message]CheckTemplate

```
message CheckTemplate {
    string template_id = 1;
    string template_name = 2;
    repeated CheckSub checker = 3;
    int64 invalid_date = 4;
    int64 insert_time = 5;
    int64 update_time = 6;
    string user_update = 7;
}
```

### \[message]ManageCheckTemplateInfo

```
message ManageCheckTemplateInfo {
    string manage_mode = 1;
    CheckTemplate check_template = 2;
}
```

### \[message]CheckTemplateList

```
message CheckTemplateList{
    repeated CheckTemplate check_template = 1;
}
```

### \[message]CheckTemplateList

```
message CheckTemplateList{
    repeated CheckTemplate check_template = 1;
}
```

### \[rpc]ManageCheckTemplate

```
rpc ManageCheckTemplate(ManageCheckTemplateInfo) returns (CheckTemplate){
    option (google.api.http) = {
            post:"/siberhttp/manage/check_template"
            body:"*"
        };
}
```

### \[rpc]ManageTemplateList

```
rpc ManageTemplateList (FilterInfo) returns (CheckTemplateList){
        option (google.api.http) = {
             post:"/siberhttp/list/check_template"
             body:"*"
         };
    }
```
