{ "openapi": "3.0.0", "info": { "title": "Device Data Query API", "description": "通过设备ID列表和时间范围查询设备数据的接口文档", "version": "1.0.0" }, "servers": [ { "url": "https://api.example.com", "description": "Production Server" } ], "paths": { "/common/queryDeviceData": { "post": { "summary": "Query device data by device IDs and time range", "description": "根据设备ID列表和时间范围查询Aurora中的设备原始数据,支持跨天查询但时间跨度不能超过7天", "tags": ["CommonController"], "parameters": [ { "name": "Apikey", "in": "header", "required": true, "schema": { "type": "string" }, "description": "API key for authentication, provided by user" }, { "name": "Referer", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Request source domain, must match server's accessControlAllowOrigin config (e.g. https://bilplartform-stg.ifmservice.jp)" } ], "requestBody": { "description": "Query parameters including device IDs and time range", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryDeviceDataParams" } } } }, "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleDataResponse_List_DeviceDataVO" } } } }, "400": { "description": "Bad request - validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleDataResponse" } } } }, "401": { "description": "Unauthorized - invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleDataResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleDataResponse" } } } } } } } }, "components": { "schemas": { "QueryDeviceDataParams": { "type": "object", "required": ["deviceIds", "startTime", "endTime"], "properties": { "deviceIds": { "type": "array", "items": { "type": "string" }, "description": "Device ID list", "example": ["FFFF0001", "FFFF0002"] }, "startTime": { "type": "integer", "format": "int64", "description": "Start time, Unix milliseconds timestamp", "example": 1709870240425 }, "endTime": { "type": "integer", "format": "int64", "description": "End time, Unix milliseconds timestamp (must not exceed 7 days from startTime)", "example": 1709889240425 } } }, "DeviceDataVO": { "type": "object", "properties": { "deviceId": { "type": "string", "description": "Device ID", "example": "FFFF0001" }, "deviceName": { "type": "string", "description": "Device name", "example": "温度传感器" }, "rawData": { "type": "string", "description": "Raw data JSON", "example": "{\"temp\":25.5}" }, "dataValue": { "type": "string", "description": "Device data values, comma-separated", "example": "25.5" }, "receiveTs": { "type": "integer", "format": "int64", "description": "Receive timestamp (milliseconds)", "example": 1709870240425 }, "status": { "type": "string", "description": "Status", "example": "UP" }, "alertLevel": { "type": "string", "description": "Alert level", "example": "1" }, "alertContent": { "type": "string", "description": "Alert content", "example": "温度异常" }, "buildingInfo": { "type": "string", "description": "Building info", "example": "东京建物日本桥ビル" }, "floorInfo": { "type": "string", "description": "Floor info", "example": "3F" }, "spaceInfo": { "type": "string", "description": "Space info", "example": "会議室A" } } }, "SimpleDataResponse": { "type": "object", "properties": { "code": { "type": "integer", "description": "Status code, 0 or 200 indicates success", "example": 0 }, "msg": { "type": "string", "description": "Response message", "example": "success" }, "data": { "description": "Response data (null on error)" }, "errorMap": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Detailed error information", "example": { "deviceIds": "Device ID list is required" } } } }, "SimpleDataResponse_List_DeviceDataVO": { "type": "object", "properties": { "code": { "type": "integer", "description": "Status code, 0 or 200 indicates success", "example": 0 }, "msg": { "type": "string", "description": "Response message", "example": "success" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/DeviceDataVO" } } } } } } }