- Add BookmarkState enum with unread, favorite, and archived states - Extend API layer with query parameter filtering for bookmark states - Update Bookmark domain model to match complete API response schema - Implement BookmarkListView with card-based UI and preview images - Add BookmarkListViewModel with state management and error handling - Enhance BookmarkDetailView with meta information and WebView rendering - Create comprehensive DTO mapping for all bookmark fields - Add TabView with state-based bookmark filtering - Implement date formatting utilities for ISO8601 timestamps - Add progress indicators and pull-to-refresh functionality
51 lines
1.8 KiB
Swift
51 lines
1.8 KiB
Swift
import Foundation
|
|
|
|
protocol UseCaseFactory {
|
|
func makeLoginUseCase() -> LoginUseCase
|
|
func makeGetBookmarksUseCase() -> GetBookmarksUseCase
|
|
func makeGetBookmarkUseCase() -> GetBookmarkUseCase
|
|
func makeGetBookmarkArticleUseCase() -> GetBookmarkArticleUseCase
|
|
func makeSaveSettingsUseCase() -> SaveSettingsUseCase
|
|
func makeLoadSettingsUseCase() -> LoadSettingsUseCase
|
|
}
|
|
|
|
class DefaultUseCaseFactory: UseCaseFactory {
|
|
private let tokenProvider = CoreDataTokenProvider()
|
|
private lazy var api: PAPI = API(tokenProvider: tokenProvider)
|
|
private lazy var authRepository: PAuthRepository = AuthRepository(api: api, settingsRepository: SettingsRepository())
|
|
private lazy var bookmarksRepository: PBookmarksRepository = BookmarksRepository(api: api)
|
|
|
|
static let shared = DefaultUseCaseFactory()
|
|
|
|
private init() {}
|
|
|
|
func makeLoginUseCase() -> LoginUseCase {
|
|
LoginUseCase(repository: authRepository)
|
|
}
|
|
|
|
func makeGetBookmarksUseCase() -> GetBookmarksUseCase {
|
|
GetBookmarksUseCase(repository: bookmarksRepository)
|
|
}
|
|
|
|
func makeGetBookmarkUseCase() -> GetBookmarkUseCase {
|
|
GetBookmarkUseCase(repository: bookmarksRepository)
|
|
}
|
|
|
|
func makeGetBookmarkArticleUseCase() -> GetBookmarkArticleUseCase {
|
|
GetBookmarkArticleUseCase(repository: bookmarksRepository)
|
|
}
|
|
|
|
func makeSaveSettingsUseCase() -> SaveSettingsUseCase {
|
|
SaveSettingsUseCase(authRepository: authRepository)
|
|
}
|
|
|
|
func makeLoadSettingsUseCase() -> LoadSettingsUseCase {
|
|
LoadSettingsUseCase(authRepository: authRepository)
|
|
}
|
|
|
|
// Nicht mehr nötig - Token wird automatisch geladen
|
|
func refreshConfiguration() async {
|
|
// Optional: Cache löschen falls nötig
|
|
}
|
|
}
|