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.

131 lines
2.2 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
  1. //
  2. // Country.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 26/08/2018.
  6. // Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. import ObjectMapper
  10. class District: Mappable {
  11. var id: String?
  12. var name: String?
  13. required init?(map: Map) {
  14. }
  15. func mapping(map: Map) {
  16. id <- map["id"]
  17. name <- map["text"]
  18. }
  19. }
  20. class Provience: Mappable {
  21. var id: String?
  22. var name: String?
  23. var districts: [District]?
  24. required init?(map: Map) {
  25. }
  26. func mapping(map: Map) {
  27. id <- map["id"]
  28. name <- map["text"]
  29. districts <- map["District"]
  30. }
  31. }
  32. class CountryModel: Mappable {
  33. var name: String?
  34. var id: String?
  35. var provienceRequired: String?
  36. var code: String?
  37. var proviences: [Provience]?
  38. required init?(map: Map) {
  39. }
  40. func mapping(map: Map) {
  41. name <- map["Name"]
  42. id <- map["Id"]
  43. provienceRequired <- map["IsProvienceReq"]
  44. code <- map["Code"]
  45. proviences <- map["Provinces"]
  46. }
  47. }
  48. class TransferReason: Mappable {
  49. var id: String?
  50. var title: String?
  51. required init?(map: Map) {
  52. }
  53. func mapping(map: Map) {
  54. id <- map["id"]
  55. title <- map["text"]
  56. }
  57. }
  58. class Relation: Mappable {
  59. var id: String?
  60. var title: String?
  61. required init?(map: Map) {
  62. }
  63. func mapping(map: Map) {
  64. id <- map["id"]
  65. title <- map["text"]
  66. }
  67. }
  68. class SendMoneyModel: Mappable {
  69. var countries: [CountryModel]?
  70. var transferReasons: [TransferReason]?
  71. var relations: [Relation]?
  72. required init?(map: Map) {
  73. }
  74. func mapping(map: Map) {
  75. countries <- map["Country"]
  76. transferReasons <- map["TransferReasons"]
  77. relations <- map["Relations"]
  78. }
  79. }
  80. class SendMoneyInformationContainer: Mappable {
  81. var errorCode: String?
  82. var message: String?
  83. var id: String?
  84. var data: SendMoneyModel?
  85. required init?(map: Map) {
  86. }
  87. func mapping(map: Map) {
  88. errorCode <- map["ErrorCode"]
  89. message <- map["Msg"]
  90. id <- map["Id"]
  91. data <- map["Data"]
  92. }
  93. }