wallet_model.dart 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. class WalletModel {
  2. List<Records> records;
  3. int total;
  4. int size;
  5. int current;
  6. bool searchCount;
  7. int pages;
  8. WalletModel(
  9. {this.records,
  10. this.total,
  11. this.size,
  12. this.current,
  13. this.searchCount,
  14. this.pages});
  15. WalletModel.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. int userId;
  48. double amount;
  49. double balance;
  50. int type;
  51. String flowNum;
  52. String descr;
  53. String userName;
  54. int rote;
  55. int businessType;
  56. String avatarUrl;
  57. String mobile;
  58. double income;
  59. double outcome;
  60. Records(
  61. {this.id,
  62. this.createTime,
  63. this.createBy,
  64. this.businessType,
  65. this.updateTime,
  66. this.updateBy,
  67. this.userId,
  68. this.amount,
  69. this.balance,
  70. this.type,
  71. this.flowNum,
  72. this.descr,
  73. this.userName,
  74. this.rote,
  75. this.avatarUrl,
  76. this.mobile,
  77. this.income,
  78. this.outcome,
  79. });
  80. Records.fromJson(Map<String, dynamic> json) {
  81. id = json['id'];
  82. businessType = json['businessType'];
  83. createTime = json['createTime'];
  84. createBy = json['createBy'];
  85. updateTime = json['updateTime'];
  86. updateBy = json['updateBy'];
  87. userId = json['userId'];
  88. amount = json['amount'];
  89. balance = json['balance'];
  90. type = json['type'];
  91. flowNum = json['flowNum'];
  92. descr = json['descr'];
  93. userName = json['userName'];
  94. rote = json['rote'];
  95. avatarUrl = json['avatarUrl'];
  96. mobile = json['mobile'];
  97. income = json['income'];
  98. outcome = json['outcome'];
  99. }
  100. Map<String, dynamic> toJson() {
  101. final Map<String, dynamic> data = new Map<String, dynamic>();
  102. data['id'] = this.id;
  103. data['businessType'] = this.businessType;
  104. data['createTime'] = this.createTime;
  105. data['createBy'] = this.createBy;
  106. data['updateTime'] = this.updateTime;
  107. data['updateBy'] = this.updateBy;
  108. data['userId'] = this.userId;
  109. data['amount'] = this.amount;
  110. data['balance'] = this.balance;
  111. data['type'] = this.type;
  112. data['flowNum'] = this.flowNum;
  113. data['descr'] = this.descr;
  114. data['userName'] = this.userName;
  115. data['rote'] = this.rote;
  116. data['avatarUrl'] = this.avatarUrl;
  117. data['mobile'] = this.mobile;
  118. data['income'] = this.income;
  119. data['outcome'] = this.outcome;
  120. return data;
  121. }
  122. }