class CouponModelPage { List records; int total; int size; int current; bool searchCount; int pages; CouponModelPage( {this.records, this.total, this.size, this.current, this.searchCount, this.pages}); CouponModelPage.fromJson(Map json) { if (json['records'] != null) { records = new List(); json['records'].forEach((v) { records.add(new Records.fromJson(v)); }); } total = json['total']; size = json['size']; current = json['current']; searchCount = json['searchCount']; pages = json['pages']; } Map toJson() { final Map data = new Map(); if (this.records != null) { data['records'] = this.records.map((v) => v.toJson()).toList(); } data['total'] = this.total; data['size'] = this.size; data['current'] = this.current; data['searchCount'] = this.searchCount; data['pages'] = this.pages; return data; } } class Records { int id; int createTime; String createBy; int updateTime; String updateBy; String userId; int orderId; int couponId; int usedFlag; String orderNo; Coupon coupon; Records( {this.id, this.createTime, this.createBy, this.updateTime, this.updateBy, this.userId, this.orderId, this.couponId, this.usedFlag, this.orderNo, this.coupon}); Records.fromJson(Map json) { id = json['id']; createTime = json['createTime']; createBy = json['createBy']; updateTime = json['updateTime']; updateBy = json['updateBy']; userId = json['userId']; orderId = json['orderId']; couponId = json['couponId']; usedFlag = json['usedFlag']; orderNo = json['orderNo']; coupon = json['coupon'] != null ? new Coupon.fromJson(json['coupon']) : null; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['createTime'] = this.createTime; data['createBy'] = this.createBy; data['updateTime'] = this.updateTime; data['updateBy'] = this.updateBy; data['userId'] = this.userId; data['orderId'] = this.orderId; data['couponId'] = this.couponId; data['usedFlag'] = this.usedFlag; data['orderNo'] = this.orderNo; if (this.coupon != null) { data['coupon'] = this.coupon.toJson(); } return data; } } class Coupon { int id; int createTime; String createBy; int updateTime; String updateBy; String name; int type; double discount; double price; double fullReduction; int scenario; int validity; int statuz; int checkFalg; String reason; String remark; Coupon( {this.id, this.createTime, this.createBy, this.updateTime, this.updateBy, this.name, this.type, this.discount, this.price, this.fullReduction, this.scenario, this.validity, this.statuz, this.checkFalg, this.reason, this.remark}); Coupon.fromJson(Map json) { id = json['id']; createTime = json['createTime']; createBy = json['createBy']; updateTime = json['updateTime']; updateBy = json['updateBy']; name = json['name']; type = json['type']; discount = json['discount']; price = json['price']; fullReduction = json['fullReduction']; scenario = json['scenario']; validity = json['validity']; statuz = json['statuz']; checkFalg = json['checkFalg']; reason = json['reason']; remark = json['remark']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['createTime'] = this.createTime; data['createBy'] = this.createBy; data['updateTime'] = this.updateTime; data['updateBy'] = this.updateBy; data['name'] = this.name; data['type'] = this.type; data['discount'] = this.discount; data['price'] = this.price; data['fullReduction'] = this.fullReduction; data['scenario'] = this.scenario; data['validity'] = this.validity; data['statuz'] = this.statuz; data['checkFalg'] = this.checkFalg; data['reason'] = this.reason; data['remark'] = this.remark; return data; } }