{"openapi":"3.0.3","info":{"title":"AI Box - Cloud Platform API Specification","description":"## Display Platform\nThe platform will be delivered with its current display effects and complete functions (excluding 3D model display).\nNo additional secondary development or modification services will be provided.\nFull source code available at SAR 800,000 including 1-year remote deployment support.\n\n## Core Functions\n- Google Earth satellite map display\n- School coordinate addition & overlay display\n- Real-time sensor data display\n- Sensor historical data export\n- AI detection result summary & display\n- Real-time camera video monitoring\n- Early warning process: Initiate → Acknowledge → Arrived → Resolved\n\n## Data Flow (Device → Cloud)\nSensors → LoRaWAN → Base Station → 4G → Cloud Platform\n\n## MQTT Architecture\nBase Station (MQTT Client) → Cloud MQTT Broker → Topic Publish/Subscribe\n\n## Databases\n- Time-Series Database (sensor real-time data)\n- Relational Database (device, user, alarm, config)\n\n## System Architecture (4-Layer)\nPerception Layer → Transmission Layer → Platform Layer → Application Layer\n","version":"1.0.0"},"servers":[{"url":"https://api.yourcloudplatform.com","description":"Cloud Production Server"}],"paths":{"/api/sensor/data/realtime":{"get":{"summary":"Get real-time sensor data","description":"Returns latest sensor monitoring data","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"deviceId":{"type":"string"},"value":{"type":"number"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/api/sensor/data/history":{"get":{"summary":"Export sensor historical data","description":"Query and export historical sensor records","parameters":[{"name":"deviceId","in":"query","required":true,"schema":{"type":"string"}},{"name":"startTime","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"endTime","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"History data or export file"}}}},"/api/ai/detection/results":{"get":{"summary":"Get AI detection summary","responses":{"200":{"description":"AI analysis results list"}}}},"/api/camera/video/stream":{"get":{"summary":"Get real-time camera video stream","parameters":[{"name":"cameraId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Video stream URL or RTSP path"}}}},"/api/alert/process":{"post":{"summary":"Update early warning status","description":"Support Initiate / Acknowledge / Arrived / Resolved","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"alertId":{"type":"string"},"status":{"type":"string","enum":["Initiate","Acknowledge","Arrived","Resolved"]}}}}}},"responses":{"200":{"description":"Status updated successfully"}}}},"/api/map/school/coordinates":{"get":{"summary":"Get all school coordinates for map overlay","responses":{"200":{"description":"Coordinate list (lat, lng, name)"}}}}},"components":{"schemas":{"SensorData":{"type":"object","properties":{"deviceId":{"type":"string"},"type":{"type":"string"},"value":{"type":"number"},"unit":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}},"AlertEvent":{"type":"object","properties":{"alertId":{"type":"string"},"level":{"type":"string"},"location":{"type":"string"},"status":{"type":"string"},"createTime":{"type":"string","format":"date-time"}}},"AIDetectionResult":{"type":"object","properties":{"detectionId":{"type":"string"},"type":{"type":"string"},"result":{"type":"string"},"confidence":{"type":"number"},"timestamp":{"type":"string","format":"date-time"}}}}}}