add to cart actions

This commit is contained in:
2017-10-15 17:47:42 +03:00
parent 1b53949ef3
commit 7214dc296c
15 changed files with 124 additions and 213 deletions

View File

@@ -1,6 +1,5 @@
package ch.pizzalink.android.api;
import java.util.ArrayList;
import java.util.HashMap;
import ch.pizzalink.android.model.AddProductToBasketResponseModel;
@@ -10,14 +9,13 @@ import ch.pizzalink.android.model.OrderModel;
import ch.pizzalink.android.model.UserModel;
import ch.pizzalink.android.model.menu.MenuProductModel;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;
/**
* Created by cimenmus on 04/02/2017.
@@ -28,6 +26,7 @@ public interface ApiInterface {
@GET(ApiEndPoints.API_GET_ALL_CATEGORIES)
Call<ResponseArray<CategoryModel>> getAllCategories();
/*
@FormUrlEncoded
@POST(ApiEndPoints.API_REGISTER)
Call<ResponseObject<UserModel>> register(@Field("firstname") String firstname,
@@ -42,6 +41,13 @@ public interface ApiInterface {
@Field("postcode") String postcode,
@Field("country_id") String country_id,
@Field("zone_id") String zone_id);
*/
@FormUrlEncoded
@POST(ApiEndPoints.API_REGISTER)
Call<ResponseObject<UserModel>> register(@FieldMap HashMap<String, Object> body);
@FormUrlEncoded
@POST(ApiEndPoints.API_LOGIN)
@@ -67,174 +73,9 @@ public interface ApiInterface {
@POST(ApiEndPoints.API_GET_PRODUCT)
Call<ResponseArray<MenuProductModel>> getProductById(@Field("product_id") int productId);
@POST(ApiEndPoints.API_ADD_PRODUCTS_TO_BASKET)
Call<ResponseObject<AddProductToBasketResponseModel>> addProductsToBasket(@Body HashMap<String, Object> body);
/*
// default encoded is false
@FormUrlEncoded
@POST(ApiEndPoints.API_ADD_PRODUCTS_TO_BASKET)
Call<ResponseObject<AddProductToBasketResponseModel>> addProductsToBasket(@FieldMap(encoded = true) HashMap<String, Object> fields);
*/
@POST
Call<ResponseObject<AddProductToBasketResponseModel>> addProductsToBasket(@Url String url,
@FieldMap HashMap<String, Object> body);
/*
{
"product_id": "56",
"quantity": "1",
"token": "wXTVshBk2TU4XJmb23wa320zOBRodw4K",
"options": [
{
"optionId" : "232",
"optionValue" : "34"
},
{
"optionId" : "232",
"optionValue" : "33"
},
{
"optionId" : "231",
"optionValue" : "31"
}
]
}
*/
/*
@GET(ApiEndPoints.API_GET_ALL_CATEGORIES)
Call<CategoryListResponseModel> getAllCategories();
@GET(ApiEndPoints.API_GET_ALL_AUTHORS)
Call<AuthorListResponseModel> getAllAuthors();
@GET(ApiEndPoints.API_GET_MAGAZINES)
Call<MagazineListResponseModel> getMagazineList();
@GET(ApiEndPoints.API_GET_MAIN_PAGE_NEWS)
Call<NewsListResponseModel> getMainPageNews();
@GET(ApiEndPoints.API_GET_NEWS_LIST_BY_CATEGORY)
Call<NewsListResponseModel> getNewsListByCategory(@Query("category_id") String categoryId);
@GET(ApiEndPoints.API_GET_NEWS_DETAILS)
Call<NewsDetailsResponseModel> getNewsDetails(@Query("article_id") String articleId);
@GET(ApiEndPoints.API_GET_NEWS_DETAILS)
Call<NewsDetailsResponseModel> getVideoNewsDetails(@Query("article_id") String articleId, @Query("video") String video);
@GET(ApiEndPoints.API_GET_TAGS_OF_NEWS)
Call<NewsDetailsResponseModel> getTagsOfNews(@Query("getTagsByArticle") String articleId);
// NOT : tag ları yazarken boşluk yerine %20 işreti koy
@GET(ApiEndPoints.API_GET_NEWS_LIST_BY_TAG)
Call<NewsListResponseModel> getNewsListByTag(@Query("tag_name") String tagName);
@GET(ApiEndPoints.API_GET_ARTICLES_OF_AUTHOR)
Call<NewsListResponseModel> getArticlesOfAuthor(@Query("author_id") String authorId);
@GET(ApiEndPoints.API_GET_ARTICLE_DETAILS)
Call<NewsDetailsResponseModel> getArticleDetails(@Query("article_id") String articleId);
@GET(ApiEndPoints.API_GET_EVENT_LOCATIONS)
Call<EventLocationListResponseModel> getEventLocations();
@GET(ApiEndPoints.API_GET_CURRENT_EVENTS)
Call<EventListResponseModel> getCurrentEvents();
@GET(ApiEndPoints.API_GET_CURRENT_EVENTS)
Call<EventListResponseModel> getCurrentEvents(@Query("location") String locationName);
@GET(ApiEndPoints.API_GET_UPCOMING_EVENTS)
Call<EventListResponseModel> getUpcomingEvents(@Query("day") String dayCount);
@GET(ApiEndPoints.API_GET_UPCOMING_EVENTS)
Call<EventListResponseModel> getUpcomingEvents(@Query("day") String dayCount, @Query("location") String locationName);
@GET(ApiEndPoints.API_GET_SQUARE_ADS)
Call<AdResponseModel> getSquareAds();
@GET(ApiEndPoints.API_GET_BANNER_ADS)
Call<AdResponseModel> getBannerAds();
@FormUrlEncoded
@POST(ApiEndPoints.API_CUSTOMER_LOGIN)
Call<LoginCustomerResponseModel> loginUser(@Field("email") String email, @Field("password") String password);
@FormUrlEncoded
@POST(ApiEndPoints.API_CUSTOMER_LOG_OUT)
Call<ResponseModel> logoutUser(@Field("token") String customerToken);
@FormUrlEncoded
@POST(ApiEndPoints.API_REGISTER_CUSTOMER)
Call<LoginCustomerResponseModel> registerCustomer(@Field("customer_name") String name, @Field("customer_surname") String surname,
@Field("customer_mail") String email, @Field("customer_phone") String phone,
@Field("customer_password") String password);
@FormUrlEncoded
@POST(ApiEndPoints.API_GET_CUSTOMER_INFO)
Call<CustomerInfoResponseModel> getCustomerInfo(@Field("token") String customerToken);
@FormUrlEncoded
@POST(ApiEndPoints.API_GET_STORE_CUSTOMER_INFO)
Call<StoreCustomerInfoResponseModel> getStoreCustomerInfo(@Field("token") String customerToken);
@FormUrlEncoded
@POST(ApiEndPoints.API_REFRESH_CUSTOMER_TOKEN)
Call<RefreshTokenResponseModel> refreshCustomerToken(@Field("refresh_token") String refreshToken);
@FormUrlEncoded
@POST(ApiEndPoints.API_REFRESH_STORE_CUSTOMER_TOKEN)
Call<RefreshTokenResponseModel> refreshStoreCustomerToken(@Field("refresh_token") String refreshToken);
@FormUrlEncoded
@POST(ApiEndPoints.API_GET_ALL_CAMPAIGNS)
Call<AllCampaignsResponseModel> getAllCampaigns(@Field("token") String customerToken);
@FormUrlEncoded
@POST(ApiEndPoints.API_GET_CAMPAIGN_DETAILS)
Call<AllCampaignsResponseModel> getCampaignDetails(@Field("token") String customerToken,
@Field("campaign_id") String campaignId);
@FormUrlEncoded
@POST(ApiEndPoints.API_GET_CAMPAIGN_LIST_OF_COMPANY)
Call<AllCampaignsResponseModel> getCampaingsOfCompany(@Field("token") String customerToken,
@Field("firm_barcode") String firmBarcode);
@FormUrlEncoded
@POST(ApiEndPoints.API_STORE_CUSTOMER_LOGIN)
Call<LoginStoreCustomerResponseModel> loginStoreCustomer(@Field("username") String email, @Field("password") String password);
@POST(ApiEndPoints.API_CUSTOMER_LOGIN)
Call<LoginCustomerResponseModel> loginUser(@Body HashMap<String, Object> body);
*/
}