85 lines
2.4 KiB
Python
85 lines
2.4 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
|
||
"""
|
||
Core Module
|
||
核心模块
|
||
|
||
提供内容整合的核心服务,通过适配器模式与xhs_spider和document模块交互
|
||
"""
|
||
|
||
# 注意:ContentIntegrationService已移至api.services模块
|
||
# 这里不再导入,以避免与API服务冲突
|
||
|
||
# 导入适配器
|
||
from .xhs_adapter import XHSAdapter, XHSNote, XHSSearchResult
|
||
from .document_adapter import DocumentAdapter, DocumentContent, IntegratedContent
|
||
|
||
# 导入管理器
|
||
from .cookie_manager import CookieManager
|
||
from .media_manager import ImageStorageManager
|
||
|
||
# 导入新增模块
|
||
from .logging_config import setup_logging, get_logger, init_logging_from_env
|
||
from .unified_config import UnifiedConfig, get_unified_config
|
||
from .exceptions import (
|
||
BaseAppException,
|
||
ConfigError, ConfigNotFoundError,
|
||
ValidationError, MissingParameterError, InvalidParameterError,
|
||
ResourceError, ResourceNotFoundError, ResourceExistsError,
|
||
EngineError, EngineNotFoundError, EngineExecutionError, EngineTimeoutError,
|
||
AIError, AIRateLimitError, AIContentFilterError, AIResponseParseError,
|
||
DatabaseError, DatabaseConnectionError,
|
||
FileError, FileUploadError,
|
||
NetworkError,
|
||
AuthError, PermissionDeniedError,
|
||
)
|
||
|
||
# 版本信息
|
||
__version__ = "1.0.0"
|
||
__author__ = "TravelContentCreator Team"
|
||
|
||
# 导出所有公共接口
|
||
__all__ = [
|
||
# 适配器
|
||
'XHSAdapter',
|
||
'DocumentAdapter',
|
||
|
||
# 适配器数据模型
|
||
'XHSNote',
|
||
'XHSSearchResult',
|
||
'DocumentContent',
|
||
'IntegratedContent',
|
||
|
||
# 管理器
|
||
'CookieManager',
|
||
'ImageStorageManager',
|
||
|
||
# 日志
|
||
'setup_logging',
|
||
'get_logger',
|
||
'init_logging_from_env',
|
||
|
||
# 配置
|
||
'UnifiedConfig',
|
||
'get_unified_config',
|
||
|
||
# 异常
|
||
'BaseAppException',
|
||
'ConfigError', 'ConfigNotFoundError',
|
||
'ValidationError', 'MissingParameterError', 'InvalidParameterError',
|
||
'ResourceError', 'ResourceNotFoundError', 'ResourceExistsError',
|
||
'EngineError', 'EngineNotFoundError', 'EngineExecutionError', 'EngineTimeoutError',
|
||
'AIError', 'AIRateLimitError', 'AIContentFilterError', 'AIResponseParseError',
|
||
'DatabaseError', 'DatabaseConnectionError',
|
||
'FileError', 'FileUploadError',
|
||
'NetworkError',
|
||
'AuthError', 'PermissionDeniedError',
|
||
|
||
# 版本信息
|
||
'__version__',
|
||
'__author__'
|
||
]
|
||
|
||
# 注意:ContentIntegrationService及相关模型已移至api.services模块
|