coupon_model.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. class CouponModel {
  2. int id;
  3. int createTime;
  4. String createBy;
  5. int updateTime;
  6. String updateBy;
  7. String userId;
  8. int orderId;
  9. int couponId;
  10. int usedFlag;
  11. String orderNo;
  12. Coupon coupon;
  13. CouponModel(
  14. {this.id,
  15. this.createTime,
  16. this.createBy,
  17. this.updateTime,
  18. this.updateBy,
  19. this.userId,
  20. this.orderId,
  21. this.couponId,
  22. this.usedFlag,
  23. this.orderNo,
  24. this.coupon});
  25. CouponModel.fromJson(Map<String, dynamic> json) {
  26. id = json['id'];
  27. createTime = json['createTime'];
  28. createBy = json['createBy'];
  29. updateTime = json['updateTime'];
  30. updateBy = json['updateBy'];
  31. userId = json['userId'];
  32. orderId = json['orderId'];
  33. couponId = json['couponId'];
  34. usedFlag = json['usedFlag'];
  35. orderNo = json['orderNo'];
  36. coupon =
  37. json['coupon'] != null ? new Coupon.fromJson(json['coupon']) : null;
  38. }
  39. Map<String, dynamic> toJson() {
  40. final Map<String, dynamic> data = new Map<String, dynamic>();
  41. data['id'] = this.id;
  42. data['createTime'] = this.createTime;
  43. data['createBy'] = this.createBy;
  44. data['updateTime'] = this.updateTime;
  45. data['updateBy'] = this.updateBy;
  46. data['userId'] = this.userId;
  47. data['orderId'] = this.orderId;
  48. data['couponId'] = this.couponId;
  49. data['usedFlag'] = this.usedFlag;
  50. data['orderNo'] = this.orderNo;
  51. if (this.coupon != null) {
  52. data['coupon'] = this.coupon.toJson();
  53. }
  54. return data;
  55. }
  56. }
  57. class Coupon {
  58. int id;
  59. int createTime;
  60. String createBy;
  61. int updateTime;
  62. String updateBy;
  63. String name;
  64. int type;
  65. double discount;
  66. double price;
  67. double fullReduction;
  68. int scenario;
  69. int validity;
  70. int statuz;
  71. int checkFalg;
  72. String reason;
  73. String remark;
  74. Coupon(
  75. {this.id,
  76. this.createTime,
  77. this.createBy,
  78. this.updateTime,
  79. this.updateBy,
  80. this.name,
  81. this.type,
  82. this.discount,
  83. this.price,
  84. this.fullReduction,
  85. this.scenario,
  86. this.validity,
  87. this.statuz,
  88. this.checkFalg,
  89. this.reason,
  90. this.remark});
  91. Coupon.fromJson(Map<String, dynamic> json) {
  92. id = json['id'];
  93. createTime = json['createTime'];
  94. createBy = json['createBy'];
  95. updateTime = json['updateTime'];
  96. updateBy = json['updateBy'];
  97. name = json['name'];
  98. type = json['type'];
  99. discount = json['discount'];
  100. price = json['price'];
  101. fullReduction = json['fullReduction'];
  102. scenario = json['scenario'];
  103. validity = json['validity'];
  104. statuz = json['statuz'];
  105. checkFalg = json['checkFalg'];
  106. reason = json['reason'];
  107. remark = json['remark'];
  108. }
  109. Map<String, dynamic> toJson() {
  110. final Map<String, dynamic> data = new Map<String, dynamic>();
  111. data['id'] = this.id;
  112. data['createTime'] = this.createTime;
  113. data['createBy'] = this.createBy;
  114. data['updateTime'] = this.updateTime;
  115. data['updateBy'] = this.updateBy;
  116. data['name'] = this.name;
  117. data['type'] = this.type;
  118. data['discount'] = this.discount;
  119. data['price'] = this.price;
  120. data['fullReduction'] = this.fullReduction;
  121. data['scenario'] = this.scenario;
  122. data['validity'] = this.validity;
  123. data['statuz'] = this.statuz;
  124. data['checkFalg'] = this.checkFalg;
  125. data['reason'] = this.reason;
  126. data['remark'] = this.remark;
  127. return data;
  128. }
  129. }