Skip to content

Commit

Permalink
Feat: FeedListRepository,SearchFeedListRepository 정의
Browse files Browse the repository at this point in the history
  • Loading branch information
GeonH0 committed Jun 10, 2024
1 parent 52c981f commit 5fcb880
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()
}
}
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 5fcb880

Please sign in to comment.