83 lines
1.9 KiB
Python
Raw Normal View History

2025-07-15 15:47:47 +08:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
2025-07-08 17:45:40 +08:00
"""
2025-07-15 15:47:47 +08:00
Core Module
核心模块
提供内容整合的核心服务通过适配器模式与xhs_spider和document模块交互
2025-07-08 17:45:40 +08:00
"""
2025-07-15 15:47:47 +08:00
# 导入主要服务
from .content_integration_service import (
ContentIntegrationService,
ProcessingConfig,
ProcessingResult,
ProcessingStats
2025-07-08 17:45:40 +08:00
)
2025-07-15 15:47:47 +08:00
# 导入适配器
from .xhs_adapter import XHSAdapter, XHSNote, XHSSearchResult
from .document_adapter import DocumentAdapter, DocumentContent, IntegratedContent
# 导入管理器
from .cookie_manager import CookieManager
from .media_manager import ImageStorageManager
# 版本信息
__version__ = "1.0.0"
__author__ = "TravelContentCreator Team"
# 导出所有公共接口
2025-07-08 17:45:40 +08:00
__all__ = [
2025-07-15 15:47:47 +08:00
# 主要服务
'ContentIntegrationService',
# 数据模型
'ProcessingConfig',
'ProcessingResult',
'ProcessingStats',
# 适配器
'XHSAdapter',
'DocumentAdapter',
# 适配器数据模型
'XHSNote',
'XHSSearchResult',
'DocumentContent',
'IntegratedContent',
# 管理器
'CookieManager',
'ImageStorageManager',
# 版本信息
'__version__',
'__author__'
2025-07-08 17:45:40 +08:00
]
2025-07-15 15:47:47 +08:00
# 便捷函数
def create_integration_service(cookie_config_path: str = "cookies.json",
media_storage_path: str = "media",
enable_logging: bool = True) -> ContentIntegrationService:
"""
创建内容整合服务实例的便捷函数
Args:
cookie_config_path: Cookie配置文件路径
media_storage_path: 媒体存储路径
enable_logging: 是否启用日志
Returns:
ContentIntegrationService: 内容整合服务实例
"""
return ContentIntegrationService(
cookie_config_path=cookie_config_path,
media_storage_path=media_storage_path,
enable_logging=enable_logging
)
# 添加到导出列表
__all__.append('create_integration_service')