Convert Flask routes to FastAPI in anime controller

- Convert Flask Blueprint to FastAPI router
- Replace @app.route() with FastAPI route decorators (@router.get, @router.post)
- Update route parameter syntax from <int:id> to {id: int} format
- Convert Flask request object usage to FastAPI Query/Depends parameters
- Update response handling to return dicts instead of Flask jsonify()
- Integrate SeriesApp as business logic layer for anime operations
- Add anime list, search, and rescan endpoints using SeriesApp
- Include anime router in main FastAPI application
- Mark route conversion tasks as completed in web_todo.md
This commit is contained in:
2025-10-05 23:05:37 +02:00
parent 555c39d668
commit e15c0a21e0
3 changed files with 189 additions and 116 deletions

View File

@@ -269,6 +269,10 @@ async def log_requests(request: Request, call_next):
# Add global exception handler
app.add_exception_handler(Exception, global_exception_handler)
# Include API routers
from .web.controllers.api.v1.anime import router as anime_router
app.include_router(anime_router)
# Authentication endpoints
@app.post("/auth/login", response_model=LoginResponse, tags=["Authentication"])
async def login(request_data: LoginRequest, request: Request) -> LoginResponse: