mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-13 07:30:58 +08:00
014a7c0e30
Split the 1446-line services/provider.rs into 5 focused modules: - gemini_auth.rs (250 lines): Gemini authentication type detection - PackyCode, Google OAuth, and generic provider detection - Security flag management for different auth types - live.rs (300 lines): Live configuration operations - LiveSnapshot backup/restore - Reading and writing live config files - Sync current provider to live config - usage.rs (150 lines): Usage script execution - Query and test usage scripts - Format usage results - Validate usage script configuration - endpoints.rs (80 lines): Custom endpoints management - CRUD operations for provider custom endpoints - Last-used timestamp tracking - mod.rs (650 lines): Core provider CRUD and service facade - ProviderService struct with all public methods - Provider add/update/delete/switch operations - Claude model key normalization - Credential extraction and validation All 107 tests pass. This improves maintainability by: - Separating concerns into cohesive modules - Making Gemini-specific logic easier to find and modify - Reducing cognitive load when working on specific features