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后台接口文档.md

241 lines
13 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后台接口文档
<details>
<summary>条件查询</summary>
- 请求方式GET
- 请求链接http://127.0.0.1:8002/api/
- 请求参数:
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| ----------- |---------------------| -------- |--------| ---------- |
| record_time | 2023-05-26 13:09:05 | 否 | string | 记录仪时间 |
| police_id | 00000001 | 否 | string | 警号 |
| event_type | 0 | 否 | string | 事件类型 |
- 可选参数:
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| --------- | ------ | -------- | -------- | -------------------- |
| page | 1 | 否 | string | 页码 |
| page_size | 20 | 否 | string | 页面大小(每页条数) |
- 返回值:
| 参数名 | 参数值 | 参数类型 | 描述说明 |
| ------------- | ------------------------------------------------- | -------- | ------------------------ |
| uid | 1 | int | 自增 |
| video_hash | 38fb463b135fa12534104f85492cc6f1 | string | 视频哈希值 |
| record_time | 2023-05-26 13:09:05 | string | 记录仪时间 |
| police_id | 00000001 | string | 警号 |
| event_type | 1 | string | 事件类型 |
| is_violation | true | bool | 是否违规 |
| small_image | http://192.168.0.47:8000/media/images/0000609.jpg | string | 缩略图 |
| relative_time | 4.0 | float | 相对时间 |
| video_dir | http://192.168.0.47:8000/media/video/B1.MP4 | string | 视频地址 |
| car_number | 苏a045689 | string | 车牌号 |
| ai_analysis | 违规 | string | 分析结果 |
| add_time | 2023-05-31 18:42:15 | string | 记录添加时间(自动添加) |
| update_time | 2023-05-31 18:42:15 | string | 记录更新时间(自动添加) |
| is_display | true | bool | 是否展示(自动添加) |
</details>
<details>
<summary>查询所有</summary>
- 请求方式GET
- 请求链接http://127.0.0.1:8002/api/
- 可选参数:
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| --------- | ------ | -------- | -------- | -------------------- |
| page | 1 | 否 | string | 页码 |
| page_size | 20 | 否 | string | 页面大小(每页条数) |
- 返回值
| 参数名 | 参数值 | 参数类型 | 描述说明 |
| ------------- | ------------------------------------------------- | -------- | ------------------------ |
| uid | 1 | int | 自增 |
| video_hash | 38fb463b135fa12534104f85492cc6f1 | string | 视频哈希值 |
| record_time | 2023-05-26 13:09:05 | string | 记录仪时间 |
| police_id | 00000001 | string | 警号 |
| event_type | 1 | string | 事件类型 |
| is_violation | true | bool | 是否违规 |
| small_image | http://192.168.0.47:8000/media/images/0000609.jpg | string | 缩略图 |
| relative_time | 4.0 | float | 相对时间 |
| video_dir | http://192.168.0.47:8000/media/video/B1.MP4 | string | 视频地址 |
| car_number | 苏a045689 | string | 车牌号 |
| ai_analysis | 违规 | string | 分析结果 |
| add_time | 2023-05-31 18:42:15 | string | 记录添加时间(自动添加) |
| update_time | 2023-05-31 18:42:15 | string | 记录更新时间(自动添加) |
| is_display | true | bool | 是否展示(自动添加) |
</details>
<details>
<summary>新增数据</summary>
- 请求方式POST
- 请求链接http://127.0.0.1:8002/api/
- 请求body
```json
{
"video_hash": "vbhdrbvcw",
"record_time": "2023-05-26 13:09:05",
"police_id": "00000002",
"event_type": "1",
"is_violation": true,
"small_image": "nvikefrooiwer",
"relative_time": 4.0,
"video_dir": "/d/test",
"car_number": "苏a045689",
"ai_analysis": "违规"
}
```
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| ------------- |---------------------| -------- |----------| ------ |
| video_hash | vbhdrbvcw | 是 | string | 视频哈希 |
| record_time | 2023-05-26 13:09:05 | 是 | datetime | 记录仪时间 |
| police_id | 00000002 | 是 | string | 警号 |
| event_type | 1 | 是 | string | 事件类型 |
| is_violation | true | 是 | bool | 是否违规 |
| small_image | nvikefrooiwer | 是 | string | 缩略图 |
| relative_time | 4.0 | 是 | int | 相对时间 |
| video_dir | /d/test | 是 | string | 视频路径 |
| car_number | 苏a045689 | 是 | string | 车牌号 |
| ai_analysis | 违规 | 是 | string | 分析结果 |
- 返回值
| 参数名 | 参数值 | 参数类型 | 描述说明 |
| ------------- | ------------------------------------------------- | -------- | ------------------------ |
| uid | 1 | int | 自增 |
| video_hash | 38fb463b135fa12534104f85492cc6f1 | string | 视频哈希值 |
| record_time | 2023-05-26 13:09:05 | string | 记录仪时间 |
| police_id | 00000001 | string | 警号 |
| event_type | 1 | string | 事件类型 |
| is_violation | true | bool | 是否违规 |
| small_image | http://192.168.0.47:8000/media/images/0000609.jpg | string | 缩略图 |
| relative_time | 4.0 | float | 相对时间 |
| video_dir | http://192.168.0.47:8000/media/video/B1.MP4 | string | 视频地址 |
| car_number | 苏a045689 | string | 车牌号 |
| ai_analysis | 违规 | string | 分析结果 |
| add_time | 2023-05-31 18:42:15 | string | 记录添加时间(自动添加) |
| update_time | 2023-05-31 18:42:15 | string | 记录更新时间(自动添加) |
| is_display | true | bool | 是否展示(自动添加) |
</details>
<details>
<summary>修改数据</summary>
- 请求方式put
- 请求链接http://127.0.0.1:8002/api/20/
- 请求body
```json
{
"video_hash": "vbhdrbvcw",
"record_time": "2023-05-26 13:09:05",
"police_id": "00000002",
"event_type": "1",
"is_violation": true,
"small_image": "nvikefrooiwer",
"relative_time": 4.0,
"video_dir": "/d/test",
"car_number": "苏a045689",
"ai_analysis": "违规"
}
```
| 参数名 | 参数值 | 是否必填 | 参数类型 | 描述说明 |
| ------------- |---------------------| -------- |-----|-------|
| video_hash | vbhdrbvcw | 是 | string | 视频哈希 |
| record_time | 2023-05-26 13:09:05 | 是 | string | 记录仪时间 |
| police_id | 00000002 | 是 | string | 警号 |
| event_type | 1 | 是 | string | 事件类型 |
| is_violation | true | 是 | bool | 是否违规 |
| small_image | nvikefrooiwer | 是 | string | 缩略图 |
| relative_time | 4.0 | 是 | float | 相对时间 |
| video_dir | /d/test | 是 | string | 视频路径 |
| car_number | 苏a045689 | 是 | string | 车牌号 |
| ai_analysis | 违规 | 是 | string | 分析结果 |
- 备注操作会修改uid为20的数据
- 返回值:
| 参数名 | 参数值 | 参数类型 | 描述说明 |
| ------------- | ------------------------------------------------- | -------- | ---------------------- |
| uid | 1 | int | 自增 |
| video_hash | 38fb463b135fa12534104f85492cc6f1 | string | 视频哈希值 |
| record_time | 2023-05-26 13:09:05 | string | 记录仪时间 |
| police_id | 00000001 | string | 警号 |
| event_type | 1 | string | 事件类型 |
| is_violation | true | bool | 是否违规 |
| small_image | http://192.168.0.47:8000/media/images/0000609.jpg | string | 缩略图 |
| relative_time | 4.0 | float | 相对时间 |
| video_dir | http://192.168.0.47:8000/media/video/B1.MP4 | string | 视频地址 |
| car_number | 苏a045689 | string | 车牌号 |
| ai_analysis | 违规 | string | 分析结果 |
| add_time | 2023-05-31 18:42:15 | string | 记录添加时间(自动添加) |
| update_time | 2023-05-31 18:42:15 | string | 记录更新时间(自动添加) |
| is_display | true | bool | 是否展示(自动添加) |
</details>
<details>
<summary>删除数据</summary>
- 请求方式delete
- 请求链接http://127.0.0.1:8002/api/20/
- 备注操作会删除uid为20的数据
- 返回值:
| 参数名 | 参数值 | 参数类型 | 描述说明 |
| ------------- | ------------------------------------------------- | -------- | ------------------------ |
| uid | 1 | int | 自增 |
| video_hash | 38fb463b135fa12534104f85492cc6f1 | string | 视频哈希值 |
| record_time | 2023-05-26 13:09:05 | string | 记录仪时间 |
| police_id | 00000001 | string | 警号 |
| event_type | 1 | string | 事件类型 |
| is_violation | true | bool | 是否违规 |
| small_image | http://192.168.0.47:8000/media/images/0000609.jpg | string | 缩略图 |
| relative_time | 4.0 | float | 相对时间 |
| video_dir | http://192.168.0.47:8000/media/video/B1.MP4 | string | 视频地址 |
| car_number | 苏a045689 | string | 车牌号 |
| ai_analysis | 违规 | string | 分析结果 |
| add_time | 2023-05-31 18:42:15 | string | 记录添加时间(自动添加) |
| update_time | 2023-05-31 18:42:15 | string | 记录更新时间(自动添加) |
| is_display | true | bool | 是否展示(自动添加) |
</details>