增加两个批量查询接口

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

@@ -146,6 +146,126 @@ const docTemplate = `{
}
},
"/api/v1/alarm/threshold/area": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据过滤条件和分页参数查询区域阈值告警列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"告警管理"
],
"summary": "批量查询区域阈值告警",
"parameters": [
{
"type": "integer",
"description": "按区域主控ID过滤",
"name": "area_controller_id",
"in": "query"
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
],
"type": "string",
"x-enum-varnames": [
"DebugLevel",
"InfoLevel",
"WarnLevel",
"ErrorLevel",
"DPanicLevel",
"PanicLevel",
"FatalLevel"
],
"description": "按告警等级过滤",
"name": "level",
"in": "query"
},
{
"type": "string",
"description": "排序字段,例如 \"id DESC\"",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"enum": [
"信号强度",
"电池电量",
"温度",
"湿度",
"重量"
],
"type": "string",
"x-enum-comments": {
"SensorTypeBatteryLevel": "电池电量",
"SensorTypeHumidity": "湿度",
"SensorTypeSignalMetrics": "信号强度",
"SensorTypeTemperature": "温度",
"SensorTypeWeight": "重量"
},
"x-enum-descriptions": [
"信号强度",
"电池电量",
"温度",
"湿度",
"重量"
],
"x-enum-varnames": [
"SensorTypeSignalMetrics",
"SensorTypeBatteryLevel",
"SensorTypeTemperature",
"SensorTypeHumidity",
"SensorTypeWeight"
],
"description": "按传感器类型过滤",
"name": "sensor_type",
"in": "query"
}
],
"responses": {
"200": {
"description": "成功获取区域阈值告警列表",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListAreaThresholdAlarmResponse"
}
}
}
]
}
}
}
},
"post": {
"security": [
{
@@ -307,6 +427,126 @@ const docTemplate = `{
}
},
"/api/v1/alarm/threshold/device": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据过滤条件和分页参数查询设备阈值告警列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"告警管理"
],
"summary": "批量查询设备阈值告警",
"parameters": [
{
"type": "integer",
"description": "按设备ID过滤",
"name": "device_id",
"in": "query"
},
{
"enum": [
"Debug",
"Info",
"Warn",
"Error",
"DPanic",
"Panic",
"Fatal"
],
"type": "string",
"x-enum-varnames": [
"DebugLevel",
"InfoLevel",
"WarnLevel",
"ErrorLevel",
"DPanicLevel",
"PanicLevel",
"FatalLevel"
],
"description": "按告警等级过滤",
"name": "level",
"in": "query"
},
{
"type": "string",
"description": "排序字段,例如 \"id DESC\"",
"name": "order_by",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "page_size",
"in": "query"
},
{
"enum": [
"信号强度",
"电池电量",
"温度",
"湿度",
"重量"
],
"type": "string",
"x-enum-comments": {
"SensorTypeBatteryLevel": "电池电量",
"SensorTypeHumidity": "湿度",
"SensorTypeSignalMetrics": "信号强度",
"SensorTypeTemperature": "温度",
"SensorTypeWeight": "重量"
},
"x-enum-descriptions": [
"信号强度",
"电池电量",
"温度",
"湿度",
"重量"
],
"x-enum-varnames": [
"SensorTypeSignalMetrics",
"SensorTypeBatteryLevel",
"SensorTypeTemperature",
"SensorTypeHumidity",
"SensorTypeWeight"
],
"description": "按传感器类型过滤",
"name": "sensor_type",
"in": "query"
}
],
"responses": {
"200": {
"description": "成功获取设备阈值告警列表",
"schema": {
"allOf": [
{
"$ref": "#/definitions/controller.Response"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/dto.ListDeviceThresholdAlarmResponse"
}
}
}
]
}
}
}
},
"post": {
"security": [
{
@@ -5454,15 +5694,15 @@ const docTemplate = `{
"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"
},
@@ -5500,6 +5740,20 @@ const docTemplate = `{
}
}
},
"dto.ListAreaThresholdAlarmResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.AreaThresholdAlarmDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListDeviceCommandLogResponse": {
"type": "object",
"properties": {
@@ -5514,6 +5768,20 @@ const docTemplate = `{
}
}
},
"dto.ListDeviceThresholdAlarmResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.DeviceThresholdAlarmDTO"
}
},
"pagination": {
"$ref": "#/definitions/dto.PaginationDTO"
}
}
},
"dto.ListFeedUsageRecordResponse": {
"type": "object",
"properties": {