Add Category tag to Search Fragment

This commit is contained in:
Nezumi
2023-02-17 13:32:41 +07:00
parent c6935fe52e
commit 5bd3f596a6
5 changed files with 127 additions and 17 deletions
@@ -1,5 +1,6 @@
package com.capstone.foodify.API;
import com.capstone.foodify.Model.Category.Category;
import com.capstone.foodify.Model.Food.Food;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -10,6 +11,7 @@ import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
@@ -30,4 +32,10 @@ public interface FoodApi {
@GET("listFood")
Call<List<Food>> listFood(@Query("search") String search);
@GET("Category")
Call<List<Category>> listCategory();
@GET("Category/{id}/food")
Call<List<Food>> listFoodByCategory(@Path("id") String id);
}