-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8519f25
commit 6917465
Showing
13 changed files
with
286 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/fu/prm391/sampl/project/model/order/add_to_cart/AddToCartRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package fu.prm391.sampl.project.model.order.add_to_cart; | ||
|
||
import com.google.gson.annotations.Expose; | ||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class AddToCartRequest { | ||
|
||
@SerializedName("productId") | ||
@Expose | ||
private int productId; | ||
|
||
@SerializedName("quantity") | ||
@Expose | ||
private int quantity; | ||
|
||
public AddToCartRequest() { | ||
} | ||
|
||
public AddToCartRequest(int productId, int quantity) { | ||
this.productId = productId; | ||
this.quantity = quantity; | ||
} | ||
|
||
public int getProductId() { | ||
return productId; | ||
} | ||
|
||
public void setProductId(int productId) { | ||
this.productId = productId; | ||
} | ||
|
||
public int getQuantity() { | ||
return quantity; | ||
} | ||
|
||
public void setQuantity(int quantity) { | ||
this.quantity = quantity; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/fu/prm391/sampl/project/model/order/add_to_cart/AddToCartResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package fu.prm391.sampl.project.model.order.add_to_cart; | ||
|
||
import com.google.gson.annotations.Expose; | ||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class AddToCartResponse { | ||
|
||
@SerializedName("message") | ||
@Expose | ||
private String message; | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
app/src/main/java/fu/prm391/sampl/project/remote/service/OrderService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
package fu.prm391.sampl.project.remote.service; | ||
|
||
import fu.prm391.sampl.project.model.order.OrderResponse; | ||
import fu.prm391.sampl.project.model.order.add_to_cart.AddToCartRequest; | ||
import fu.prm391.sampl.project.model.order.add_to_cart.AddToCartResponse; | ||
import retrofit2.Call; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Header; | ||
import retrofit2.http.POST; | ||
|
||
public interface OrderService { | ||
|
||
@GET("order/histories") | ||
Call<OrderResponse> getOrdersHistory(@Header("Authorization") String token); | ||
|
||
@POST("order/add") | ||
Call<AddToCartResponse> addProductToCart(@Header("Authorization") String token, @Body AddToCartRequest addToCartRequest); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="40dp" | ||
android:height="40dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="@color/black"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M7,10l5,5 5,-5z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="40dp" | ||
android:height="40dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="@color/black"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M7,14l5,-5 5,5z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
<vector android:height="24dp" android:tint="#FF0000" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"/> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="30dp" | ||
android:height="30dp" | ||
android:tint="#FF0000" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.