use_x_ray_flow_bean_entity_helper.dart 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import 'package:bbyyy/beans/use_x_ray_flow_bean_entity.dart';
  2. useXRayFlowBeanEntityFromJson(UseXRayFlowBeanEntity data, Map<String, dynamic> json) {
  3. if (json['data'] != null) {
  4. data.data = UseXRayFlowBeanData().fromJson(json['data']);
  5. }
  6. if (json['error'] != null) {
  7. data.error = json['error'].toString();
  8. }
  9. return data;
  10. }
  11. Map<String, dynamic> useXRayFlowBeanEntityToJson(UseXRayFlowBeanEntity entity) {
  12. final Map<String, dynamic> data = new Map<String, dynamic>();
  13. data['data'] = entity.data?.toJson();
  14. data['error'] = entity.error;
  15. return data;
  16. }
  17. useXRayFlowBeanDataFromJson(UseXRayFlowBeanData data, Map<String, dynamic> json) {
  18. if (json['Valid'] != null) {
  19. data.valid = json['Valid'];
  20. }
  21. if (json['Flows'] != null) {
  22. data.flows = (json['Flows'] as List).map((v) => UseXRayFlowBeanDataFlows().fromJson(v)).toList();
  23. }
  24. return data;
  25. }
  26. Map<String, dynamic> useXRayFlowBeanDataToJson(UseXRayFlowBeanData entity) {
  27. final Map<String, dynamic> data = new Map<String, dynamic>();
  28. data['Valid'] = entity.valid;
  29. data['Flows'] = entity.flows?.map((v) => v.toJson())?.toList();
  30. return data;
  31. }
  32. useXRayFlowBeanDataFlowsFromJson(UseXRayFlowBeanDataFlows data, Map<String, dynamic> json) {
  33. if (json['id'] != null) {
  34. data.id = json['id'] is String
  35. ? int.tryParse(json['id'])
  36. : json['id'].toInt();
  37. }
  38. if (json['Type'] != null) {
  39. data.type = json['Type'] is String
  40. ? int.tryParse(json['Type'])
  41. : json['Type'].toInt();
  42. }
  43. if (json['user_uid'] != null) {
  44. data.userUid = json['user_uid'] is String
  45. ? int.tryParse(json['user_uid'])
  46. : json['user_uid'].toInt();
  47. }
  48. if (json['UserName'] != null) {
  49. data.userName = json['UserName'].toString();
  50. }
  51. if (json['UserPic'] != null) {
  52. data.userPic = json['UserPic'].toString();
  53. }
  54. if (json['trade_uid'] != null) {
  55. data.tradeUid = json['trade_uid'] is String
  56. ? int.tryParse(json['trade_uid'])
  57. : json['trade_uid'].toInt();
  58. }
  59. if (json['TraderName'] != null) {
  60. data.traderName = json['TraderName'].toString();
  61. }
  62. if (json['TraderPic'] != null) {
  63. data.traderPic = json['TraderPic'].toString();
  64. }
  65. if (json['pay_time'] != null) {
  66. data.payTime = json['pay_time'].toString();
  67. }
  68. if (json['PayWay'] != null) {
  69. data.payWay = json['PayWay'] is String
  70. ? int.tryParse(json['PayWay'])
  71. : json['PayWay'].toInt();
  72. }
  73. if (json['paid_amount'] != null) {
  74. data.paidAmount = json['paid_amount'] is String
  75. ? double.tryParse(json['paid_amount'])
  76. : json['paid_amount'].toDouble();
  77. }
  78. if (json['user_balance'] != null) {
  79. data.userBalance = json['user_balance'] is String
  80. ? double.tryParse(json['user_balance'])
  81. : json['user_balance'].toDouble();
  82. }
  83. if (json['order_uid'] != null) {
  84. data.orderUid = json['order_uid'] is String
  85. ? int.tryParse(json['order_uid'])
  86. : json['order_uid'].toInt();
  87. }
  88. if (json['peer_flow_id'] != null) {
  89. data.peerFlowId = json['peer_flow_id'] is String
  90. ? int.tryParse(json['peer_flow_id'])
  91. : json['peer_flow_id'].toInt();
  92. }
  93. if (json['remark'] != null) {
  94. data.remark = json['remark'].toString();
  95. }
  96. return data;
  97. }
  98. Map<String, dynamic> useXRayFlowBeanDataFlowsToJson(UseXRayFlowBeanDataFlows entity) {
  99. final Map<String, dynamic> data = new Map<String, dynamic>();
  100. data['id'] = entity.id;
  101. data['Type'] = entity.type;
  102. data['user_uid'] = entity.userUid;
  103. data['UserName'] = entity.userName;
  104. data['UserPic'] = entity.userPic;
  105. data['trade_uid'] = entity.tradeUid;
  106. data['TraderName'] = entity.traderName;
  107. data['TraderPic'] = entity.traderPic;
  108. data['pay_time'] = entity.payTime;
  109. data['PayWay'] = entity.payWay;
  110. data['paid_amount'] = entity.paidAmount;
  111. data['user_balance'] = entity.userBalance;
  112. data['order_uid'] = entity.orderUid;
  113. data['peer_flow_id'] = entity.peerFlowId;
  114. data['remark'] = entity.remark;
  115. return data;
  116. }