Add HTTP exception helpers and update models

Introduced utils/http/http_exceptions.py with common HTTP exception helpers for FastAPI. Updated main.py to use a global exception handler that logs and hides internal errors. Refined models/README.md to document new models and relationships, including PhysicalFile and UploadSession, and updated DTO and enum documentation. Simplified ThemeResponse in models/color.py. Improved models/download.py with type annotations, index changes, and import optimizations. Fixed a parameter type in clean.py.

Co-Authored-By: 砂糖橘 <54745033+Foxerine@users.noreply.github.com>
This commit is contained in:
2025-12-25 15:48:21 +08:00
parent 44a8959aa5
commit 5835b4c626
6 changed files with 301 additions and 76 deletions

View File

@@ -34,7 +34,7 @@ def parse_args() -> argparse.Namespace:
help='仅列出将要删除的文件,不实际删除')
return parser.parse_args()
def confirm_action(message: str, auto_yes: str = False) -> bool:
def confirm_action(message: str, auto_yes: bool = False) -> bool:
if auto_yes:
return True
return input(f"{message} (y/N): ").lower() == 'y'