From 80f53ceddd23b2776c682d5746175f3a646b00a0 Mon Sep 17 00:00:00 2001 From: gme_2 Date: Mon, 25 Mar 2019 17:01:50 +0900 Subject: [PATCH] version changed over all url --- GMERemittance/Api/ApiServiceType.swift | 8 +++++--- GMERemittance/Api/ExchangeRateApiService.swift | 7 ++----- .../Service/AddReciepientServiceType.swift | 4 ++-- .../Module/Auto refund/autoRefundService.swift | 4 ++-- .../Service/AutoDebitService.swift | 4 ++-- .../Service/ForgotPasswordServiceType.swift | 2 +- .../Service/HomeServiceType.swift | 2 +- .../Application Logic/Service/LoginService.swift | 2 +- .../Service/MessageComposeServiceType.swift | 5 ++--- .../Service/KycServiceType.swift | 4 ++-- .../Service/kycForm1ServiceType.swift | 2 +- .../Service/PennyTestServiceType.swift | 4 ++-- .../Service/RegisterServiceType.swift | 2 +- .../Service/ResendServiceType.swift | 3 +-- .../Service/ResendExchangeServiceType.swift | 2 +- .../SendMoneyExchangeRateServiceType.swift | 2 +- .../SendMoneyPaymentModeServiceType.swift | 6 +++--- .../Service/SendMoneyReceiptServiceType.swift | 2 +- .../SendMoneyVerificationServiceType.swift | 2 +- .../Service/SendMoneyCodeServiceType.swift | 2 +- .../Service/TransactionHistoryServiceType.swift | 2 +- .../Service/WalletStatementServiceType.swift | 2 +- .../ProfileChangePasswordViewController.swift | 2 +- GMERemittance/Recipient/ReciepientServcie.swift | 4 ++-- .../SideMenu/SideMenuViewController.swift | 1 - GMERemittance/UrlManager.swift | 16 +++------------- 26 files changed, 41 insertions(+), 55 deletions(-) diff --git a/GMERemittance/Api/ApiServiceType.swift b/GMERemittance/Api/ApiServiceType.swift index 0fe54e60..b861d633 100644 --- a/GMERemittance/Api/ApiServiceType.swift +++ b/GMERemittance/Api/ApiServiceType.swift @@ -10,14 +10,16 @@ import Foundation protocol ApiServiceType { var auth: RestApiMananger {get} - var oldBaseUrl: String {get} var baseUrl: String {get} + var version: String {get} + var baseUrlWithoutVersion: String {get} } extension ApiServiceType { var auth: RestApiMananger {return RestApiMananger.sharedInstance} - var oldBaseUrl: String {return UrlManager.sharedInstance.oldBaseURL} - var baseUrl: String {return UrlManager.sharedInstance.baseURL} + var baseUrl: String {return UrlManager.sharedInstance.baseURL + UrlManager.sharedInstance.version} + var baseUrlWithoutVersion: String {return UrlManager.sharedInstance.baseURL} + var version: String {return UrlManager.sharedInstance.version } } diff --git a/GMERemittance/Api/ExchangeRateApiService.swift b/GMERemittance/Api/ExchangeRateApiService.swift index e62a1f17..7abbb3ed 100644 --- a/GMERemittance/Api/ExchangeRateApiService.swift +++ b/GMERemittance/Api/ExchangeRateApiService.swift @@ -17,8 +17,7 @@ protocol FetchCountryCurrencyInformation: ApiServiceType { extension FetchCountryCurrencyInformation { func fetchCountryCurrencyInfo(success: @escaping ([ExchangeRateModel]?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/countriesServices" -// let url = "http://www.mocky.io/v2/5b7e22b3300000630084c052" + let url = baseUrl + "/mobile/countriesServices" auth.request(method: .get, url: url , params: nil, success: { (response: ExchangeRateContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -39,9 +38,7 @@ protocol getExchangeRateInformation: ApiServiceType { extension getExchangeRateInformation { func getExchangeRateInformation(params: [String: String], success: @escaping (ExchangeRateDetailModel?) -> (), failure: @escaping (Error) -> () ) { - let url = oldBaseUrl + "mobile/calculateDefExRate" -// http://121.156.120.71:5001/api/v1/mobile/countriesServices -// let url = "http://www.mocky.io/v2/5b7e62d2300000690084c117" + let url = baseUrl + "/mobile/calculateDefExRate" auth.request(method: .post, url: url, params: params, success: { (response: ExchangeRateDetailContainer) in if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift b/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift index c6f8cac5..b96df1e5 100644 --- a/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift +++ b/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift @@ -19,7 +19,7 @@ protocol FetchSendMoneyInformation: ApiServiceType { extension FetchSendMoneyInformation { func fetch(success: @escaping (SendMoneyModel?) -> (), failure: @escaping (Error) -> () ) { - let url = oldBaseUrl + "mobile/loadform/receiver" + let url = baseUrl + "/mobile/loadform/receiver" auth.request(method: .get, url: url, params: nil, success: { (response: SendMoneyInformationContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -41,7 +41,7 @@ protocol SaveReciepientService: ApiServiceType { extension SaveReciepientService { func save(model:[String: String], username: String, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/receiver/save/" + username + let url = baseUrl + "/mobile/receiver/save/" + username auth.request(method: .post, url: url, params: model, success: { (response: RecipientContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/Auto refund/autoRefundService.swift b/GMERemittance/Module/Auto refund/autoRefundService.swift index b6d6e70b..57b5f3ff 100644 --- a/GMERemittance/Module/Auto refund/autoRefundService.swift +++ b/GMERemittance/Module/Auto refund/autoRefundService.swift @@ -19,7 +19,7 @@ protocol FetchAutoRefundInfo: ApiServiceType { extension FetchAutoRefundInfo { func fetchAutoRefundInfo(username: String, success: @escaping (AutoRefund) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "refund/\(username)" + let url = baseUrl + "/refund/\(username)" auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: AutoRefundContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -44,7 +44,7 @@ protocol RefundService: ApiServiceType { extension RefundService { func refund(amount: String, userName: String, chargeAmount: String, userId: String, success: @escaping (SuccessMessage?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "refund/proceed" + let url = baseUrl + "/refund/proceed" let params = [ "Username": userName, "Amount": amount, diff --git a/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift b/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift index c95a78fb..d79caa9e 100644 --- a/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift +++ b/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift @@ -28,7 +28,7 @@ protocol FetchAccountList: ApiServiceType { extension FetchAccountList { func fetchAccountList(username: String, success: @escaping (KFTCModel?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "v2/" + "kftc/GetKftcParameters/" + username + let url = baseUrl + "/kftc/GetKftcParameters/" + username auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: KftcAccountContainer) in if (response.errorCode ?? "") == "1" { @@ -54,7 +54,7 @@ protocol DeleteAccountService: ApiServiceType { extension DeleteAccountService { func deleteAccount(username: String, account: Account, success: @escaping () -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "v2/kftc/DeleteAccount/\(username)" + let url = baseUrl + "/kftc/DeleteAccount/\(username)" let params = [ diff --git a/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift b/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift index a5593fd0..a36c5237 100644 --- a/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift +++ b/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift @@ -20,7 +20,7 @@ protocol PasswordResetService: ApiServiceType { extension PasswordResetService { func reset(username: String, dob: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/passwordReset" + let url = baseUrl + "/mobile/passwordReset" let params = ["username": username,"Dob": dob] auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in diff --git a/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift b/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift index e61d65a3..ab38f763 100644 --- a/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift +++ b/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift @@ -21,7 +21,7 @@ protocol UserInfoService: ApiServiceType { extension UserInfoService { func fetchUserInfo(param: [String: String], success: @escaping (User) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/CustomerProfile" + let url = baseUrl + "/mobile/CustomerProfile" auth.request(method: .post, url: url, params: param, success: { (response: UserContainer ) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: AppConstants.emergencyLogoutErrorCode, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift b/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift index 330606a1..b49355cb 100644 --- a/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift +++ b/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift @@ -25,7 +25,7 @@ protocol LoginApiService: ApiServiceType { extension LoginApiService { func _login(userId: String, password: String, success: @escaping (User?) -> (), failure: @escaping (Error) -> ()) { let params = [ "userId": userId, "password": password ] - let url = oldBaseUrl + "users/access-code" + let url = baseUrl + "/users/access-code" auth.request(method: .post, url: url, params: params,needsAuthorization: false, success: { (response: UserContainer ) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift b/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift index b572536d..1b09ab74 100644 --- a/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift +++ b/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift @@ -21,7 +21,7 @@ protocol MessageCancellationRequestApiService: ApiServiceType { extension MessageCancellationRequestApiService { func cancelTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/sendmoney/canceltransaction" + let url = baseUrl + "/mobile/sendmoney/canceltransaction" self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -47,7 +47,7 @@ protocol MessageEditRequestApiService: ApiServiceType { extension MessageEditRequestApiService { func editTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/sendmoney/amendtransaction" + let url = baseUrl + "/mobile/sendmoney/amendtransaction" self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -67,4 +67,3 @@ extension MessageEditRequestApiService { } -///api/v1/mobile/sendmoney/amendtransaction diff --git a/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift b/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift index d740af76..4bc67a40 100644 --- a/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift +++ b/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift @@ -18,11 +18,11 @@ protocol KycServiceType: class, KYCSubmitApiService, UserInfoService { protocol KYCSubmitApiService: ApiServiceType { func submit(param: [String: String], images: [String: Data], success: @escaping (KYCResponse?) -> (), failure: @escaping (Error) -> ()) } -//http://gmeuat.gmeremit.com:5011/api/v1/mobile/RegisterKyc + extension KYCSubmitApiService { func submit(param: [String: String], images: [String: Data], success: @escaping (KYCResponse?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/RegisterKyc" + let url = baseUrl + "/mobile/RegisterKyc" auth.requestMultipart(method: .post, url, parameters: param, images: images, success: { (response: KYCResponseContainer) in if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift b/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift index 2f67ef61..289eda8b 100644 --- a/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift +++ b/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift @@ -20,7 +20,7 @@ protocol FetchKycInformation: ApiServiceType { extension FetchKycInformation { func fetch(success: @escaping (KycModel?) -> (), failure: @escaping (Error) -> () ) { - let url = oldBaseUrl + "mobile/loadform/kyc" + let url = baseUrl + "/mobile/loadform/kyc" auth.request(method: .get, url: url, params: nil, success: { (response: KycModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift b/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift index a90250ec..4b17313d 100644 --- a/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift +++ b/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift @@ -19,7 +19,7 @@ protocol InitiatePennyTestService: ApiServiceType { extension InitiatePennyTestService { func initiate(userId: String, isResendRequest: String?, success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/pennytest/start" + "/\(userId)?reSendCode=\(isResendRequest ?? "N")" + let url = baseUrl + "/mobile/pennytest/start" + "/\(userId)?reSendCode=\(isResendRequest ?? "N")" auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: SuccessMessageContainer) in @@ -48,7 +48,7 @@ protocol SubmitPennyTestService: ApiServiceType { extension SubmitPennyTestService { func submit(params: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/pennytest/getcertified" + let url = baseUrl + "/mobile/pennytest/getcertified" auth.request(method: .post, url: url, params: params, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift b/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift index b7803344..7175dfb4 100644 --- a/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift +++ b/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift @@ -21,7 +21,7 @@ protocol RegisterUserService: ApiServiceType { extension RegisterUserService { func register(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/customerRegister" + let url = baseUrl + "/mobile/customerRegister" auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift b/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift index b840495b..3c71def2 100644 --- a/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift +++ b/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift @@ -20,8 +20,7 @@ protocol FetchResendService: ApiServiceType { extension FetchResendService { func fetchResendService(user: String, param: [String: String]?, success: @escaping ((ResendListModel?) -> ()), failure: @escaping ((Error) -> ())) { -// let url = baseUrl + "v1/resend/list/" + "\(user)" - let url = baseUrl + "v1/resend/list" + let url = baseUrl + "/resend/list" self.auth.request(method: .post, url: url, params: param, success: { (response: ResendListModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/ResendExchange/Application Logic/Service/ResendExchangeServiceType.swift b/GMERemittance/Module/ResendExchange/Application Logic/Service/ResendExchangeServiceType.swift index dae6b9f6..a2dd3214 100644 --- a/GMERemittance/Module/ResendExchange/Application Logic/Service/ResendExchangeServiceType.swift +++ b/GMERemittance/Module/ResendExchange/Application Logic/Service/ResendExchangeServiceType.swift @@ -20,7 +20,7 @@ protocol FetchResendDetailService: ApiServiceType { extension FetchResendDetailService { func fetch(transactionId: String, success: @escaping (ResendDetail?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "v1/resend/detail/" + "\(transactionId)" + let url = baseUrl + "/resend/detail/" + "\(transactionId)" self.auth.request(method: .get, url: url, params: nil, success: { (response: ResendDetailModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift index 3bb2f473..0c521e8a 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift @@ -18,7 +18,7 @@ protocol FetchSendMoneyExchangeRateService: ApiServiceType { extension FetchSendMoneyExchangeRateService { func calculate(params: [String: String], success: @escaping (SendMoneyExchangeRateModel?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/sendmoney/calculate" + let url = baseUrl + "/mobile/sendmoney/calculate" auth.request(method: .post, url: url, params: params, success: { (response: SendMoneyExchangeRateModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift index ce4d8dfd..64022023 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift @@ -20,7 +20,7 @@ protocol FetchSendMoneyPaymentModeService: ApiServiceType { // fetch paymentModeServcie extension FetchSendMoneyPaymentModeService { func fetchInformations(countryCode: String, id: String? , success: @escaping (SendMoneyPaymentModel?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/sendmoney/load/\(countryCode)/?receiver=\(id ?? "")" + let url = baseUrl + "/mobile/sendmoney/load/\(countryCode)/?receiver=\(id ?? "")" auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyPaymentModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -43,7 +43,7 @@ protocol FetchBankBranchService: ApiServiceType { extension FetchBankBranchService { func fetchBranch(countryCode: String, bankId: String, branchName: String, success: @escaping ([SendMoneyBankBranch]) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/sendmoney/load/branch/" + countryCode + "/" + bankId + "/?search=" + branchName + let url = baseUrl + "/mobile/sendmoney/load/branch/" + countryCode + "/" + bankId + "/?search=" + branchName self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyBankBranchContainer) in if (response.errorCode ?? "") == "1" { @@ -66,7 +66,7 @@ protocol ValidateAccountNumberService: ApiServiceType { extension ValidateAccountNumberService { func validate(params: [String: String], success: @escaping () -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/sendmoney/validation/account" + let url = baseUrl + "/mobile/sendmoney/validation/account" self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneyBankBranchContainer) in // can use any container. need to map errorcode and message only if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift index 78f8962f..33678495 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift @@ -20,7 +20,7 @@ protocol FetchSendMoneyRecieptList: ApiServiceType { extension FetchSendMoneyRecieptList { func fetch(transactionId: String, success: @escaping (SendMoneyReciept?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/receipt/" + transactionId + let url = baseUrl + "/mobile/receipt/" + transactionId self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyRecieptContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift index 31ae36a2..f0a5d2f4 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift @@ -20,7 +20,7 @@ protocol SendMoneyVerificationSubmitApi: ApiServiceType { extension SendMoneyVerificationSubmitApi { func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/sendmoney/dotransaction" + let url = baseUrl + "/mobile/sendmoney/dotransaction" self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift index 884d2cf2..aceb12cc 100644 --- a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift +++ b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift @@ -21,7 +21,7 @@ protocol OtpCodeRequestApiService: ApiServiceType { extension OtpCodeRequestApiService { func requestOtp(customerId: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "v2/kftc/GetOTP/\(customerId)" + let url = baseUrl + "/kftc/GetOTP/\(customerId)" auth.request(method: .post, url: url, params: nil, encoding: JSONEncoding.default, success: { (response: SuccessMessageContainer) in diff --git a/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift b/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift index 0c88b345..51e5ce7d 100644 --- a/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift +++ b/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift @@ -19,7 +19,7 @@ protocol FetchTransactionHistoryService: ApiServiceType { extension FetchTransactionHistoryService { func fetchTransactionHistories(user: String, param: [String: String]?, success: @escaping (([TransactionModel]) -> ()), failure: @escaping ((Error) -> ())) { - let url = oldBaseUrl + "mobile/tranhistory/" + "\(user)" + let url = baseUrl + "/mobile/tranhistory/" + "\(user)" self.auth.request(method: .post, url: url, params: param, success: { (response: TransactionModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift b/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift index 8a180712..b45027af 100644 --- a/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift +++ b/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift @@ -19,7 +19,7 @@ protocol FetchWalletStatementService: ApiServiceType { extension FetchWalletStatementService { func fetchWalletStatement(user: String, param: [String: String]?, success: @escaping (([WalletStatement]) -> ()), failure: @escaping ((Error) -> ())) { - let url = oldBaseUrl + "mobile/walletstatement/" + "\(user)" + let url = baseUrl + "/mobile/walletstatement/" + "\(user)" self.auth.request(method: .post, url: url, params: param, success: { (response: WalletStatementContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Profile/ProfileChangePasswordViewController.swift b/GMERemittance/Profile/ProfileChangePasswordViewController.swift index bd0ef72b..babc3d65 100644 --- a/GMERemittance/Profile/ProfileChangePasswordViewController.swift +++ b/GMERemittance/Profile/ProfileChangePasswordViewController.swift @@ -281,7 +281,7 @@ protocol UpdatePasswordService: ApiServiceType { extension UpdatePasswordService { func updatePassword(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/ChangePassword" + let url = baseUrl + "/mobile/ChangePassword" auth.request(method: .post, url: url, params: params, needsAuthorization: true, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Recipient/ReciepientServcie.swift b/GMERemittance/Recipient/ReciepientServcie.swift index 75e7c96b..683e167c 100644 --- a/GMERemittance/Recipient/ReciepientServcie.swift +++ b/GMERemittance/Recipient/ReciepientServcie.swift @@ -19,7 +19,7 @@ protocol FetchRecipientList: ApiServiceType { //http://localhost:9500/api/v1/mobile/sisir@mailinator.com/receivers?search= extension FetchRecipientList { func fetchReciepientList(username: String, success: @escaping (RecipientListWrapperContainer?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/" + username + "/receivers" + let url = baseUrl + "/mobile/" + username + "/receivers" let params = ["search": ""] auth.request(method: .get, url: url, params: params, encoding: URLEncoding.default, success: { (response: RecipientListContainer) in if (response.errorCode ?? "") == "1" { @@ -45,7 +45,7 @@ protocol DeleteRecipientService: ApiServiceType { extension DeleteRecipientService { func deleteRecipient(username: String, reciepient: Recipient, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) { - let url = oldBaseUrl + "mobile/receiver/remove/" + username + "/?receiverId=\(reciepient.recipientId ?? "")" + let url = baseUrl + "/mobile/receiver/remove/" + username + "/?receiverId=\(reciepient.recipientId ?? "")" auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: RecipientContainer) in if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/SideMenu/SideMenuViewController.swift b/GMERemittance/SideMenu/SideMenuViewController.swift index 570fd143..bd7ef94b 100644 --- a/GMERemittance/SideMenu/SideMenuViewController.swift +++ b/GMERemittance/SideMenu/SideMenuViewController.swift @@ -63,7 +63,6 @@ class SideMenuViewController: UIViewController { - // Life Cycle override func viewDidLoad() { diff --git a/GMERemittance/UrlManager.swift b/GMERemittance/UrlManager.swift index 626d32fe..f54eec99 100644 --- a/GMERemittance/UrlManager.swift +++ b/GMERemittance/UrlManager.swift @@ -16,37 +16,27 @@ class UrlManager { static let sharedInstance = UrlManager() // 121.156.120.71:5001 - var oldBaseURL = "" + + var version = "v1" var baseURL = "" let baseSocialURL = "" - // this is old url that mention version in base url itself. - let oldStaggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/v1/" - - let oldLiveServerUrl = "https://mobileapi.gmeremit.com:8002/api/v1/" -// let oldUatServer = "http://gmeuat.gmeremit.com:5012/api/v1/" let oldUatServer = "http://gmeuat.gmeremit.com:5012/api/v1/" - - // this is the new url without mentioning of version let staggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/" - let liveServerUrl = "https://mobileapi.gmeremit.com:8002/api/" -// let uatServer = "http://gmeuat.gmeremit.com:5012/api/" let uatServer = "http://gmeuat.gmeremit.com:5012/api/" init() { switch server { case .uat: - self.oldBaseURL = oldUatServer self.baseURL = uatServer case .stagging: - self.oldBaseURL = oldStaggingServerUrl + self.baseURL = staggingServerUrl case .live: - self.oldBaseURL = oldLiveServerUrl self.baseURL = liveServerUrl } }