unified_python/main.py

30 lines
625 B
Python
Raw Normal View History

2025-07-18 17:45:06 +08:00
from fastapi import FastAPI
import uvicorn
from src.utils.Log import Log
2025-07-18 13:52:29 +08:00
2025-07-18 17:45:06 +08:00
app = FastAPI(title="yin_home文档")
2025-07-18 13:52:29 +08:00
2025-07-18 17:45:06 +08:00
@app.get('/weather', tags=["获取天气数据"], summary="返回实时天气数据")
def weather():
return {
"code": 200,
"data": {
"city": "上海",
"weather": "多云",
"temperature": "25",
"wind": "南风",
"humidity": "60",
"pressure": "1010",
"update_time": "2021-09-01 12:00:00"
}
}
if __name__ == '__main__':
uvicorn.run(app='main:app', host='0.0.0.0', port=1314, reload=True)