refactor: restructure main_clean.py with dependency injection and interfaces

Refactor discrete material cleaner to improve maintainability and testability:

- Introduce dependency injection pattern for service components
- Add interfaces (IPageNavigator, IMaterialExtractor, IDeletionChecker)
- Extract PageNavigator service for page navigation logic
- Extract MaterialExtractor service for data extraction
- Extract DatabaseDeletionChecker service for deletion logic
- Add MaterialInfo data model for structured data
- Centralize configuration (CleanerConfig, UIConstants)
- Implement separation of concerns across services layer

Also includes comprehensive execution mechanism documentation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-02-10 14:17:37 +08:00
parent 21f5827cd3
commit 5024384c73
16 changed files with 1661 additions and 346 deletions

7
services/__init__.py Normal file
View File

@@ -0,0 +1,7 @@
"""服务模块 - 实现业务逻辑"""
from services.page_navigator import PageNavigator
from services.material_extractor import MaterialExtractor
from services.deletion_checker import DatabaseDeletionChecker
__all__ = ["PageNavigator", "MaterialExtractor", "DatabaseDeletionChecker"]