123456789101112131415161718192021222324252627282930313233343536 |
- package com.example.floradex20.interfaces
-
- import com.example.floradex20.models.PlantListss
- import com.example.floradex20.models.UserInfo
- import retrofit2.Call
- import retrofit2.http.*
-
- interface RestApi {
-
- @Headers("Content-Type: application/json")
- @POST("~victor.hernandez17/flowerdex/signup.php")
- fun addUser(@Body userData: UserInfo): Call<UserInfo>
-
- @Headers("Content-Type: application/json")
- @POST("~victor.hernandez17/flowerdex/login.php")
- fun logInUser(@Body UserData: UserInfo): Call<UserInfo>
-
-
- @GET("~victor.hernandez17/flowerdex/listFlowers.php") // /api/v1/plants/
- //Quite el id de la planta para recibir mas cosas
- //Posiblemente se puede overload la funcion para q funcione sin id y con id
- fun getPlants(@Query("user_id") user_id: String): Call<PlantListss>
-
- //El Api Query que se usa cuando se hace un search
- @GET("~victor.hernandez17/flowerdex/listFlowers.php") // /api/v1/plants/search/
- fun getPlantsbyName(@Query("user_id") user_id: String,
- @Query("q") q: String): Call<PlantListss>
-
- //Api query para el filter
- @GET("~victor.hernandez17/flowerdex/listFlowers.php") // api/v1/plants/
- fun getFiltered(@Query("user_id") user_id: String,
- @Query("edible") edible: String,
- @Query("vegetable") vegetable: String,
- @Query("flower_color") color: String,
- @Query("scientific_name") scientificName: String): Call<PlantListss>
- }
|