feat(chat、pay): 增加pay沙盒、移除杂项

This commit is contained in:
xingc
2025-04-16 19:08:09 +08:00
parent e3f28ad67c
commit 124cac88d4
3 changed files with 16 additions and 30 deletions

View File

@@ -41,10 +41,6 @@ def create_app() -> FastAPI:
for router in routers:
app.include_router(router)
if settings.ENVIRONMENT != 'prod':
from fastapi.staticfiles import StaticFiles
app.mount("/uploads", StaticFiles(directory="uploads"), name="uploads")
@app.on_event('startup')
async def startup_event():
redis_conn = await get_cache()
@@ -80,16 +76,16 @@ def create_app() -> FastAPI:
}
)
# @app.exception_handler(Exception)
# async def http_exception_handler(request: Request, exc: Exception):
# await exception_log(request, exc)
# return UJSONResponse(
# status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
# content={
# 'status': status.HTTP_500_INTERNAL_SERVER_ERROR,
# 'data': None,
# 'message': 'Internal server error'
# }
# )
@app.exception_handler(Exception)
async def http_exception_handler(request: Request, exc: Exception):
await exception_log(request, exc)
return UJSONResponse(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
content={
'status': status.HTTP_500_INTERNAL_SERVER_ERROR,
'data': None,
'message': 'Internal server error'
}
)
return app