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.

272 lines
7.1 KiB

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