feat(fetcher): add data fetcher

This commit is contained in:
MingxuanGame
2025-07-26 16:06:53 +08:00
parent 585cb9d98a
commit cca4a2f1be
13 changed files with 880 additions and 639 deletions

View File

@@ -5,7 +5,8 @@ from datetime import datetime
from app.config import settings
from app.dependencies.database import create_tables, engine
from app.router import api_router, auth_router, signalr_router
from app.dependencies.fetcher import get_fetcher
from app.router import api_router, auth_router, fetcher_router, signalr_router
from fastapi import FastAPI
@@ -17,6 +18,7 @@ from fastapi import FastAPI
async def lifespan(app: FastAPI):
# on startup
await create_tables()
get_fetcher() # 初始化 fetcher
# on shutdown
yield
await engine.dispose()
@@ -25,6 +27,7 @@ async def lifespan(app: FastAPI):
app = FastAPI(title="osu! API 模拟服务器", version="1.0.0", lifespan=lifespan)
app.include_router(api_router, prefix="/api/v2")
app.include_router(signalr_router, prefix="/signalr")
app.include_router(fetcher_router, prefix="/fetcher")
app.include_router(auth_router)