question_model.dart 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. class QuestionModel {
  2. List<Records> records;
  3. int total;
  4. int size;
  5. int current;
  6. bool searchCount;
  7. int pages;
  8. QuestionModel(
  9. {this.records,
  10. this.total,
  11. this.size,
  12. this.current,
  13. this.searchCount,
  14. this.pages});
  15. QuestionModel.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 title;
  48. String expression;
  49. String solution;
  50. String imgs;
  51. int brandId;
  52. int expert;
  53. double reward;
  54. int lockFlag;
  55. int hotFlag;
  56. int statuz;
  57. int favoriteNum;
  58. int likeNum;
  59. int browseNum;
  60. int tipNum;
  61. int examineFlag;
  62. String notExamineReason;
  63. int validPeriod;
  64. String userName;
  65. String brandName;
  66. String avatarUrl;
  67. int isLike;
  68. int isFavorite;
  69. Records(
  70. {this.id,
  71. this.createTime,
  72. this.createBy,
  73. this.updateTime,
  74. this.updateBy,
  75. this.title,
  76. this.expression,
  77. this.solution,
  78. this.imgs,
  79. this.brandId,
  80. this.expert,
  81. this.reward,
  82. this.lockFlag,
  83. this.hotFlag,
  84. this.statuz,
  85. this.favoriteNum,
  86. this.likeNum,
  87. this.browseNum,
  88. this.tipNum,
  89. this.examineFlag,
  90. this.notExamineReason,
  91. this.validPeriod,
  92. this.userName,
  93. this.avatarUrl,
  94. this.brandName,
  95. this.isLike,
  96. this.isFavorite,});
  97. Records.fromJson(Map<String, dynamic> json) {
  98. id = json['id'];
  99. createTime = json['createTime'];
  100. createBy = json['createBy'];
  101. updateTime = json['updateTime'];
  102. updateBy = json['updateBy'];
  103. title = json['title'];
  104. expression = json['expression'];
  105. solution = json['solution'];
  106. imgs = json['imgs'];
  107. brandId = json['brandId'];
  108. expert = json['expert'];
  109. reward = json['reward'];
  110. lockFlag = json['lockFlag'];
  111. hotFlag = json['hotFlag'];
  112. statuz = json['statuz'];
  113. favoriteNum = json['favoriteNum'];
  114. likeNum = json['likeNum'];
  115. browseNum = json['browseNum'];
  116. tipNum = json['tipNum'];
  117. examineFlag = json['examineFlag'];
  118. notExamineReason = json['notExamineReason'];
  119. validPeriod = json['validPeriod'];
  120. userName = json['userName'];
  121. brandName = json['brandName'];
  122. avatarUrl = json['avatarUrl'];
  123. isLike = json['isLike'];
  124. isFavorite = json['isFavorite'];
  125. }
  126. Map<String, dynamic> toJson() {
  127. final Map<String, dynamic> data = new Map<String, dynamic>();
  128. data['id'] = this.id;
  129. data['createTime'] = this.createTime;
  130. data['createBy'] = this.createBy;
  131. data['updateTime'] = this.updateTime;
  132. data['updateBy'] = this.updateBy;
  133. data['title'] = this.title;
  134. data['expression'] = this.expression;
  135. data['solution'] = this.solution;
  136. data['imgs'] = this.imgs;
  137. data['brandId'] = this.brandId;
  138. data['expert'] = this.expert;
  139. data['reward'] = this.reward;
  140. data['lockFlag'] = this.lockFlag;
  141. data['hotFlag'] = this.hotFlag;
  142. data['statuz'] = this.statuz;
  143. data['favoriteNum'] = this.favoriteNum;
  144. data['likeNum'] = this.likeNum;
  145. data['browseNum'] = this.browseNum;
  146. data['tipNum'] = this.tipNum;
  147. data['examineFlag'] = this.examineFlag;
  148. data['notExamineReason'] = this.notExamineReason;
  149. data['validPeriod'] = this.validPeriod;
  150. data['userName'] = this.userName;
  151. data['brandName'] = this.brandName;
  152. data['avatarUrl'] = this.avatarUrl;
  153. data['isLike'] = this.isLike;
  154. data['isFavorite'] = this.isFavorite;
  155. return data;
  156. }
  157. }