forked from kongfp/TP_Admin
31
0
Fork 1
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TP_API/TP_PROJECT/TP后台接口文档.md

151 lines
5.3 KiB
Markdown

# TP后台接口文档
<details>
<summary>查询单个</summary>
- 请求方式GET
- 请求链接http://127.0.0.1:8002/api/
- 请求参数:
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| ----------- | ------------------- | -------- | -------- | ---------- |
| record_time | 2023-05-26T13:09:05 | 否 | datetime | 记录仪时间 |
| police_id | 00000001 | 否 | string | 警号 |
| event_type | 0 | 否 | int | 事件类型 |
- 可选参数:
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| --------- | ------ | -------- | -------- | -------------------- |
| page | 1 | 否 | string | 页码 |
| page_size | 20 | 否 | string | 页面大小(每页条数) |
- 结果示例:
![](.images/查询单个.png)
</details>
<details>
<summary>查询所有</summary>
- 请求方式GET
- 请求链接http://127.0.0.1:8002/api/
- 可选参数:
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| --------- | ------ | -------- | -------- | -------------------- |
| page | 1 | 否 | string | 页码 |
| page_size | 20 | 否 | string | 页面大小(每页条数) |
- 结果示例:![](.images/查询所有.png)
</details>
<details>
<summary>新增数据</summary>
- 请求方式POST
- 请求链接http://127.0.0.1:8002/api/
- 请求body
```json
{
"video_hash": "vbhdrbvcw",
"record_time": "2023-05-26T13:09:05",
"police_id": "00000002",
"event_type": 1,
"is_violation": true,
"small_image": "nvikefrooiwer",
"relative_time": 4,
"video_dir": "/d/test",
"car_number": "苏a045689",
"ai_analysis": "违规",
"add_time": "2023-05-26T13:09:03",
"update_time": "2023-05-26T13:09:01",
"is_display": true
}
```
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| ------------- | ------------------- | -------- | -------- | ---------- |
| video_hash | vbhdrbvcw | 是 | string | 视频哈希 |
| record_time | 2023-05-26T13:09:05 | 是 | datetime | 记录仪时间 |
| police_id | 00000002 | 是 | string | 警号 |
| event_type | 1 | 是 | int | 事件类型 |
| is_violation | true | 是 | bool | 是否违规 |
| small_image | nvikefrooiwer | 是 | string | 缩略图 |
| relative_time | 4 | 是 | int | 视频时长 |
| video_dir | /d/test | 是 | string | 视频路径 |
| car_number | 苏a045689 | 是 | string | 车牌号 |
| ai_analysis | 违规 | 是 | string | 分析结果 |
| add_time | 2023-05-26T13:09:03 | 是 | datetime | 添加时间 |
| update_time | 2023-05-26T13:09:03 | 是 | datetime | 更新时间 |
| is_display | true | 是 | bool | 是否展示 |
- 结果示例:![](.images/新增数据.png)
</details>
<details>
<summary>修改数据</summary>
- 请求方式put
- 请求链接http://127.0.0.1:8002/api/20/
- 请求body
```json
{
"video_hash": "vbhdrbvcw",
"record_time": "2023-05-26T13:09:05",
"police_id": "00000002",
"event_type": 1,
"is_violation": true,
"small_image": "nvikefrooiwer",
"relative_time": 4,
"video_dir": "/d/test",
"car_number": "苏a045689",
"ai_analysis": "违规",
"add_time": "2023-05-26T13:09:03",
"update_time": "2023-05-26T13:09:01",
"is_display": true
}
```
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| ------------- | ------------------- | -------- | -------- | ---------- |
| video_hash | vbhdrbvcw | 是 | string | 视频哈希 |
| record_time | 2023-05-26T13:09:05 | 是 | datetime | 记录仪时间 |
| police_id | 00000002 | 是 | string | 警号 |
| event_type | 1 | 是 | int | 事件类型 |
| is_violation | true | 是 | bool | 是否违规 |
| small_image | nvikefrooiwer | 是 | string | 缩略图 |
| relative_time | 4 | 是 | int | 视频时长 |
| video_dir | /d/test | 是 | string | 视频路径 |
| car_number | 苏a045689 | 是 | string | 车牌号 |
| ai_analysis | 违规 | 是 | string | 分析结果 |
| add_time | 2023-05-26T13:09:03 | 是 | datetime | 添加时间 |
| update_time | 2023-05-26T13:09:03 | 是 | datetime | 更新时间 |
| is_display | true | 是 | bool | 是否展示 |
- 备注操作会修改uid为20的数据
- 结果示例:![](.images/修改数据.png)
</details>
<details>
<summary>删除数据</summary>
- 请求方式delete
- 请求链接http://127.0.0.1:8002/api/20/
- 备注操作会删除uid为20的数据
- 结果示例:![](.images/删除数据.png)
</details>