-
Notifications
You must be signed in to change notification settings - Fork 12
Moshi #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: backend_int
Are you sure you want to change the base?
Moshi #72
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| package com.tip.lunchbox.data.zomato; | ||
|
|
||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| import okhttp3.OkHttpClient; | ||
| import okhttp3.logging.HttpLoggingInterceptor; | ||
| import retrofit2.Retrofit; | ||
|
|
@@ -27,11 +29,11 @@ private static Retrofit getRetrofitClient() { | |
| private static OkHttpClient getOkHttpClient() { | ||
| HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); | ||
| logging.setLevel(HttpLoggingInterceptor.Level.BODY); | ||
|
|
||
| return new OkHttpClient() | ||
| .newBuilder() | ||
| .addInterceptor(new ZomatoApiInterceptor()) | ||
| .addInterceptor(logging) | ||
| .readTimeout(5, TimeUnit.SECONDS) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @epicadk we are not expecting a huge load on the server so I believe we can keep lower socket time out values. But still, I believe the connection time out value can be set as low as 5 seconds but the socket timeout can be dragged a little higher like 10 seconds. What was your reasoning behind setting this as 5 seconds? |
||
| .build(); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,12 +8,12 @@ public class Comment { | |
| @Expose | ||
| private int rating; | ||
| @Expose | ||
| private int zomatoResId; | ||
| private int zomato_res_id; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Camel case!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah moshi requires snake case. |
||
|
|
||
| public Comment(String comment, int rating, String zomatoResId) { | ||
| public Comment(String comment, int rating, String zomato_res_id) { | ||
| this.comment = comment; | ||
| this.rating = rating; | ||
| this.zomatoResId = Integer.parseInt(zomatoResId); | ||
| this.zomato_res_id = Integer.parseInt(zomato_res_id); | ||
| } | ||
|
|
||
| public String getComment() { | ||
|
|
@@ -27,7 +27,7 @@ public int getRating() { | |
|
|
||
|
|
||
| public String getZomatoResId() { | ||
| return "" + zomatoResId; | ||
| return "" + zomato_res_id; | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,14 @@ | ||
| package com.tip.lunchbox.model.server.request; | ||
|
|
||
| import com.google.gson.annotations.Expose; | ||
|
|
||
| public class FavouriteRestaurants { | ||
| @Expose | ||
| private int zomatoResId; | ||
|
|
||
| private int zomato_res_id; | ||
|
|
||
| public String getZomatoResId() { | ||
| return "" + zomatoResId; | ||
| return "" + zomato_res_id; | ||
| } | ||
|
|
||
| public void setZomatoResId(int zomatoResId) { | ||
| this.zomatoResId = zomatoResId; | ||
| public void setZomatoResId(int zomato_res_id) { | ||
| this.zomato_res_id = zomato_res_id; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| package com.tip.lunchbox.model.server.response; | ||
|
|
||
| // Required for Moshi | ||
| @SuppressWarnings("unused") | ||
| public class RefreshResponse { | ||
| String authToken; | ||
| String auth_token; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here also |
||
|
|
||
| public String getAuthToken() { | ||
| return authToken; | ||
| return auth_token; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,17 @@ | ||
| package com.tip.lunchbox.model.server.response; | ||
|
|
||
| import com.google.gson.annotations.Expose; | ||
|
|
||
| // Required for Moshi | ||
| @SuppressWarnings("unused") | ||
| //Response for both signup and login endpoints | ||
| public class Tokens { | ||
| @Expose | ||
| private String authToken; | ||
| @Expose | ||
| private String refreshToken; | ||
| private String auth_token; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are not following the camel case style of writing and because of this build tests are failing. Please fix this |
||
| private String refresh_token; | ||
|
|
||
| public String getAuthToken() { | ||
| return authToken; | ||
| return auth_token; | ||
| } | ||
|
|
||
| public String getRefreshToken() { | ||
| return refreshToken; | ||
| return refresh_token; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the usual dependency version specification style that has been used for others