refactor(router): restructure

This commit is contained in:
MingxuanGame
2025-08-11 14:38:45 +00:00
parent 867b99cca5
commit d8c607137a
14 changed files with 36 additions and 33 deletions

25
app/router/v2/misc.py Normal file
View File

@@ -0,0 +1,25 @@
from __future__ import annotations
from datetime import UTC, datetime
from app.config import settings
from .router import router
from pydantic import BaseModel
class Background(BaseModel):
url: str
class BackgroundsResp(BaseModel):
ends_at: datetime = datetime(year=9999, month=12, day=31, tzinfo=UTC)
backgrounds: list[Background]
@router.get("/seasonal-backgrounds", response_model=BackgroundsResp)
async def get_seasonal_backgrounds():
return BackgroundsResp(
backgrounds=[Background(url=url) for url in settings.seasonal_backgrounds]
)