diff --git a/HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/FeedListRepository.swift b/HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/FeedListRepository.swift new file mode 100644 index 0000000..6a4856f --- /dev/null +++ b/HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/FeedListRepository.swift @@ -0,0 +1,24 @@ +// +// FeedListRepository.swift +// HomeCafeRecipes +// +// Created by 김건호 on 6/10/24. +// + +import RxSwift + +protocol FeedListRepository { + func fetchRecipes() -> Observable<[Recipe]> +} + +class DefaultFeedListRepository: FeedListRepository { + private let networkService: RecipeFetchService + + init(networkService: RecipeFetchService) { + self.networkService = networkService + } + + func fetchRecipes() -> Observable<[Recipe]> { + return networkService.fetchRecipes() + } +} diff --git a/HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/SearchFeedListRepository.swift b/HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/SearchFeedListRepository.swift new file mode 100644 index 0000000..57b76e2 --- /dev/null +++ b/HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/SearchFeedListRepository.swift @@ -0,0 +1,25 @@ +// +// SearchFeedListRepository.swift +// HomeCafeRecipes +// +// Created by 김건호 on 6/10/24. +// + +import RxSwift + +protocol SearchFeedListRepository { + func searchRecipes(title: String) -> Observable<[Recipe]> +} + +class DefaultSearchFeedRepository: SearchFeedListRepository { + + private let networkService: RecipeFetchService + + init(networkService: RecipeFetchService) { + self.networkService = networkService + } + + func searchRecipes(title: String) -> Observable<[Recipe]> { + return networkService.searchRecipes(title: title) + } +}