banner_model.dart 2.9 KB

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