import os import time from typing import Any def get_file_list(dir_path: str) -> None | list[dict[str, str | int | None | Any] | dict[str, str | int]] | list[Any] | int: try: if os.path.isfile(dir_path): return 1 if not os.path.exists(dir_path): raise FileNotFoundError(f"路径不存在: {dir_path}") if not os.path.isdir(dir_path): raise NotADirectoryError(f"不是有效目录: {dir_path}") print(dir_path) items = [] for item in os.listdir(dir_path): full_path = os.path.join(dir_path, item) stat = os.stat(full_path) if os.path.isdir(full_path): items.append({ 'name': item, 'type': '