You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
7.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // UrlManager.swift
  3. // GMERemittance
  4. //
  5. // Created by Sujal on 12/25/17.
  6. // Copyright © 2017 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class UrlManager {
  10. static let sharedInstance = UrlManager()
  11. // 121.156.120.71:5001
  12. var oldBaseURL = ""
  13. var baseURL = ""
  14. let baseSocialURL = ""
  15. // this is old url that mention version in base url itself.
  16. let oldStaggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/v1/"
  17. let oldLiveServerUrl = "https://mobileapi.gmeremit.com:8002/api/v1/"
  18. // let oldUatServer = "http://gmeuat.gmeremit.com:5012/api/v1/"
  19. let oldUatServer = "http://gmeuat.gmeremit.com:5012/api/v1/"
  20. // this is the new url without mentioning of version
  21. let staggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/"
  22. let liveServerUrl = "https://mobileapi.gmeremit.com:8002/api/"
  23. // let uatServer = "http://gmeuat.gmeremit.com:5012/api/"
  24. let uatServer = "http://gmeuat.gmeremit.com:5012/api/"
  25. init() {
  26. switch server {
  27. case .uat:
  28. self.oldBaseURL = oldUatServer
  29. self.baseURL = uatServer
  30. case .stagging:
  31. self.oldBaseURL = oldStaggingServerUrl
  32. self.baseURL = staggingServerUrl
  33. case .live:
  34. self.oldBaseURL = oldLiveServerUrl
  35. self.baseURL = liveServerUrl
  36. }
  37. }
  38. func getSignupURL() -> String {
  39. return baseURL + "users"
  40. }
  41. func getCodeVerificationURL(userId: String) -> String {
  42. return baseURL + "users/" + userId + "/verification-code"
  43. }
  44. func getLogInURL() -> String {
  45. return baseURL + "users/access-code"
  46. }
  47. func getUserVerificationURLforPasswordReset() -> String {
  48. return baseURL + "users/passwords/reset"
  49. }
  50. func getDOBVerificationURLforPasswordReset(userId: String) -> String {
  51. return baseURL + "users/" + userId + "/passwords/reset-question"
  52. }
  53. func getResetCodeValidationURL(userId: String) -> String {
  54. return baseURL + "users/" + userId + "/passwords/reset-code"
  55. }
  56. func getRequestAnotherCodeURL(userId: String) -> String {
  57. return baseURL + "codes/" + userId
  58. }
  59. func getPasswordUpdateURL(userId: String) -> String {
  60. return baseURL + "users/" + userId + "/passwords/reset"
  61. }
  62. func getRecipientListURL(userId: String) -> String {
  63. return baseURL + "recipients?userId=" + userId
  64. }
  65. func getRecipientListURLForPagination() -> String{
  66. return baseURL + "recipients"
  67. }
  68. func getNewRecipientURL() -> String {
  69. return baseURL + "recipients"
  70. }
  71. func getDeleteRecipientURL(recipientId: String) -> String {
  72. return baseURL + "recipients/" + recipientId
  73. }
  74. func getUpdateRecipientURL(recipientId: String) -> String {
  75. return baseURL + "recipients/" + recipientId
  76. }
  77. func getExchangeRateURL() -> String {
  78. return baseURL + "currencies/exchange"
  79. }
  80. func getTransactionInformationURL() -> String {
  81. return baseURL + "transactions/infos"
  82. }
  83. func getRechargeURL() -> String {
  84. return baseURL + "transactions/topup"
  85. }
  86. func getURLForMobileRechargeAmount() -> String {
  87. return baseURL + "telecoms/services"
  88. }
  89. func getMobileOperator() -> String {
  90. return baseURL + "telecoms"
  91. }
  92. func getBankDetailsURL() -> String {
  93. return baseURL + "banks"
  94. }
  95. func getTransferReasonURL() -> String {
  96. return baseURL + "cdds/CDDTRV1"
  97. }
  98. func getCountryURL() -> String{
  99. return baseURL + "cdds/CDDCLSTV1"
  100. }
  101. func getSourceURL() -> String {
  102. return baseURL + "cdds/CDDSOFV1"
  103. }
  104. func getTransferURL() -> String {
  105. return baseURL + "transactions"
  106. }
  107. func getCurrencyURL() -> String {
  108. return baseURL + "currencies"
  109. }
  110. func getCDDURL(code: String) -> String {
  111. return baseURL + "cdds/" + code
  112. }
  113. func getKycURL(userId: String) -> String {
  114. return baseURL + "users/" + userId + "/kyc"
  115. }
  116. func getKycDocumentURL(userId: String) -> String {
  117. return baseURL + "documents/" + userId
  118. }
  119. func getUserProfileURL(userId: String) -> String {
  120. return baseURL + "users/" + userId
  121. }
  122. func getKYCURL(userId: String) -> String {
  123. return baseURL + "users/" + userId + "/kyc"
  124. }
  125. func getPayoutsURL() -> String {
  126. return baseURL + "payouts"
  127. }
  128. func getPayoutsBranchURL(payoutId: String) -> String {
  129. return baseURL + "payouts/" + payoutId + "/branches"
  130. }
  131. func getTransactionListURL() -> String {
  132. return baseURL + "transactions/statement"
  133. }
  134. func getMessageURL(supportIndex: Int) -> String {
  135. if supportIndex == 1 {
  136. return baseURL + "supports/amendments"
  137. } else {
  138. return baseURL + "supports/general"
  139. }
  140. }
  141. func getWithdrawURL() -> String {
  142. return baseURL + "transactions/withdraw"
  143. }
  144. func getBranchURL(bankId: String) -> String {
  145. return baseURL + "banks/" + bankId
  146. }
  147. func getPasswordChangeURL(userId: String) -> String {
  148. return baseURL + "users/" + userId + "/passwords/change"
  149. }
  150. func getNewInviteeURL() -> String {
  151. return baseURL + "referrals"
  152. }
  153. func getInviteeURL(userId: String) -> String {
  154. return baseURL + "referrals?userId=" + userId
  155. }
  156. func getcmRegistrationIdURL(userId: String) -> String {
  157. return baseURL + "users/" + userId
  158. }
  159. func getWalletURL() -> String {
  160. return baseURL + "transactions/wallet"
  161. }
  162. func getNotificationURL(userId: String) -> String {
  163. return baseURL + "notifications?userId=" + userId
  164. }
  165. func patchNotificationURL(notificationId: String) -> String {
  166. return baseURL + "notifications/" + notificationId
  167. }
  168. func getCRUDFeedURL() -> String {
  169. return baseSocialURL + "feeds"
  170. }
  171. func multipartImageUploadURL() -> String {
  172. return baseSocialURL + "files"
  173. }
  174. func getCountryPayoutModeURL() -> String{
  175. return baseURL + "cdds/CDDPMLSTV1"
  176. //CDDPMLSTV1
  177. }
  178. func getLikeDislikeFeedURL(feedId: String) -> String {
  179. return baseSocialURL + "feeds/" + feedId + "/likes"
  180. }
  181. func getCommentFeedURL(feedId: String) -> String {
  182. return baseSocialURL + "feeds/" + feedId + "/comments"
  183. }
  184. func getCreateCommentURL(feedId: String) -> String {
  185. return baseSocialURL + "feeds/" + feedId + "/comments"
  186. }
  187. func getEditDeleteCommentURL(feedId: String, commentId: String) -> String {
  188. return baseSocialURL + "feeds/" + feedId + "/comments/" + commentId
  189. }
  190. func getRewardsURL() -> String {
  191. return baseURL + "rewards"
  192. }
  193. func getRedeemRewardURL(rewardId: String) -> String {
  194. return baseURL + "rewards/" + rewardId + "/redeems"
  195. }
  196. func getUserUpdateURL(userId: String) -> String {
  197. return baseURL + "users/" + userId
  198. }
  199. func getReferralCodeValidationURL() -> String {
  200. return baseURL + "referrals/codes"
  201. }
  202. func getRejectMoneyRequestURL() -> String {
  203. return baseURL + "transactions/wallet/request/actions/reject"
  204. }
  205. func getAcceptMoneyRequestURL() -> String {
  206. return baseURL + "transactions/wallet/request/actions/accept"
  207. }
  208. func getParticularFeedURL(feedId: String) -> String {
  209. return baseSocialURL + "feeds/" + feedId
  210. }
  211. }