| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- import 'package:bbyyy/beans/new_order_bean_entity.dart';
- newOrderBeanEntityFromJson(NewOrderBeanEntity data, Map<String, dynamic> json) {
- if (json['type'] != null) {
- data.type = json['type'].toString();
- }
- if (json['content'] != null) {
- data.content = NewOrderBeanContent().fromJson(json['content']);
- }
- return data;
- }
- Map<String, dynamic> newOrderBeanEntityToJson(NewOrderBeanEntity entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['type'] = entity.type;
- data['content'] = entity.content?.toJson();
- return data;
- }
- newOrderBeanContentFromJson(NewOrderBeanContent data, Map<String, dynamic> json) {
- if (json['UID'] != null) {
- data.uID = json['UID'] is String
- ? int.tryParse(json['UID'])
- : json['UID'].toInt();
- }
- if (json['State'] != null) {
- data.state = json['State'] is String
- ? int.tryParse(json['State'])
- : json['State'].toInt();
- }
- if (json['SellerID'] != null) {
- data.sellerID = json['SellerID'] is String
- ? int.tryParse(json['SellerID'])
- : json['SellerID'].toInt();
- }
- if (json['CreateTime'] != null) {
- data.createTime = json['CreateTime'].toString();
- }
- if (json['ShopUID'] != null) {
- data.shopUID = json['ShopUID'] is String
- ? int.tryParse(json['ShopUID'])
- : json['ShopUID'].toInt();
- }
- if (json['Amount'] != null) {
- data.amount = json['Amount'] is String
- ? double.tryParse(json['Amount'])
- : json['Amount'].toDouble();
- }
- if (json['Hash'] != null) {
- data.hash = json['Hash'].toString();
- }
- if (json['BuyerName'] != null) {
- data.buyerName = json['BuyerName'].toString();
- }
- if (json['ShopPic'] != null) {
- data.shopPic = json['ShopPic'].toString();
- }
- if (json['ShopID'] != null) {
- data.shopID = json['ShopID'] is String
- ? int.tryParse(json['ShopID'])
- : json['ShopID'].toInt();
- }
- if (json['SellerName'] != null) {
- data.sellerName = json['SellerName'].toString();
- }
- if (json['SellerPic'] != null) {
- data.sellerPic = json['SellerPic'].toString();
- }
- if (json['SellerUID'] != null) {
- data.sellerUID = json['SellerUID'] is String
- ? int.tryParse(json['SellerUID'])
- : json['SellerUID'].toInt();
- }
- if (json['ShopName'] != null) {
- data.shopName = json['ShopName'].toString();
- }
- if (json['ID'] != null) {
- data.iD = json['ID'] is String
- ? int.tryParse(json['ID'])
- : json['ID'].toInt();
- }
- return data;
- }
- Map<String, dynamic> newOrderBeanContentToJson(NewOrderBeanContent entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['UID'] = entity.uID;
- data['State'] = entity.state;
- data['SellerID'] = entity.sellerID;
- data['CreateTime'] = entity.createTime;
- data['ShopUID'] = entity.shopUID;
- data['Amount'] = entity.amount;
- data['Hash'] = entity.hash;
- data['BuyerName'] = entity.buyerName;
- data['ShopPic'] = entity.shopPic;
- data['ShopID'] = entity.shopID;
- data['SellerName'] = entity.sellerName;
- data['SellerPic'] = entity.sellerPic;
- data['SellerUID'] = entity.sellerUID;
- data['ShopName'] = entity.shopName;
- data['ID'] = entity.iD;
- return data;
- }
|