-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: FeedListRepository,SearchFeedListRepository 정의
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/FeedListRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
HomeCafeRecipes/HomeCafeRecipes/Data/Repositories/SearchFeedListRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |