shop_model.dart 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. class ShopModel {
  2. List<Records> records;
  3. int total;
  4. int size;
  5. int current;
  6. bool searchCount;
  7. int pages;
  8. ShopModel(
  9. {this.records,
  10. this.total,
  11. this.size,
  12. this.current,
  13. this.searchCount,
  14. this.pages});
  15. ShopModel.fromJson(Map<String, dynamic> json) {
  16. if (json['records'] != null) {
  17. records = new List<Records>();
  18. json['records'].forEach((v) {
  19. records.add(new Records.fromJson(v));
  20. });
  21. }
  22. total = json['total'];
  23. size = json['size'];
  24. current = json['current'];
  25. searchCount = json['searchCount'];
  26. pages = json['pages'];
  27. }
  28. Map<String, dynamic> toJson() {
  29. final Map<String, dynamic> data = new Map<String, dynamic>();
  30. if (this.records != null) {
  31. data['records'] = this.records.map((v) => v.toJson()).toList();
  32. }
  33. data['total'] = this.total;
  34. data['size'] = this.size;
  35. data['current'] = this.current;
  36. data['searchCount'] = this.searchCount;
  37. data['pages'] = this.pages;
  38. return data;
  39. }
  40. }
  41. class Records {
  42. int id;
  43. int createTime;
  44. String createBy;
  45. int updateTime;
  46. String updateBy;
  47. String name;
  48. double price;
  49. int brandId;
  50. String descr;
  51. String imgs;
  52. String manufacturer;
  53. String telephone;
  54. int favoriteNum;
  55. int likeNum;
  56. int browseNum;
  57. int hotFlag;
  58. int statuz;
  59. int isFavorite;
  60. int favoriteId;
  61. Records(
  62. {this.id,
  63. this.createTime,
  64. this.createBy,
  65. this.updateTime,
  66. this.updateBy,
  67. this.name,
  68. this.price,
  69. this.brandId,
  70. this.descr,
  71. this.imgs,
  72. this.manufacturer,
  73. this.telephone,
  74. this.favoriteNum,
  75. this.likeNum,
  76. this.browseNum,
  77. this.hotFlag,
  78. this.statuz,
  79. this.isFavorite,
  80. this.favoriteId});
  81. Records.fromJson(Map<String, dynamic> json) {
  82. id = json['id'];
  83. createTime = json['createTime'];
  84. createBy = json['createBy'];
  85. updateTime = json['updateTime'];
  86. updateBy = json['updateBy'];
  87. name = json['name'];
  88. price = json['price'];
  89. brandId = json['brandId'];
  90. descr = json['descr'];
  91. imgs = json['imgs'];
  92. manufacturer = json['manufacturer'];
  93. telephone = json['telephone'];
  94. favoriteNum = json['favoriteNum'];
  95. likeNum = json['likeNum'];
  96. browseNum = json['browseNum'];
  97. hotFlag = json['hotFlag'];
  98. statuz = json['statuz'];
  99. isFavorite = json['isFavorite'];
  100. favoriteId = json['favoriteId'];
  101. }
  102. Map<String, dynamic> toJson() {
  103. final Map<String, dynamic> data = new Map<String, dynamic>();
  104. data['id'] = this.id;
  105. data['createTime'] = this.createTime;
  106. data['createBy'] = this.createBy;
  107. data['updateTime'] = this.updateTime;
  108. data['updateBy'] = this.updateBy;
  109. data['name'] = this.name;
  110. data['price'] = this.price;
  111. data['brandId'] = this.brandId;
  112. data['descr'] = this.descr;
  113. data['imgs'] = this.imgs;
  114. data['manufacturer'] = this.manufacturer;
  115. data['telephone'] = this.telephone;
  116. data['favoriteNum'] = this.favoriteNum;
  117. data['likeNum'] = this.likeNum;
  118. data['browseNum'] = this.browseNum;
  119. data['hotFlag'] = this.hotFlag;
  120. data['statuz'] = this.statuz;
  121. data['isFavorite'] = this.isFavorite;
  122. data['favoriteId'] = this.favoriteId;
  123. return data;
  124. }
  125. }