diff --git a/main.py b/main.py index b87e1cb..9137a7b 100644 --- a/main.py +++ b/main.py @@ -15,6 +15,7 @@ import asyncio import threading from multiprocessing import Value from fastapi.middleware.cors import CORSMiddleware +import random JUNCTION = 0 RESERVOIR = 1 @@ -1829,3 +1830,15 @@ async def get_json(): ) +############################################################ +# DingZQ, 2024-12-09, Add sample API to return real time data/simulation result +############################################################ +@app.get("/getrealtimedata/") +async def get_realtimedata(): + data = [random.randint(0, 100) for _ in range(100)] + return data + +@app.get("/getsimulationresult/") +async def get_simulationresult(): + data = [random.randint(0, 100) for _ in range(100)] + return data \ No newline at end of file