feat:增加博客处理模块

This commit is contained in:
2025-09-22 19:43:16 +08:00
parent c4674749ce
commit f07b23b825
35 changed files with 763 additions and 28 deletions

View File

@@ -35,13 +35,13 @@ async def global_exception_handler(request: Request, call_next):
except SQLAlchemyError as e:
# 记录数据库异常
logger.critical(f"数据库异常: {str(e)}", exc_info=True)
#logger.critical(f"数据库异常: {str(e)}", exc_info=True)
return JSONResponse(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
content={"message": "数据库操作失败", "details": str(e)})
except Exception as e:
# 记录未知异常(带堆栈信息)
logger.critical(f"未知异常: {str(e)}", exc_info=True)
#logger.critical(f"未知异常: {str(e)}", exc_info=True)
return JSONResponse(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
content={"code": 500, "message": "服务器内部错误", "details": str(e)})