Skip to content

Instantly share code, notes, and snippets.

@dubeboy
Created September 15, 2019 20:36
Show Gist options
  • Save dubeboy/9c76d4b8ea68245496509a500673ba29 to your computer and use it in GitHub Desktop.
Save dubeboy/9c76d4b8ea68245496509a500673ba29 to your computer and use it in GitHub Desktop.
package za.co.dubedivine.groceryapp.data.remote
import retrofit2.Call
import retrofit2.http.*
import za.co.dubedivine.groceryapp.model.GroceryItem
import za.co.dubedivine.groceryapp.model.responseModel.StatusResponseEntity
interface GroceryService {
@GET("groceries")
fun getGroceriesList(): Call<List<GroceryItem>>
@PUT("groceries")
fun addGroceryItem(@Body groceryItem: GroceryItem): Call<StatusResponseEntity<GroceryItem>>
@DELETE("groceries/{id}")
fun deleteGroceryItem(@Path("id") id: Long): Call<StatusResponseEntity<Boolean>>
@POST("groceries/available")
fun toggleGroceryItemAvailability(@Body availability: Boolean, @Query("id") id: Long): Call<StatusResponseEntity<Boolean>>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment