refactor: optimize backend module

This commit is contained in:
shiyu
2025-12-08 17:46:45 +08:00
parent cf8d10f71c
commit 8f515aaaf4
124 changed files with 6884 additions and 6390 deletions

View File

@@ -0,0 +1,11 @@
from fastapi import Request, status
from fastapi.responses import JSONResponse
async def global_exception_handler(request: Request, exc: Exception):
"""
全局异常处理
"""
return JSONResponse(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
content={"error": "Internal Server Error", "detail": str(exc)},
)