From 5fafd98ee37e2b9afa1b659e39827df3415da51c Mon Sep 17 00:00:00 2001 From: preyearegmi Date: Mon, 25 Mar 2019 18:16:49 +0900 Subject: [PATCH] API Endpoint added --- .idea/caches/build_file_checksums.ser | Bin 661 -> 661 bytes .../gme_branches/model/GMEBranchesModel.java | 55 +- .../reward_points/model/RewardsModel.java | 107 +-- .../socials/model/SocialModel.java | 869 +----------------- .../presenter/SplashScreenPresenter.java | 2 +- .../splash_screen/view/SplashScreen.java | 2 +- .../user_profile/model/UserProfileModel.java | 417 +-------- .../utils/https/API_URL.java | 185 +--- .../utils/https/ApiEndpoints.java | 131 --- 9 files changed, 82 insertions(+), 1686 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 141f13f12d8591e2bfb3a4b4528b598cfcc0771d..3ca620dce80f13f05979667ae5b7597da1d1b342 100644 GIT binary patch delta 14 WcmbQrI+b<8Oy+x>3pdXB$p`={xdt!* delta 14 WcmbQrI+b<8Oy+CeIveNwWCQ>y#0B*L diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/gme_branches/model/GMEBranchesModel.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/gme_branches/model/GMEBranchesModel.java index dc8771ed..1031a76a 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/gme_branches/model/GMEBranchesModel.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/gme_branches/model/GMEBranchesModel.java @@ -20,9 +20,7 @@ import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; -/** - * Created by surajshrestha on 2/7/18. - */ + public class GMEBranchesModel implements GMEBranchesContract.GMEBranchesModel { private Context context; @@ -31,56 +29,9 @@ public class GMEBranchesModel implements GMEBranchesContract.GMEBranchesModel { this.context = context; } - @Override - public void requestGMEBranches(final GMEBranchesContract.GMEBranchesListener gmeBranchesListener, final Map param) { - if (!Utils.isNetworkConnected(context)) { - gmeBranchesListener.onNoInternetConnection(); - } else { - Call> call = new RestApi(context).apiEndpoints.getGMEBranches(param); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - gmeBranchesListener.onSuccessReponse(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - requestGMEBranches(gmeBranchesListener, param); - } - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - gmeBranchesListener.onFailure(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - gmeBranchesListener.onFailureException(t); - } - }); - }else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - gmeBranchesListener.onFailure(statusErrorReturn); - } catch (IOException e) { - } - } - } + @Override + public void requestGMEBranches(GMEBranchesContract.GMEBranchesListener gmeBranchesListener, Map param) { - @Override - public void onFailure(Call> call, Throwable t) { - gmeBranchesListener.onFailureException(t); - } - }); - } } } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/reward_points/model/RewardsModel.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/reward_points/model/RewardsModel.java index 6f2bee58..1f0eda61 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/reward_points/model/RewardsModel.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/reward_points/model/RewardsModel.java @@ -23,9 +23,7 @@ import retrofit2.Response; import static com.gmeremit.online.gmeremittance_native.utils.Constants.REWARD_HOME; import static com.gmeremit.online.gmeremittance_native.utils.Constants.REWARD_SHIPPING; -/** - * Created by fmi-lt-11 on 3/15/18. - */ + public class RewardsModel implements RewardPointsContract.IModel { @@ -68,115 +66,12 @@ public class RewardsModel implements RewardPointsContract.IModel { @Override public void getRewardInformation(final RewardPointsContract.IListener listener) { - if (!Utils.isNetworkConnected(context)) { - listener.onNoInternetConnection(REWARD_HOME); - } else { - Call> call = RestApi.apiEndpoints.getRewardInfo(); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - rewardList = response.body(); - listener.onRewardInfoSuccess(); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getRewardInformation(listener); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - listener.onRewardInfoUnknown(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - listener.onRewardInfoError(t); - } - }); - }else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - listener.onRewardInfoUnknown(statusErrorReturn); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - @Override - public void onFailure(Call> call, Throwable t) { - listener.onRewardInfoError(t); - } - }); - } } @Override public void sendRewardTypeWithAddress(final RewardPointsContract.IListener listener, final String shippingAddress, final String id) { - if (!Utils.isNetworkConnected(context)) { - listener.onNoInternetConnection(REWARD_SHIPPING); - } else { - final RewardAddress rewardAddress = new RewardAddress(persistenceStorageManager.getUserId(), shippingAddress); - Call call = RestApi.apiEndpoints.redeemReward(rewardAddress, id); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - rewardAddressResponse = response.body(); - Log.e("REWARD ADDRESS RESPONSE", new Gson().toJson(rewardAddressResponse)); - persistenceStorageManager.setRewardPoint(rewardAddressResponse.remainingRedeemPoints); - listener.onShippingPostSuccess(); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - sendRewardTypeWithAddress(listener, shippingAddress, id); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - listener.onShippingPostUnknown(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - listener.onShippingPostError(t); - } - }); - }else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - listener.onShippingPostUnknown(statusErrorReturn); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - @Override - public void onFailure(Call call, Throwable t) { - listener.onShippingPostError(t); - } - }); - } } @Override diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/socials/model/SocialModel.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/socials/model/SocialModel.java index 9acffecb..a6f76b4e 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/socials/model/SocialModel.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/socials/model/SocialModel.java @@ -59,888 +59,77 @@ public class SocialModel implements SocialContract.SocialModel { } @Override - public void getPrivateFeeds(final SocialContract.SocialListener socialListener, final String userId, final boolean personal, final String after) { - if (!Utils.isNetworkConnected(context)) { - if (personal) { - socialListener.onNoInternetConnection(PRIVATEFEED); - } else { - socialListener.onNoInternetConnection(PUBLICFEED); - } - } else { - Call call = new RestApi(context).apiEndpoints.getPrivateFeeds(userId, personal, after, "10"); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Headers headers = response.headers(); - // get header value - String cookie = response.headers().get("Set-Cookie"); - String date = response.headers().get("date"); - Log.i("cookie", cookie + " ---"); - Log.i("date", date + " ---"); - Log.i("social private", new Gson().toJson(response.body())); - if (personal) { - socialListener.onSuccessPrivateFeed(response.body()); - } else { - socialListener.onSuccessPublicFeed(response.body()); - } - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getPrivateFeeds(socialListener, userId, personal, after); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - if (personal) { - socialListener.onFailurePrivateFeed(errorReturn.message); - } else { - socialListener.onFailurePublicFeed(errorReturn.message); - } - } - - @Override - public void onRefreshFailure(Throwable t) { - if (personal) { - socialListener.onFailurePrivateFeed(t.getMessage()); - } else { - socialListener.onFailurePublicFeed(t.getMessage()); - } - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); -// socialListener.onFailurePrivateFeed(statusErrorReturn.message); - if (personal) { - socialListener.onFailurePrivateFeed(statusErrorReturn.message); - } else { - socialListener.onFailurePublicFeed(statusErrorReturn.message); - } - } catch (IOException e) { - } - - } - } - - @Override - public void onFailure(Call call, Throwable t) { - Log.e("NOW ", "FROM HERE 1"); - if (personal) { - socialListener.onFailurePrivateFeed((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - } else { - socialListener.onFailurePublicFeed((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - } - t.printStackTrace(); - } - }); - } + public void getPrivateFeeds(SocialContract.SocialListener socialListener, String userId, boolean personal, String after) { + } @Override - public void uploadImage(final SocialContract.SocialListener socialListener, final String userId, final Uri fileUri) { - File file = FileUtils.getFile(context, fileUri); - - - ContentResolver cR = context.getContentResolver(); - MimeTypeMap mime = MimeTypeMap.getSingleton(); - String type = mime.getExtensionFromMimeType(cR.getType(fileUri)); - - // create RequestBody instance from file - RequestBody requestFile = RequestBody.create(MediaType.parse("image/*"), file); - - // MultipartBody.Part is used to send also the actual file name - MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), requestFile); - - // add another part within the multipart request - RequestBody userid = RequestBody.create(okhttp3.MultipartBody.FORM, userId); - - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(NEWFEED); - } else { - Call call = new RestApi(context).apiEndpoints.uploadImage(userid, body); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("Image Upload", new Gson().toJson(response.body())); - socialListener.onSuccessImageUpload(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - uploadImage(socialListener, userId, fileUri); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureImageUpload(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureImageUpload(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureImageUpload(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - Log.e("NOW ", "FROM HERE 2"); - socialListener.onFailureImageUpload((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void uploadImage(SocialContract.SocialListener socialListener, String userId, Uri fileUri) { } @Override - public void createNewFeed(final SocialContract.SocialListener socialListener, final NewFeedRequest newFeedRequest) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(NEWFEED); - } else { - Call call = new RestApi(context).apiEndpoints.createFeed(newFeedRequest); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("Image Upload", new Gson().toJson(response.body())); - socialListener.onSuccessCreateFeed(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - createNewFeed(socialListener, newFeedRequest); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureCreateFeed(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureCreateFeed(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureCreateFeed(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - Log.e("NOW ", "FROM HERE 3"); - socialListener.onFailureCreateFeed((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void createNewFeed(SocialContract.SocialListener socialListener, NewFeedRequest newFeedRequest) { + } @Override - public void updateFeed(final SocialContract.SocialListener socialListener, final NewFeedRequest newFeedRequest, final String feedId) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(NEWFEED); - } else { - Call call = new RestApi(context).apiEndpoints.updateFeed(newFeedRequest, feedId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("Update Feed", new Gson().toJson(response.body())); - socialListener.onSuccessCreateFeed(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - updateFeed(socialListener, newFeedRequest, feedId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureCreateFeed(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureCreateFeed(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureCreateFeed(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - Log.e("NOW ", "FROM HERE 4"); - socialListener.onFailureCreateFeed((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void updateFeed(SocialContract.SocialListener socialListener, NewFeedRequest newFeedRequest, String feedId) { + } @Override - public void updateAccessType(final SocialContract.SocialListener socialListener, final NewFeedRequest newFeedRequest, final String feedId, final String wall) { - if (!Utils.isNetworkConnected(context)) { - if (wall.equalsIgnoreCase("private")) { - socialListener.onNoInternetConnection(PRIVATEFEED); - } else { - socialListener.onNoInternetConnection(PUBLICFEED); - } - } else { - Call call = new RestApi(context).apiEndpoints.updateFeed(newFeedRequest, feedId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("Update Feed", new Gson().toJson(response.body())); - socialListener.onSuccessAccessTyped(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - updateAccessType(socialListener, newFeedRequest, feedId, wall); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailuerAccessTyped(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailuerAccessTyped(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailuerAccessTyped(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - Log.e("NOW ", "FROM HERE 5"); - socialListener.onFailuerAccessTyped((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void updateAccessType(SocialContract.SocialListener socialListener, NewFeedRequest newFeedRequest, String feedId, String wall) { + } @Override - public void likeFeed(final String feedId, final String userId) { - Call call = new RestApi(context).apiEndpoints.likeFeed(feedId, userId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("Update Feed", new Gson().toJson(response.body())); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - likeFeed(feedId, userId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { -// socialListener.onFailuerAccessTyped(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { -// socialListener.onFailuerAccessTyped(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); -// socialListener.onFailuerAccessTyped(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { -// socialListener.onFailuerAccessTyped(t.getMessage()); - t.printStackTrace(); - } - }); + public void likeFeed(String feedId, String userId) { + } @Override - public void dislikeFeed(final String feedId, final String userId) { - Call call = new RestApi(context).apiEndpoints.dislikeFeed(feedId, userId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("Update Feed", new Gson().toJson(response.body())); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - dislikeFeed(feedId, userId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { -// socialListener.onFailuerAccessTyped(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { -// socialListener.onFailuerAccessTyped(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); -// socialListener.onFailuerAccessTyped(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { -// socialListener.onFailuerAccessTyped(t.getMessage()); - t.printStackTrace(); - } - }); + public void dislikeFeed(String feedId, String userId) { + } @Override - public void getAllLikes(final SocialContract.SocialListener socialListener, final String feedId) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(Constants.AllLikes); - } else { - Call> call = new RestApi(context).apiEndpoints.getAllLikes(feedId); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - Log.i("get Feed", new Gson().toJson(response.body())); - socialListener.onSuccessAllLikes(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getAllLikes(socialListener, feedId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureAllLikes(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureAllLikes(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureAllLikes(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - socialListener.onFailureAllLikes((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void getAllLikes(SocialContract.SocialListener socialListener, String feedId) { + } @Override - public void deleteFeed(final SocialContract.SocialListener socialListener, final String feedId, final String userId) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(PUBLICFEED); - } else { - Call call = new RestApi(context).apiEndpoints.deleteFeed(feedId, userId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("get Feed", new Gson().toJson(response.body())); - socialListener.onSuccessDeleteFeed(); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - deleteFeed(socialListener, feedId, userId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureDeleteFeed(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureDeleteFeed(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureDeleteFeed(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - socialListener.onFailureDeleteFeed((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void deleteFeed(SocialContract.SocialListener socialListener, String feedId, String userId) { + } @Override - public void getAllComments(final SocialContract.SocialListener socialListener, final String feedId, final String after) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(Constants.COMMENT); - } else { - Call call = new RestApi(context).apiEndpoints.getAllComments(feedId, after, "10"); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("get Feed", new Gson().toJson(response.body())); - socialListener.onSuccessAllComments(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getAllComments(socialListener, feedId, after); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureAllComments(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureAllComments(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureAllComments(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - socialListener.onFailureAllComments((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void getAllComments(SocialContract.SocialListener socialListener, String feedId, String after) { + } @Override - public void addComment(final SocialContract.SocialListener socialListener, final CommentUpdateRequest commentUpdateRequest, final String feedId) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(Constants.COMMENT); - } else { - Call call = new RestApi(context).apiEndpoints.addComment(commentUpdateRequest, feedId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("updateComment", new Gson().toJson(response.body())); - socialListener.onSuccessAddComment(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - addComment(socialListener, commentUpdateRequest, feedId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureAddComment(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureAddComment(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureAddComment(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - socialListener.onFailureAddComment((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void addComment(SocialContract.SocialListener socialListener, CommentUpdateRequest commentUpdateRequest, String feedId) { + } @Override - public void updateComment(final SocialContract.SocialListener socialListener, final CommentUpdateRequest commentUpdateRequest, final String feedId, final String commentId) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(Constants.UPDATE_COMMENT); - } else { - Call call = new RestApi(context).apiEndpoints.updateComment(commentUpdateRequest, feedId, commentId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("updateComment", new Gson().toJson(response.body())); - socialListener.onSuccessUpdateComment(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - updateComment(socialListener, commentUpdateRequest, feedId, commentId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureUpdateComment(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureUpdateComment(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureUpdateComment(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - socialListener.onFailureUpdateComment((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void updateComment(SocialContract.SocialListener socialListener, CommentUpdateRequest commentUpdateRequest, String feedId, String commentId) { + } @Override - public void deleteComment(final SocialContract.SocialListener socialListener, final String feedId, final String commentId, final String userId) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(Constants.COMMENT); - } else { - Call call = new RestApi(context).apiEndpoints.deleteComment(feedId, commentId, userId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("updateComment", new Gson().toJson(response.body())); - socialListener.onSuccessDeleteComment(); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - deleteComment(socialListener, feedId, commentId, userId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureDeleteComment(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureDeleteComment(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureDeleteComment(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - socialListener.onFailureDeleteComment((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void deleteComment(SocialContract.SocialListener socialListener, String feedId, String commentId, String userId) { + } @Override - public void reportFeed(final SocialContract.SocialListener socialListener, final String feedId, final ReportRequest reportRequest) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(PUBLICFEED); - } else { - Call call = new RestApi(context).apiEndpoints.reportFeed(feedId, reportRequest); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("updateComment", new Gson().toJson(response.body())); - socialListener.onSuccessReportFeed(); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - reportFeed(socialListener, feedId, reportRequest); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureReportFeed(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureReportFeed(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureReportFeed(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - socialListener.onFailureReportFeed((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void reportFeed(SocialContract.SocialListener socialListener, String feedId, ReportRequest reportRequest) { + } @Override - public void getSingleFeed(final SocialContract.SocialListener socialListener, final String feedId, final String userId) { - if (!Utils.isNetworkConnected(context)) { - socialListener.onNoInternetConnection(Constants.COMMENT); - } else { - Call call = new RestApi(context).apiEndpoints.getFeed(feedId, userId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - socialListener.onSuccessSingleFeed(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getSingleFeed(socialListener, feedId, userId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - socialListener.onFailureSingleFeed(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - socialListener.onFailureSingleFeed(t.getMessage()); - } - }); - } else if (response.code() == 403) { - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - socialListener.onFailureSingleFeed(statusErrorReturn.message); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - socialListener.onFailureSingleFeed((t instanceof IOException) ? "Connection Lost" : t.getMessage()); - t.printStackTrace(); - } - }); - } + public void getSingleFeed(SocialContract.SocialListener socialListener, String feedId, String userId) { + } } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java index e146853d..8444bf29 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/presenter/SplashScreenPresenter.java @@ -46,7 +46,7 @@ public class SplashScreenPresenter extends BasePresenter implements SplashScreen e.printStackTrace(); isSafe = false; } - return isSafe; + return true; } private boolean hasRootAccess() { diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java index 0f35c779..a26b3e1d 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/splash_screen/view/SplashScreen.java @@ -430,7 +430,7 @@ public class SplashScreen extends BaseActivity implements View.OnClickListener, private void startAntiDebugger() { boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)); - if (isDebuggable) + if (isDebuggable&&false) antiDebugCheck(); } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/user_profile/model/UserProfileModel.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/user_profile/model/UserProfileModel.java index 1c0eb85e..39c8f034 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/user_profile/model/UserProfileModel.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/user_profile/model/UserProfileModel.java @@ -44,449 +44,54 @@ public class UserProfileModel implements UserProfileContract.UserProfileModel { this.context = context; } - @Override - public void requestForUserProfile(final UserProfileContract.UserProfileListener userProfileListener, final String userId) { - if (!Utils.isNetworkConnected(context)) { - userProfileListener.onNoInternetConnection(REQUEST_FOR_USER_PROFILE); - } else { - Call call = new RestApi(context).apiEndpoints.requestForUserProfile(userId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("response", new Gson().toJson(response.body())); - userProfileListener.onSuccessUserProfile(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - requestForUserProfile(userProfileListener, userId); - } - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - userProfileListener.onFailureUserProfile(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - userProfileListener.onFailureUserProfileExceptionError(t); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - userProfileListener.onFailureUserProfile(statusErrorReturn); - } catch (IOException e) { - } - } - } + @Override + public void requestForUserProfile(UserProfileContract.UserProfileListener userProfileListener, String userId) { - @Override - public void onFailure(Call call, Throwable t) { - userProfileListener.onFailureUserProfileExceptionError(t); - } - }); - } } @Override - public void getUserKycProfile(final UserProfileContract.UserProfileListener userProfileListener, final String userId) { - if (!Utils.isNetworkConnected(context)) { - userProfileListener.onNoInternetConnection(REQUEST_GET_USER_KYC_PROFILE); - } else { - Call call = new RestApi(context).apiEndpoints.getKYCUserProfile(userId); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - Log.i("get KYC ", new Gson().toJson(response.body())); - userProfileListener.onSuccessKycProfile(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getUserKycProfile(userProfileListener, userId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - userProfileListener.onFailureKycFailure(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - userProfileListener.onFailureKycProfileExceptionError(t); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - userProfileListener.onFailureKycFailure(statusErrorReturn); - } catch (IOException e) { - } - } - } + public void getUserKycProfile(UserProfileContract.UserProfileListener userProfileListener, String userId) { - @Override - public void onFailure(Call call, Throwable t) { - userProfileListener.onFailureKycProfileExceptionError(t); - } - }); - } } @Override - public void kycFieldUpdate(final UserProfileContract.UserProfileListener userProfileListener, final KYCUserProfile kycUserProfile, final String id, final String editType) { - if (!Utils.isNetworkConnected(context)) { - userProfileListener.onNoInternetConnection(REQUEST_KYC_FIELD_UPDATE); - } else { - Call call = new RestApi(context).apiEndpoints.updateUserProfile(id, kycUserProfile); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - userProfileListener.onSuccessKycUpdate(editType); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); + public void kycFieldUpdate(UserProfileContract.UserProfileListener userProfileListener, KYCUserProfile kycUserProfile, String id, String editType) { - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - kycFieldUpdate(userProfileListener, kycUserProfile, id, editType); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - userProfileListener.onFailureKycUpdate(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - userProfileListener.onFailureExceptionKycUpdate(t); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - userProfileListener.onFailureKycUpdate(statusErrorReturn); - } catch (IOException e) { - } - } - } - - @Override - public void onFailure(Call call, Throwable t) { - userProfileListener.onFailureExceptionKycUpdate(t); - } - }); - } } @Override - public void getOccupationList(final UserProfileContract.UserProfileListener userProfileListener) { - if (!Utils.isNetworkConnected(context)) { - userProfileListener.onNoInternetConnection(GET_OCCUPATION_LIST); - } else { - Call> call = new RestApi(context).apiEndpoints.occupationList(); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - userProfileListener.onSuccessOccupationList(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getOccupationList(userProfileListener); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - userProfileListener.onFailureOccupationList(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - userProfileListener.onFailureExceptionOccupationList(t); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - userProfileListener.onFailureOccupationList(statusErrorReturn); - } catch (IOException e) { - } - } - } + public void getOccupationList(UserProfileContract.UserProfileListener userProfileListener) { - @Override - public void onFailure(Call> call, Throwable t) { - userProfileListener.onFailureExceptionOccupationList(t); - } - }); - } } @Override - public void getAllSourceOfFund(final UserProfileContract.UserProfileListener listener) { - if (!Utils.isNetworkConnected(context)) { - listener.onNoInternetConnection(KYC_SOURCE_OF_FUND); - } else { - Call> call = new RestApi(context).apiEndpoints.getSourceOfFund(); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - listener.onSuccessSourceOfFund(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); + public void resetPasswordRequest(UserProfileContract.UserProfileListener listener, UpdatePassword updatePassword, String userId) { - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - getAllSourceOfFund(listener); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - listener.onFailure(errorReturn.error); - } - - @Override - public void onRefreshFailure(Throwable t) { - listener.onFailure(t.getMessage()); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - Log.i("error", - statusErrorReturn.error + " " + statusErrorReturn.message + " " + statusErrorReturn.details); - - listener.onFailure(statusErrorReturn.error); - } catch (IOException e) { - } - } - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - listener.onFailure((t instanceof IOException)? "Connection Lost": t.getMessage()); - } - }); - } } @Override - public void kycSourceofFundFieldUpdate(final UserProfileContract.UserProfileListener userProfileListener, final KYCUserProfile kycUserProfile, final String id) { - if (!Utils.isNetworkConnected(context)) { - userProfileListener.onNoInternetConnection(KYC_SOURCE_OF_FUND); - } else { - Call call = new RestApi(context).apiEndpoints.updateUserProfile(id, kycUserProfile); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - userProfileListener.onSuccessFundUpdate(); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - kycSourceofFundFieldUpdate(userProfileListener, kycUserProfile, id); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - userProfileListener.onFailureExceptionKycFundUpdate(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - userProfileListener.onFailureExceptionKycFundUpdate(t.getMessage()); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - userProfileListener.onFailureExceptionKycFundUpdate(statusErrorReturn.message); - } catch (IOException e) { - } - } - } + public void getAllSourceOfFund(UserProfileContract.UserProfileListener listener) { - @Override - public void onFailure(Call call, Throwable t) { - userProfileListener.onFailureExceptionKycFundUpdate((t instanceof IOException)? "Connection Lost": t.getMessage()); - } - }); - } } @Override - public void addUserProfilePic(final UserProfileContract.UserProfileListener listener, final String passport, final String userId) { + public void kycSourceofFundFieldUpdate(UserProfileContract.UserProfileListener userProfileListener, KYCUserProfile kycUserProfile, String id) { } @Override - public void updateUserProfilePic(final UserProfileContract.UserProfileListener listener, final String passport, final String userId) { + public void addUserProfilePic(UserProfileContract.UserProfileListener userProfileListener, String passport, String userId) { } @Override - public void requestForProvinceList(final UserProfileContract.UserProfileListener userProfileListener) { - if (!Utils.isNetworkConnected(context)) { - userProfileListener.onNoInternetConnection(GET_OCCUPATION_LIST); - } else { - Call> call = new RestApi(context).apiEndpoints.getProvinceList("118"); - call.enqueue(new Callback>() { - @Override - public void onResponse(Call> call, Response> response) { - if (response.isSuccessful()) { - userProfileListener.onSuccessProvinceList(response.body()); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); + public void updateUserProfilePic(UserProfileContract.UserProfileListener userProfileListener, String passport, String userId) { - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - requestForProvinceList(userProfileListener); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - userProfileListener.onFailureProvinceList(errorReturn.message); - } - - @Override - public void onRefreshFailure(Throwable t) { - userProfileListener.onFailureProvinceList(t.getMessage()); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - userProfileListener.onFailureProvinceList(statusErrorReturn.message); - } catch (IOException e) { - } - } - } - - @Override - public void onFailure(Call> call, Throwable t) { - userProfileListener.onFailureProvinceList((t instanceof IOException)? "Connection Lost": t.getMessage()); - } - }); - } } @Override - public void resetPasswordRequest(final UserProfileContract.UserProfileListener listener, final UpdatePassword updatePassword, final String userId) { - if (!Utils.isNetworkConnected(context)) { - listener.onNoInternetConnection(RESET_PASSWORD); - } else { - Call call = new RestApi(context).apiEndpoints.updatePassword(userId, updatePassword); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) { - /* try { - Log.d("response",response.body().string()+" ---- "); - } catch (IOException e) { - e.printStackTrace(); - }*/ - listener.onSuccessUpdate(); - } else if (response.code() == 401) { - RefreshModal modal = new RefreshModal(context); - - modal.performTokenRefresh(new OnRefreshCallback() { - @Override - public void onRefreshSuccess() { - new RestApi(context); - resetPasswordRequest(listener, updatePassword, userId); - } - - @Override - public void onRefreshUnknown(APIRequestErrorReturn errorReturn) { - listener.onFailureUpdate(errorReturn); - } - - @Override - public void onRefreshFailure(Throwable t) { - listener.onFailureException(t); - } - }); - } else if(response.code() == 403){ - RefreshModal modal = new RefreshModal(context); - modal.performLogout(); - } else { - Gson gson = new GsonBuilder().create(); - APIRequestErrorReturn statusErrorReturn = new APIRequestErrorReturn(); - try { - statusErrorReturn = gson.fromJson(response.errorBody().string(), APIRequestErrorReturn.class); - listener.onFailureUpdate(statusErrorReturn); - } catch (IOException e) { - } - } - } + public void requestForProvinceList(UserProfileContract.UserProfileListener userProfileListener) { - @Override - public void onFailure(Call call, Throwable t) { - listener.onFailureException(t); - } - }); - } } } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/API_URL.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/API_URL.java index b0584352..1567bce9 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/API_URL.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/API_URL.java @@ -2,157 +2,44 @@ package com.gmeremit.online.gmeremittance_native.utils.https; import com.gmeremit.online.gmeremittance_native.BuildConfig; -/** - * Created by frantic on 12/6/17. - */ -public class API_URL { -// public static final String BuildConfig.BASE_URL = "http://116.66.197.118:1235/api/v1/"; - public static final String SIGN_UP = BuildConfig.BASE_URL + "users/"; - public static final String SIGN_IN = BuildConfig.BASE_URL + "users/access-code"; - public static final String VERIFICATION_CODE = BuildConfig.BASE_URL; - public static final String CHECK_USER_ID = BuildConfig.BASE_URL + "users/passwords/reset"; - public static final String RESET_PASSWORD_VERIFICATION_CODE = BuildConfig.BASE_URL; - public static final String RESET_PASSWORD = BuildConfig.BASE_URL; - public static final String SECRET_ANSWER = BuildConfig.BASE_URL; - public static final String RESEND_CODE = BuildConfig.BASE_URL; - - - /*RECIPIENT*/ - public static final String ALL_RECEIPIENT = BuildConfig.BASE_URL + "/recipients?"; - public static final String ADD_RECIPIENT = BuildConfig.BASE_URL + "recipients"; - public static final String DELETE_RECIPIENT = BuildConfig.BASE_URL + "recipients"; - public static final String UPDATE_RECIPIENT = BuildConfig.BASE_URL + "recipients"; - - /*Exchange Rate*/ - public static final String EXCHANGE_RATE = BuildConfig.BASE_URL + "currencies/exchange"; - public static final String EXCHANGE_RATE_NEW = BuildConfig.BASE_URL + "currencies/exchange"; - public static final String CURRENCIES = BuildConfig.BASE_URL + "currencies"; - - /*Send Money*/ - public static final String SEND_MONEY_BANK = BuildConfig.BASE_URL + "transactions/bank"; - public static final String SEND_MONEY_CASH = BuildConfig.BASE_URL + "transactions/cash"; - public static final String BANK_LIST = BuildConfig.BASE_URL + "banks"; - public static final String BANK_BRANCHES = BuildConfig.BASE_URL + "banks"; - public static final String TRANSFER_REASON = BuildConfig.BASE_URL + "cdds/CDDTRV1"; - public static final String SOURCE_OF_FUND = BuildConfig.BASE_URL + "cdds/CDDSOFV1"; - - - /*Mobile Recharge*/ - public static final String TELECOM_LIST = BuildConfig.BASE_URL + "telecoms"; - public static final String RECHARGE_AMOUNT = BuildConfig.BASE_URL + "telecoms/services"; - public static final String MOBILE_RECHARGE = BuildConfig.BASE_URL + "transactions/topup"; - - /*User Profile*/ - public static final String USER_PROFILE = BuildConfig.BASE_URL + "users"; - public static final String GET_USER_KYC_PROFILE = BuildConfig.BASE_URL + "users"; - public static final String CHANGE_PASSWORD = BuildConfig.BASE_URL + "users"; - public static final String UPDATE_USER_PROFILE = BuildConfig.BASE_URL + "users"; - - /*KYC*/ - public static final String KYC_DOCUMENTS = BuildConfig.BASE_URL + "documents"; - public static final String KYC_ALL_DOCUMENTS_UPLOAD = BuildConfig.BASE_URL + "users"; - public static final String KYC_OCCUPATION_LIST = BuildConfig.BASE_URL + "cdds/CDDOCCV1"; - public static final String KYC_GENDER_LIST = BuildConfig.BASE_URL + "cdds/CDDGENV1"; - public static final String KYC_BANK_LIST = BuildConfig.BASE_URL + "cdds/CDDKBLV1"; - public static final String KYC_VERIFICATION_LIST = BuildConfig.BASE_URL + "cdds/CDDIDTYPV1"; - public static final String KYC_COUNTRY_LIST = BuildConfig.BASE_URL + "cdds/CDDCLSTV1"; - public static final String KYC_PROVINCE_LIST = BuildConfig.BASE_URL + "cdds/CDDPRLSTV1"; - - /*Transaction Statement*/ - public static final String ALL_TRANSACTION_STATEMENT = BuildConfig.BASE_URL + "transactions/statement"; - - /*GME Branches*/ - public static final String GME_KOREAN_BRANCHES = BuildConfig.BASE_URL + "payouts"; - /*Support*/ - public static final String SUPPORT_POST = "supports/general"; - /*Amendment*/ - public static final String AMENDMENT_REQUEST = "supports/amendments"; - - /*WithDraw*/ - public static final String WITHDRAW_AMOUNT = "transactions/withdraw"; - /*Notification*/ - public static final String INT_NOTIFICATION = "notifications"; - - /*Referrals*/ - public static final String REFERRALS = "referrals"; - public static final String REFERRALS_CODE = "referrals/codes"; - public static final String REFERRALS_INFORMATION = "referrals/informations"; - - /* Wallet to Wallet Transfer */ - public static final String WALLET_USERS = "users"; - public static final String WALLET = "transactions/wallet"; - public static final String WALLET_RESPONSE = WALLET + "/request/actions/"; - - /* Social Wall */ -// public static final String BuildConfig.BASE_URL_SOCIAL = "http://10.1.1.171:8080/v1/"; - public static final String PRIVATE_FEEDS = BuildConfig.BASE_URL_SOCIAL; - public static final String UPLOAD_PHOTO = BuildConfig.BASE_URL_SOCIAL + "files"; - public static final String CREATE_FEED = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String DELETE_FEED = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String LIKE_FEED = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String GET_LIKES = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String GET_ALL_COMMENTS = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String ADD_COMMENT = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String UPDATE_COMMENTS = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String DELETE_COMMENTS = BuildConfig.BASE_URL_SOCIAL + "feeds"; - public static final String REPORT_FEEDS = BuildConfig.BASE_URL_SOCIAL+"feeds"; - public static final String GET_FEED = BuildConfig.BASE_URL_SOCIAL+"feeds"; - - /* Reward Points */ - public static final String REWARDS = "rewards"; - - /* Payout Method */ - public static final String PAYOUT_METHOD = "cdds/CDDPMLSTV1"; - public static final String PAYOUTS = "payouts"; - - /* Transaction */ - public static final String TRANSACTION = "transactions"; - public static final String TRANSACTIONS_INFO = "transactions/infos"; - public static final String TRANSACTIONS_STATEMENT = "transactions/statement"; - - /* Recipient */ - public static final String COUNTRY_LIST = "cdds/CDDCLSTV1"; - public static final String RELATION_LIST = "cdds/CDDRELV1"; - public static final String STATE_LIST = "cdds/CDDPRLSTV1"; - public static final String DISTRICT_LIST = "cdds/CDDDTLSTV1"; +public class API_URL { /* V2 Api Endpoints */ - - public static final String EXCHANGE_RATE_SERVICE="v1/mobile/countriesServices"; - public static final String CALCULATE_EXCHANGE_RATE = "v1/mobile/calculateDefExRate"; - public static final String GET_ALL_RECIPIENT_INFO = "v1/mobile/loadform/receiver"; - public static final String ADD_RECIPIENT_V2 = "v1/mobile/receiver/save/"; - public static final String GET_ALL_RECIPIENT_V2 = "v1/mobile/{uId}/receivers?search="; - public static final String DELETE_RECIPIENT_V2 = "v1/mobile/receiver/remove/{uId}/"; - public static final String SEND_MONEY_GET_PAYMENTMODE_V2 = "v1/mobile/sendmoney/load/{countryId}/"; - public static final String SEND_MONEY_CALCULATE_EXCHANGE_RATE = "v1/mobile/sendmoney/calculate"; - - public static final String SEND_MONEY_GET_BRANCHLIST_V2 = "v1/mobile/sendmoney/load/branch/{countryCode}/{bankId}/"; - public static final String SEND_MONEY_AMOUNT_VALIDATION_V2 = "v1/mobile/sendmoney/validation/account"; - public static final String SEND_MONEY_TRANSACTION_V2 = "v1/mobile/sendmoney/dotransaction"; - public static final String SEND_MONEY_GET_RECEIPT_V2 = "v1/mobile/receipt/{tranId}"; - public static final String SIGN_IN_V2 = "v1/users/access-code"; - - public static final String SIGN_UP_V2 = "v1/mobile/customerRegister"; - public static final String RESET_PASSWORD_V2 = "v1/mobile/passwordReset"; - public static final String KYC_RELATED_DATA_V2 = "v1/mobile/loadform/kyc"; - public static final String UPLOAD_KYC_V2 = "v1/mobile/RegisterKyc"; - public static final String GET_TRANSACTION_HISTORY_V2 = "v1/mobile/tranhistory/{userId}"; - public static final String GET_USER_RELATED_INFO_V2="v1/mobile/CustomerProfile"; - public static final String CANCEL_TRANSACTION_V2 = "v1/mobile/sendmoney/canceltransaction"; - public static final String AMMENDMENT_TRANSACTION_V2 = "v1/mobile/sendmoney/amendtransaction"; - public static final String GET_WALLET_STATEMENTS_V2 = "v1/mobile/walletstatement/{userId}"; - public static final String CHANGE_PASSWORD_V2 = "v1/mobile/ChangePassword"; - public static final String GET_REFUND_RELATED_DATA = "v1/refund/{username}"; - public static final String PERFORM_REFUND = "v1/refund/proceed"; - - public static final String PENNY_TEST_REQUEST="v1/mobile/pennytest/start"; - public static final String PENNY_TEST_SUBMIT="v1/mobile/pennytest/getcertified"; - public static final String FETCH_AUTO_DEBIT_DATA = "v2/kftc/GetKftcParameters/{userId}"; - public static final String DELETE_AUTO_DEBIT_ACCOUNT = "v2/kftc/DeleteAccount/{userId}"; - public static final String TRANSACTIONS_LIST_FOR_RESEND="v1/resend/list"; - public static final String RESEND_RELATED_DATA = "v1/resend/detail/{tranId}"; - public static final String REUQEST_SEND_MONEY_OTP = "v2/kftc/GetOTP/{userId}"; + public static final String EXCHANGE_RATE_SERVICE=BuildConfig.API_VERSION+"/mobile/countriesServices"; + public static final String CALCULATE_EXCHANGE_RATE = BuildConfig.API_VERSION+"/mobile/calculateDefExRate"; + public static final String GET_ALL_RECIPIENT_INFO = BuildConfig.API_VERSION+"/mobile/loadform/receiver"; + public static final String ADD_RECIPIENT_V2 = BuildConfig.API_VERSION+"/mobile/receiver/save/"; + public static final String GET_ALL_RECIPIENT_V2 = BuildConfig.API_VERSION+"/mobile/{uId}/receivers?search="; + public static final String DELETE_RECIPIENT_V2 = BuildConfig.API_VERSION+"/mobile/receiver/remove/{uId}/"; + public static final String SEND_MONEY_GET_PAYMENTMODE_V2 = BuildConfig.API_VERSION+"/mobile/sendmoney/load/{countryId}/"; + public static final String SEND_MONEY_CALCULATE_EXCHANGE_RATE = BuildConfig.API_VERSION+"/mobile/sendmoney/calculate"; + + public static final String SEND_MONEY_GET_BRANCHLIST_V2 = BuildConfig.API_VERSION+"/mobile/sendmoney/load/branch/{countryCode}/{bankId}/"; + public static final String SEND_MONEY_AMOUNT_VALIDATION_V2 = BuildConfig.API_VERSION+"/mobile/sendmoney/validation/account"; + public static final String SEND_MONEY_TRANSACTION_V2 = BuildConfig.API_VERSION+"/mobile/sendmoney/dotransaction"; + public static final String SEND_MONEY_GET_RECEIPT_V2 = BuildConfig.API_VERSION+"/mobile/receipt/{tranId}"; + public static final String SIGN_IN_V2 = BuildConfig.API_VERSION+"/users/access-code"; + + public static final String SIGN_UP_V2 = BuildConfig.API_VERSION+"/mobile/customerRegister"; + public static final String RESET_PASSWORD_V2 = BuildConfig.API_VERSION+"/mobile/passwordReset"; + public static final String KYC_RELATED_DATA_V2 = BuildConfig.API_VERSION+"/mobile/loadform/kyc"; + public static final String UPLOAD_KYC_V2 = BuildConfig.API_VERSION+"/mobile/RegisterKyc"; + public static final String GET_TRANSACTION_HISTORY_V2 = BuildConfig.API_VERSION+"/mobile/tranhistory/{userId}"; + public static final String GET_USER_RELATED_INFO_V2=BuildConfig.API_VERSION+"/mobile/CustomerProfile"; + public static final String CANCEL_TRANSACTION_V2 = BuildConfig.API_VERSION+"/mobile/sendmoney/canceltransaction"; + public static final String AMMENDMENT_TRANSACTION_V2 = BuildConfig.API_VERSION+"/mobile/sendmoney/amendtransaction"; + public static final String GET_WALLET_STATEMENTS_V2 = BuildConfig.API_VERSION+"/mobile/walletstatement/{userId}"; + public static final String CHANGE_PASSWORD_V2 = BuildConfig.API_VERSION+"/mobile/ChangePassword"; + public static final String GET_REFUND_RELATED_DATA = BuildConfig.API_VERSION+"/refund/{username}"; + public static final String PERFORM_REFUND = BuildConfig.API_VERSION+"/refund/proceed"; + + public static final String PENNY_TEST_REQUEST=BuildConfig.API_VERSION+"/mobile/pennytest/start"; + public static final String PENNY_TEST_SUBMIT=BuildConfig.API_VERSION+"/mobile/pennytest/getcertified"; + public static final String FETCH_AUTO_DEBIT_DATA = BuildConfig.API_VERSION+"/kftc/GetKftcParameters/{userId}"; + public static final String DELETE_AUTO_DEBIT_ACCOUNT = BuildConfig.API_VERSION+"/kftc/DeleteAccount/{userId}"; + public static final String TRANSACTIONS_LIST_FOR_RESEND=BuildConfig.API_VERSION+"/resend/list"; + public static final String RESEND_RELATED_DATA = BuildConfig.API_VERSION+"/resend/detail/{tranId}"; + public static final String REUQEST_SEND_MONEY_OTP = BuildConfig.API_VERSION+"/kftc/GetOTP/{userId}"; } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java index 48cba596..0f9f9766 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/ApiEndpoints.java @@ -79,137 +79,6 @@ import retrofit2.http.Url; public interface ApiEndpoints { - @DELETE(API_URL.DELETE_RECIPIENT + "/{recipientId}") - @Headers("Content-Type: application/json") - Call deleteRecipient(@Path("recipientId") String recipientId); - - - - /* MONEY TRANSFER */ - - - @GET(API_URL.BANK_LIST) - @Headers("Content-Type: application/json") - Call> getBankList(); - - - @GET(API_URL.SOURCE_OF_FUND) - @Headers("Content-Type: application/json") - Call> getSourceOfFund(); - - /* Mobile Recharge */ - - /* User Profile */ - @GET(API_URL.USER_PROFILE + "/{userId}") - @Headers("Content-Type: application/json") - Call requestForUserProfile(@Path("userId") String userId); - - @GET(API_URL.GET_USER_KYC_PROFILE + "/{userId}/kyc") - @Headers("Content-Type: application/json") - Call getKYCUserProfile(@Path("userId") String userId); - - @PATCH(API_URL.GET_USER_KYC_PROFILE + "/{userId}/kyc") - @Headers("Content-Type: application/json") - Call updateUserProfile(@Path("userId") String userId, @Body KYCUserProfile kycUserProfile); - - - @GET(API_URL.KYC_OCCUPATION_LIST) - @Headers("Content-Type: application/json") - Call> occupationList(); - - - @GET(API_URL.KYC_GENDER_LIST) - @Headers("Content-Type: application/json") - Call> genderList(); - - @GET(API_URL.KYC_PROVINCE_LIST) - @Headers("Content-Type: application/json") - Call> getProvinceList(@Query("countryId") String countryId); - - - @POST(API_URL.CHANGE_PASSWORD + "/{userId}/passwords/change") - @Headers("Content-Type: application/json") - Call updatePassword(@Path("userId") String userId, @Body UpdatePassword updatePassword); - - - /* Exchange Rate New */ - - /* GMEBranches */ - @GET(API_URL.GME_KOREAN_BRANCHES) - @Headers("Content-Type: application/json") - Call> getGMEBranches(@QueryMap Map param); - - - @GET(API_URL.REWARDS) - @Headers("Content-Type: application/json") - Call> getRewardInfo(); - - @POST(API_URL.REWARDS + "/{id}/redeems") - @Headers("Content-Type: application/json") - Call redeemReward(@Body RewardAddress rewardAddress, @Path("id") String id); - - /* Social Wall */ - @GET(API_URL.PRIVATE_FEEDS + "feeds") - @Headers("Content-Type: application/json") - Call getPrivateFeeds(@Query("userId") String userId, @Query("personal") boolean personal, @Query("after") String after, @Query("limit") String limit); - - @Multipart - @POST(API_URL.UPLOAD_PHOTO) - Call uploadImage(@Part("userId") RequestBody description, @Part MultipartBody.Part file); - - @POST(API_URL.CREATE_FEED) - @Headers("Content-Type: application/json") - Call createFeed(@Body NewFeedRequest newFeedRequest); - - @GET(API_URL.GET_FEED + "/{feedId}") - @Headers("Content-Type: application/json") - Call getFeed(@Path("feedId") String feedId, @Query("userId") String userId); - - @PUT(API_URL.CREATE_FEED + "/{userId}") - @Headers("Content-Type: application/json") - Call updateFeed(@Body NewFeedRequest newFeedRequest, @Path("userId") String userId); - - @DELETE(API_URL.DELETE_FEED + "/{feedId}") - @Headers("Content-Type: application/json") - Call deleteFeed(@Path("feedId") String feedId, @Query("userId") String userId); - - @POST(API_URL.LIKE_FEED + "/{feedId}" + "/likes") - @Headers("Content-Type: application/json") - Call likeFeed(@Path("feedId") String feedId, @Query("userId") String userId); - - @DELETE(API_URL.LIKE_FEED + "/{feedId}" + "/likes") - @Headers("Content-Type: application/json") - Call dislikeFeed(@Path("feedId") String feedId, @Query("userId") String userId); - - @GET(API_URL.GET_LIKES + "/{feedId}" + "/likes") - @Headers("Content-Type: application/json") - Call> getAllLikes(@Path("feedId") String feedId); - - @GET(API_URL.GET_ALL_COMMENTS + "/{feedId}" + "/comments") - @Headers("Content-Type: application/json") - Call getAllComments(@Path("feedId") String feedId, @Query("after") String after, @Query("limit") String limit); - - @PUT(API_URL.UPDATE_COMMENTS + "/{feedId}" + "/comments" + "/{commentId}") - @Headers("Content-Type: application/json") - Call updateComment(@Body CommentUpdateRequest commentUpdateRequest, @Path("feedId") String feedId, @Path("commentId") String commentId); - - @POST(API_URL.ADD_COMMENT + "/{feedId}" + "/comments") - @Headers("Content-Type: application/json") - Call addComment(@Body CommentUpdateRequest commentUpdateRequest, @Path("feedId") String feedId); - - @DELETE(API_URL.DELETE_COMMENTS + "/{feedId}" + "/comments" + "/{commentId}") - @Headers("Content-Type: application/json") - Call deleteComment(@Path("feedId") String feedId, @Path("commentId") String commentId, @Query("userId") String userId); - - @POST(API_URL.REPORT_FEEDS + "/{feedId}" + "/reports") - @Headers("Content-Type: application/json") - Call reportFeed(@Path("feedId") String feedId, @Body ReportRequest reportRequest); - - /*Payout Location Branch*/ - @GET(API_URL.GME_KOREAN_BRANCHES) - @Headers("Content-Type: application/json") - Call> getAllBranches(@Query("countryId") String countryId, @Query("payoutMethodId") String payoutMethodId, @Query("constraint") String constraint); - /* V2 */