brand_model.dart 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. class BrandModel {
  2. List<Records> records;
  3. int total;
  4. int size;
  5. int current;
  6. bool searchCount;
  7. int pages;
  8. BrandModel(
  9. {this.records,
  10. this.total,
  11. this.size,
  12. this.current,
  13. this.searchCount,
  14. this.pages});
  15. BrandModel.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. String ename;
  49. String logo;
  50. String descr;
  51. int sort;
  52. int statuz;
  53. int hotFlag;
  54. Records(
  55. {this.id,
  56. this.createTime,
  57. this.createBy,
  58. this.updateTime,
  59. this.updateBy,
  60. this.name,
  61. this.ename,
  62. this.logo,
  63. this.descr,
  64. this.sort,
  65. this.statuz,
  66. this.hotFlag});
  67. Records.fromJson(Map<String, dynamic> json) {
  68. id = json['id'];
  69. createTime = json['createTime'];
  70. createBy = json['createBy'];
  71. updateTime = json['updateTime'];
  72. updateBy = json['updateBy'];
  73. name = json['name'];
  74. ename = json['ename'];
  75. logo = json['logo'];
  76. descr = json['descr'];
  77. sort = json['sort'];
  78. statuz = json['statuz'];
  79. hotFlag = json['hotFlag'];
  80. }
  81. Map<String, dynamic> toJson() {
  82. final Map<String, dynamic> data = new Map<String, dynamic>();
  83. data['id'] = this.id;
  84. data['createTime'] = this.createTime;
  85. data['createBy'] = this.createBy;
  86. data['updateTime'] = this.updateTime;
  87. data['updateBy'] = this.updateBy;
  88. data['name'] = this.name;
  89. data['ename'] = this.ename;
  90. data['logo'] = this.logo;
  91. data['descr'] = this.descr;
  92. data['sort'] = this.sort;
  93. data['statuz'] = this.statuz;
  94. data['hotFlag'] = this.hotFlag;
  95. return data;
  96. }
  97. }