增加两个批量查询接口

This commit is contained in:
2025-11-16 16:30:26 +08:00
parent bf747e22ce
commit bf1600b385
10 changed files with 1041 additions and 11 deletions

View File

@@ -464,12 +464,12 @@ definitions:
properties:
alarm_code:
$ref: '#/definitions/models.AlarmCode'
alarm_details:
type: string
alarm_summary:
type: string
id:
type: integer
json_details:
type: string
level:
$ref: '#/definitions/models.SeverityLevel'
resolve_method:
@@ -494,6 +494,15 @@ definitions:
pagination:
$ref: '#/definitions/dto.PaginationDTO'
type: object
dto.ListAreaThresholdAlarmResponse:
properties:
list:
items:
$ref: '#/definitions/dto.AreaThresholdAlarmDTO'
type: array
pagination:
$ref: '#/definitions/dto.PaginationDTO'
type: object
dto.ListDeviceCommandLogResponse:
properties:
list:
@@ -503,6 +512,15 @@ definitions:
pagination:
$ref: '#/definitions/dto.PaginationDTO'
type: object
dto.ListDeviceThresholdAlarmResponse:
properties:
list:
items:
$ref: '#/definitions/dto.DeviceThresholdAlarmDTO'
type: array
pagination:
$ref: '#/definitions/dto.PaginationDTO'
type: object
dto.ListFeedUsageRecordResponse:
properties:
list:
@@ -2401,6 +2419,90 @@ paths:
tags:
- 告警管理
/api/v1/alarm/threshold/area:
get:
consumes:
- application/json
description: 根据过滤条件和分页参数查询区域阈值告警列表
parameters:
- description: 按区域主控ID过滤
in: query
name: area_controller_id
type: integer
- description: 按告警等级过滤
enum:
- Debug
- Info
- Warn
- Error
- DPanic
- Panic
- Fatal
in: query
name: level
type: string
x-enum-varnames:
- DebugLevel
- InfoLevel
- WarnLevel
- ErrorLevel
- DPanicLevel
- PanicLevel
- FatalLevel
- description: 排序字段,例如 "id DESC"
in: query
name: order_by
type: string
- in: query
name: page
type: integer
- in: query
name: page_size
type: integer
- description: 按传感器类型过滤
enum:
- 信号强度
- 电池电量
- 温度
- 湿度
- 重量
in: query
name: sensor_type
type: string
x-enum-comments:
SensorTypeBatteryLevel: 电池电量
SensorTypeHumidity: 湿度
SensorTypeSignalMetrics: 信号强度
SensorTypeTemperature: 温度
SensorTypeWeight: 重量
x-enum-descriptions:
- 信号强度
- 电池电量
- 温度
- 湿度
- 重量
x-enum-varnames:
- SensorTypeSignalMetrics
- SensorTypeBatteryLevel
- SensorTypeTemperature
- SensorTypeHumidity
- SensorTypeWeight
produces:
- application/json
responses:
"200":
description: 成功获取区域阈值告警列表
schema:
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/dto.ListAreaThresholdAlarmResponse'
type: object
security:
- BearerAuth: []
summary: 批量查询区域阈值告警
tags:
- 告警管理
post:
consumes:
- application/json
@@ -2499,6 +2601,90 @@ paths:
tags:
- 告警管理
/api/v1/alarm/threshold/device:
get:
consumes:
- application/json
description: 根据过滤条件和分页参数查询设备阈值告警列表
parameters:
- description: 按设备ID过滤
in: query
name: device_id
type: integer
- description: 按告警等级过滤
enum:
- Debug
- Info
- Warn
- Error
- DPanic
- Panic
- Fatal
in: query
name: level
type: string
x-enum-varnames:
- DebugLevel
- InfoLevel
- WarnLevel
- ErrorLevel
- DPanicLevel
- PanicLevel
- FatalLevel
- description: 排序字段,例如 "id DESC"
in: query
name: order_by
type: string
- in: query
name: page
type: integer
- in: query
name: page_size
type: integer
- description: 按传感器类型过滤
enum:
- 信号强度
- 电池电量
- 温度
- 湿度
- 重量
in: query
name: sensor_type
type: string
x-enum-comments:
SensorTypeBatteryLevel: 电池电量
SensorTypeHumidity: 湿度
SensorTypeSignalMetrics: 信号强度
SensorTypeTemperature: 温度
SensorTypeWeight: 重量
x-enum-descriptions:
- 信号强度
- 电池电量
- 温度
- 湿度
- 重量
x-enum-varnames:
- SensorTypeSignalMetrics
- SensorTypeBatteryLevel
- SensorTypeTemperature
- SensorTypeHumidity
- SensorTypeWeight
produces:
- application/json
responses:
"200":
description: 成功获取设备阈值告警列表
schema:
allOf:
- $ref: '#/definitions/controller.Response'
- properties:
data:
$ref: '#/definitions/dto.ListDeviceThresholdAlarmResponse'
type: object
security:
- BearerAuth: []
summary: 批量查询设备阈值告警
tags:
- 告警管理
post:
consumes:
- application/json