package com.capstone.foodify.API; import com.capstone.foodify.Model.Category.Category; import com.capstone.foodify.Model.DistrictWard.DistrictWardResponse; import com.capstone.foodify.Model.Food.Food; import com.capstone.foodify.Model.Food.ImageFood; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.List; import retrofit2.Call; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.http.Body; import retrofit2.http.DELETE; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.Path; import retrofit2.http.Query; public interface FoodApi { Gson gson = new GsonBuilder().setDateFormat("HH:mm:ss dd-MM-yyyy").create(); FoodApi apiService = new Retrofit.Builder() .baseUrl("https://63eb52abbfdd4299674540d4.mockapi.io/api/v1/").addConverterFactory(GsonConverterFactory.create(gson)) .build() .create(FoodApi.class); @GET("randomProduct") Call> bestFoodResponse(); @GET("recommend") Call> drinksFoodResponse(); @GET("listFood") Call> listFood(@Query("search") String search, @Query("page") int page, @Query("limit") int limit); @GET("listFood") Call> listFood(@Query("page") int page, @Query("limit") int limit); @GET("Category") Call> listCategory(); @GET("Category/{id}/food") Call> listFoodByCategory(@Path("id") String id); @GET("detail/{id}") Call detailFood(@Path("id") String id); @GET("detail/{id}/image") Call> getImageFoodById(@Path("id") String id); @GET("district/{districtId}/ward") Call> wardResponse(@Path("districtId") int district_id); @GET("district") Call> districtResponse(); @GET("wishlist") Call> getListFavoriteFood(); @POST("wishlist") Call addFoodToFavorite(@Body Food food); @DELETE("wishlist/{id}") Call removeFoodFromFavorite(@Path("id") int id); }