人群
# 公共分类
## 增加修改告警规则
### 基本信息
**Path:** /api/warning_rule/
**Method:** POST
**接口描述:**
### 请求参数
**Headers**
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| Content-Type | application/x-www-form-urlencoded | 是 | | |
**Body**
| 参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| warning_name | text | 是 | | 告警规则名称 |
| warning_type | text | 是 | | 告警类型 |
| is_use | text | 否 | | 是否启用 |
| person_number | text | 否 | | 人数 |
| appear_number | text | 否 | | 出现次数 |
| time_interval | text | 否 | | 时间间隔(小时) |
| time_period | text | 否 | | 时间段(小时) |
| trigger_start_time | text | 否 | | 敏感起始时间 |
| trigger_end_time | text | 否 | | 敏感结束时间 |
| id | text | 是 | | 规则id(修改时传递) |
### 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
id | number | 非必须 | | | |
warning_name | string | 非必须 | | | |
warning_level | number | 非必须 | | | |
warning_type | number | 非必须 | | | |
is_use | number | 非必须 | | | |
person_number | number | 非必须 | | | |
appear_number | number | 非必须 | | | |
time_interval | null | 非必须 | | | |
time_period | null | 非必须 | | | |
trigger_start_time | string | 非必须 | | | |
trigger_end_time | string | 非必须 | | | |
create_time | string | 非必须 | | | |
update_time | string | 非必须 | | | |
## 增加修改设备
### 基本信息
**Path:** /api/device/
**Method:** POST
**接口描述:**
### 请求参数
**Headers**
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| Content-Type | application/x-www-form-urlencoded | 是 | | |
**Body**
| 参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| device_name | text | 是 | | 设备名 |
| device_code | text | 否 | | 设备代码 |
| device_api | text | 是 | | 设备接口地址 |
| is_use | text | 否 | | 是否开启 |
| note | text | 否 | | 备注 |
| device_status | text | 否 | | 设备状态 |
| id | text | 否 | | 设备id(修改时传递) |
### 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
id | number | 非必须 | | | |
device_name | string | 非必须 | | | |
device_code | null | 非必须 | | | |
device_api | string | 非必须 | | | |
is_use | number | 非必须 | | | |
device_status | number | 非必须 | | | |
note | null | 非必须 | | | |
create_time | string | 非必须 | | | |
update_time | string | 非必须 | | | |
## 新增检测结果
### 基本信息
**Path:** /api/detect_result/
**Method:** POST
**接口描述:**
### 请求参数
**Headers**
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| Content-Type | application/x-www-form-urlencoded | 是 | | |
**Body**
| 参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| person_id | text | 是 | | 人员id |
| device_id | text | 是 | | 设备id |
| device_name | text | 是 | | 设备名称 |
| appear_time | text | 是 | | 出现时间 |
| picture_path | text | 是 | | 检测结果图片地址 |
### 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
id | number | 非必须 | | | |
person_id | string | 非必须 | | | |
device_id | number | 非必须 | | | |
device_name | string | 非必须 | | | |
appear_time | string | 非必须 | | | |
picture_path | string | 非必须 | | | |
is_ignore | number | 非必须 | | | |
create_time | string | 非必须 | | | |
update_time | string | 非必须 | | | |
## 查询修改告警规则
### 基本信息
**Path:** /api/warning_rule/
**Method:** GET
**接口描述:**
### 请求参数
**Query**
| 参数名称 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ |
| id | 否 | | 规则id(单查时传递) |
### 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
count | number | 非必须 | | | |
next | null | 非必须 | | | |
previous | null | 非必须 | | | |
results | object [] | 非必须 | | | item 类型: object |
├─ id | number | 必须 | | | |
├─ warning_name | string | 必须 | | | |
├─ warning_level | number | 必须 | | | |
├─ warning_type | number | 必须 | | | |
├─ is_use | number | 必须 | | | |
├─ person_number | number | 必须 | | | |
├─ appear_number | number | 必须 | | | |
├─ time_interval | null,number | 必须 | | | |
├─ time_period | null,number | 必须 | | | |
├─ trigger_start_time | string,null | 必须 | | | |
├─ trigger_end_time | string,null | 必须 | | | |
├─ create_time | string | 必须 | | | |
├─ update_time | string | 必须 | | | |
## 查询告警信息
### 基本信息
**Path:** /api/warning_info/
**Method:** GET
**接口描述:**
### 请求参数
**Query**
| 参数名称 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ |
| warning_type | 是 | | 告警规则类型 |
### 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
count | number | 非必须 | | | |
result | object [] | 非必须 | | | item 类型: object |
├─ warning_name | string | 必须 | | | |
├─ picture_path | string | 必须 | | | |
├─ device_name | string | 必须 | | | |
├─ person_id | string | 必须 | | | |
## 查询设备
### 基本信息
**Path:** /api/device/
**Method:** GET
**接口描述:**
### 请求参数
**Query**
| 参数名称 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ |
| id | 否 | id=1 | 查询单个设备详情 |
| page | 否 | | |
| page_size | 是 | | |
### 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
count | number | 非必须 | | | |
next | null | 非必须 | | | |
previous | null | 非必须 | | | |
results | object [] | 非必须 | | | item 类型: object |
├─ id | number | 非必须 | | | |
├─ device_name | string | 非必须 | | | |
├─ device_code | null | 非必须 | | | |
├─ device_api | string | 非必须 | | | |
├─ is_use | number | 非必须 | | | |
├─ device_status | number | 非必须 | | | |
├─ note | null | 非必须 | | | |
├─ create_time | string | 非必须 | | | |
├─ update_time | string | 非必须 | | | |
## 登录
### 基本信息
**Path:** /api/login/
**Method:** POST
**接口描述:**
### 请求参数
**Headers**
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| Content-Type | application/x-www-form-urlencoded | 是 | | |
**Body**
| 参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
| ------------ | ------------ | ------------ | ------------ | ------------ |
| username | text | 是 | | |
| password | text | 是 | | |
### 返回数据