@@ -3,10 +3,31 @@ package com.frogobox.kickstart.domain.source.meal
33import com.frogobox.kickstart.domain.model.Meal
44import com.frogobox.kickstart.domain.model.MealResponse
55import com.frogobox.kickstart.common.callback.Resource
6+ import com.frogobox.kickstart.domain.model.Area
7+ import com.frogobox.kickstart.domain.model.Category
8+ import com.frogobox.kickstart.domain.model.CategoryResponse
9+ import com.frogobox.kickstart.domain.model.Ingredient
10+ import com.frogobox.kickstart.domain.model.MealFilter
11+ import com.frogobox.kickstart.domain.source.meal.MealConstant.PATH_API_KEY
12+ import com.frogobox.kickstart.domain.source.meal.MealConstant.QUERY_AREA
13+ import com.frogobox.kickstart.domain.source.meal.MealConstant.QUERY_CATEGORY
14+ import com.frogobox.kickstart.domain.source.meal.MealConstant.QUERY_FIRST_LETTER
15+ import com.frogobox.kickstart.domain.source.meal.MealConstant.QUERY_ID
16+ import com.frogobox.kickstart.domain.source.meal.MealConstant.QUERY_INGREDIENT
17+ import com.frogobox.kickstart.domain.source.meal.MealUrl.URL_CATEGORIES
18+ import com.frogobox.kickstart.domain.source.meal.MealUrl.URL_FILTER
19+ import com.frogobox.kickstart.domain.source.meal.MealUrl.URL_LIST
20+ import com.frogobox.kickstart.domain.source.meal.MealUrl.URL_LOOKUP_MEAL
21+ import com.frogobox.kickstart.domain.source.meal.MealUrl.URL_RANDOM_MEAL
22+ import com.frogobox.kickstart.domain.source.meal.MealUrl.URL_SEARCH_MEAL
623import kotlinx.coroutines.Dispatchers
724import kotlinx.coroutines.flow.Flow
825import kotlinx.coroutines.flow.flow
926import kotlinx.coroutines.flow.flowOn
27+ import retrofit2.Response
28+ import retrofit2.http.GET
29+ import retrofit2.http.Path
30+ import retrofit2.http.Query
1031import javax.inject.Inject
1132import javax.inject.Singleton
1233
@@ -25,6 +46,7 @@ class MealDataSource @Inject constructor(
2546 private val apiService : MealApiService ,
2647) {
2748
49+ // Search meal by name
2850 fun searchMeal (apiKey : String , nameMeal : String ): Flow <Resource <MealResponse <Meal >? >> =
2951 flow {
3052 try {
@@ -41,5 +63,63 @@ class MealDataSource @Inject constructor(
4163 }
4264 }.flowOn(Dispatchers .IO )
4365
66+ // // List all meals by first letter
67+ // fun listAllMeal(
68+ // apiKey: String,
69+ // firstLetter: String,
70+ // ): Response<MealResponse<Meal>>
71+ //
72+ // // Lookup full meal details by id
73+ // fun lookupFullMeal(
74+ // apiKey: String,
75+ // idMeal: String,
76+ // ): Response<MealResponse<Meal>>
77+ //
78+ // // Lookup a single random meal
79+ // fun lookupRandomMeal(
80+ // apiKey: String,
81+ // ): Response<MealResponse<Meal>>
82+ //
83+ // // List all meal categories
84+ // fun listMealCategories(
85+ // apiKey: String,
86+ // ): Response<CategoryResponse>
87+ //
88+ // // List all Categories
89+ // fun listAllCategories(
90+ // apiKey: String,
91+ // query: String,
92+ // ): Response<MealResponse<Category>>
93+ //
94+ // // List all Area
95+ // fun listAllArea(
96+ // apiKey: String,
97+ // query: String,
98+ // ): Response<MealResponse<Area>>
99+ //
100+ // // List all Ingredients
101+ // fun listAllIngredients(
102+ // apiKey: String,
103+ // query: String,
104+ // ): Response<MealResponse<Ingredient>>
105+ //
106+ // // Filter by main ingredient
107+ // fun filterByIngredient(
108+ // apiKey: String,
109+ // ingredient: String,
110+ // ): Response<MealResponse<MealFilter>>
111+ //
112+ // // Filter by Category
113+ // fun filterByCategory(
114+ // apiKey: String,
115+ // category: String,
116+ // ): Response<MealResponse<MealFilter>>
117+ //
118+ // // Filter by Area
119+ // fun filterByArea(
120+ // apiKey: String,
121+ // area: String,
122+ // ): Response<MealResponse<MealFilter>>
123+
44124
45125}
0 commit comments