ReadKeep/readeck/Domain/UseCase/GetCachedArticleUseCase.swift
Ilyas Hallak b9f8e11782 Refactor offline sync to enforce Clean Architecture
Refactorings:
- Extract HTMLImageEmbedder and HTMLImageExtractor utilities
- Create UseCases for cached data access (GetCachedBookmarksUseCase, GetCachedArticleUseCase)
- Create CreateAnnotationUseCase to remove API dependency from ViewModel
- Simplify CachedAsyncImage by extracting helper methods
- Fix Kingfisher API compatibility (Source types, Result handling)
- Add documentation to OfflineCacheSyncUseCase
- Remove unused TestView from production code

Enforces Clean Architecture:
- ViewModels now only use UseCases, no direct Repository or API access
- All data layer access goes through Domain layer
2025-11-30 19:12:51 +01:00

25 lines
559 B
Swift

//
// GetCachedArticleUseCase.swift
// readeck
//
// Created by Ilyas Hallak on 30.11.25.
//
import Foundation
protocol PGetCachedArticleUseCase {
func execute(id: String) -> String?
}
class GetCachedArticleUseCase: PGetCachedArticleUseCase {
private let offlineCacheRepository: POfflineCacheRepository
init(offlineCacheRepository: POfflineCacheRepository) {
self.offlineCacheRepository = offlineCacheRepository
}
func execute(id: String) -> String? {
return offlineCacheRepository.getCachedArticle(id: id)
}
}