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.

112 lines
1.9 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# TP后台接口文档
## 查询单个
- 请求方式GET
- 请求链接http://127.0.0.1:8002/api/
- 请求参数:
```json
{"record_time": "", "police_id": "",“event_type”: “”}
```
- 可选参数:
```json
{“page”: “1”, “page_size”: “20”}
```
- 结果示例:
![](.images/查询单个.png)
## 查询所有
- 请求方式GET
- 请求链接http://127.0.0.1:8002/api/
- 可选参数:
```json
{“page”: “1”, “page_size”: “20”}
```
- 结果示例:![](.images/查询所有.png)
## 新增数据
- 请求方式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": "cbwuipckwef",
"add_time": "2023-05-26T13:09:03",
"update_time": "2023-05-26T13:09:01",
"is_display": true
}
```
- 结果示例:
![](.images/新增数据.png)
## 修改数据
- 请求方式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": "cbwuipckwef",
"add_time": "2023-05-26T13:09:03",
"update_time": "2023-05-26T13:09:01",
"is_display": true
}
```
- 备注操作会修改uid为20的数据
- 结果示例:
![](.images/修改数据.png)
## 删除数据
- 请求方式delete
- 请求链接http://127.0.0.1:8002/api/20/
- 备注操作会删除uid为20的数据
- 结果示例:
![](.images/删除数据.png)