feat(file-check): 新增文件资产管理与清理功能,支持上传、查询、删除及下载

This commit is contained in:
hugo committed 2026-07-14 09:14:44 +08:00
1 parent 143e054d86
commit 729546a7b7
52 files changed
+3420 -34

No files matched your search

+10
View File
@@ -367,6 +367,16 @@ class Config:
MINIO_SECURE = os.getenv('MINIO_SECURE', 'false').lower() == 'true'
MINIO_AGENT_GUIDES_BUCKET = os.getenv('MINIO_AGENT_GUIDES_BUCKET', 'agent-guides')
MINIO_PUBLIC_BASE_URL = os.getenv('MINIO_PUBLIC_BASE_URL', 'http://127.0.0.1:9000')
MINIO_FILE_ASSETS_BUCKET = os.getenv('MINIO_FILE_ASSETS_BUCKET', 'hxops-file-assets')
FILE_ASSET_MAX_SIZE_MB = int(os.getenv('FILE_ASSET_MAX_SIZE_MB', '30'))
FILE_ASSET_TEMP_TTL_HOURS = int(os.getenv('FILE_ASSET_TEMP_TTL_HOURS', '72'))
FILE_ASSET_DOWNLOAD_URL_TTL_SECONDS = int(os.getenv('FILE_ASSET_DOWNLOAD_URL_TTL_SECONDS', '300'))
SHIPPING_NOTICE_INTAKE_TTL_HOURS = int(os.getenv('SHIPPING_NOTICE_INTAKE_TTL_HOURS', '72'))
SHIPPING_NOTICE_PARSE_MAX_ATTEMPTS = int(os.getenv('SHIPPING_NOTICE_PARSE_MAX_ATTEMPTS', '3'))
SHIPPING_NOTICE_PARSE_WORKER_TIMEOUT_SECONDS = int(
os.getenv('SHIPPING_NOTICE_PARSE_WORKER_TIMEOUT_SECONDS', '300')
)
SHIPPING_NOTICE_PARSER_VERSION = os.getenv('SHIPPING_NOTICE_PARSER_VERSION', 'v1')
class DevelopmentConfig(Config):
+22 -6
View File
@@ -22,9 +22,15 @@ class AppError(Exception):
class ValidationError(AppError):
def __init__(self, message: str = "Invalid request parameters", *, details: dict[str, Any] | None = None):
def __init__(
self,
message: str = "Invalid request parameters",
*,
code: str = "VALIDATION.INVALID_PARAM",
details: dict[str, Any] | None = None,
):
super().__init__(
code="VALIDATION.INVALID_PARAM",
code=code,
message=message,
http_status=400,
details=details or {},
@@ -38,13 +44,23 @@ class UnauthorizedError(AppError):
class ForbiddenError(AppError):
def __init__(self, message: str = "Forbidden"):
super().__init__(code="AUTH.FORBIDDEN", message=message, http_status=403, retryable=False)
def __init__(
self,
message: str = "Forbidden",
*,
code: str = "AUTH.FORBIDDEN",
):
super().__init__(code=code, message=message, http_status=403, retryable=False)
class NotFoundError(AppError):
def __init__(self, message: str = "Resource not found"):
super().__init__(code="RESOURCE.NOT_FOUND", message=message, http_status=404, retryable=False)
def __init__(
self,
message: str = "Resource not found",
*,
code: str = "RESOURCE.NOT_FOUND",
):
super().__init__(code=code, message=message, http_status=404, retryable=False)
class ConflictError(AppError):