Transfered to new version of API (which is more RESTful)

This commit is contained in:
ChronosX88 2019-02-03 20:11:56 +04:00
parent 5bc86ce49a
commit 0a52ef6b42
No known key found for this signature in database
GPG Key ID: 8F92E090A87804AA
2 changed files with 13 additions and 12 deletions

Binary file not shown.

View File

@ -4,6 +4,7 @@ import java.util.List;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query; import retrofit2.http.Query;
import ru.volgorobot.vrcatalog.model.DetailModel; import ru.volgorobot.vrcatalog.model.DetailModel;
import ru.volgorobot.vrcatalog.model.FirstLevelModel; import ru.volgorobot.vrcatalog.model.FirstLevelModel;
@ -12,24 +13,24 @@ import ru.volgorobot.vrcatalog.model.ThirdLevelModel;
public interface VRApi { public interface VRApi {
@GET("/API/Api.php?action=getFirstLevel") @GET("/api/level/1")
Call<List<FirstLevelModel>> getFirstLevel(); Call<List<FirstLevelModel>> getFirstLevel();
@GET("/API/Api.php?action=getSecondLevel") @GET("/api/level/2")
Call<List<SecondLevelModel>> getSecondLevel(@Query("parentTypeID") int parentTypeID); Call<List<SecondLevelModel>> getSecondLevel(@Query("categoryID") int categoryID);
@GET("/API/Api.php?action=getDetailsByParentID") @GET("/api/level/3")
Call<List<ThirdLevelModel>> getDetails(@Query("parentID") int parentID); Call<List<ThirdLevelModel>> getDetails(@Query("subcategoryID") int subcategoryID);
@GET("/API/Api.php?action=getDetailByID") @GET("/api/item/{id}")
Call<List<DetailModel>> getDetailByID(@Query("detailID") int detailID); Call<List<DetailModel>> getDetailByID(@Path("id") int itemID);
@GET("/API/Api.php?action=getCategoryByID") @GET("/api/level/1/{id}")
Call<List<FirstLevelModel>> getCategoryByID(@Query("id") int id); Call<List<FirstLevelModel>> getCategoryByID(@Path("id") int categoryID);
@GET("/API/Api.php?action=getSubCategoryByID") @GET("/api/level/2/{id}")
Call<List<SecondLevelModel>> getSubCategoryByID(@Query("id") int id); Call<List<SecondLevelModel>> getSubCategoryByID(@Path("id") int subcategoryID);
@GET("/API/Api.php?action=getDetailsByName") @GET("/api/item")
Call<List<ThirdLevelModel>> getDetailsByName(@Query("name") String name); Call<List<ThirdLevelModel>> getDetailsByName(@Query("name") String name);
} }