| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- import 'package:bbyyy/beans/store_bean_entity.dart';
- storeBeanEntityFromJson(StoreBeanEntity data, Map<String, dynamic> json) {
- if (json['data'] != null) {
- data.data = StoreBeanData().fromJson(json['data']);
- }
- if (json['error'] != null) {
- data.error = json['error'].toString();
- }
- return data;
- }
- Map<String, dynamic> storeBeanEntityToJson(StoreBeanEntity entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['data'] = entity.data?.toJson();
- data['error'] = entity.error;
- return data;
- }
- storeBeanDataFromJson(StoreBeanData data, Map<String, dynamic> json) {
- if (json['total'] != null) {
- data.total = json['total'] is String
- ? int.tryParse(json['total'])
- : json['total'].toInt();
- }
- if (json['data'] != null) {
- data.data = (json['data'] as List).map((v) => StoreBeanDataData().fromJson(v)).toList();
- }
- return data;
- }
- Map<String, dynamic> storeBeanDataToJson(StoreBeanData entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['total'] = entity.total;
- data['data'] = entity.data?.map((v) => v.toJson())?.toList();
- return data;
- }
- storeBeanDataDataFromJson(StoreBeanDataData data, Map<String, dynamic> json) {
- if (json['create_time'] != null) {
- data.createTime = json['create_time'].toString();
- }
- if (json['inner_trade'] != null) {
- data.innerTrade = json['inner_trade'];
- }
- if (json['shop_commission_threshold'] != null) {
- data.shopCommissionThreshold = json['shop_commission_threshold'] is String
- ? double.tryParse(json['shop_commission_threshold'])
- : json['shop_commission_threshold'].toDouble();
- }
- if (json['notice'] != null) {
- data.notice = json['notice'].toString();
- }
- if (json['state'] != null) {
- data.state = json['state'] is String
- ? int.tryParse(json['state'])
- : json['state'].toInt();
- }
- if (json['banned'] != null) {
- data.banned = json['banned'];
- }
- if (json['shop_commission_pricing'] != null) {
- data.shopCommissionPricing = json['shop_commission_pricing'] is String
- ? double.tryParse(json['shop_commission_pricing'])
- : json['shop_commission_pricing'].toDouble();
- }
- if (json['private'] != null) {
- data.private = json['private'];
- }
- if (json['owner_uid'] != null) {
- data.ownerUid = json['owner_uid'] is String
- ? int.tryParse(json['owner_uid'])
- : json['owner_uid'].toInt();
- }
- if (json['owner_name'] != null) {
- data.ownerName = json['owner_name'].toString();
- }
- if (json['owner_pic'] != null) {
- data.ownerPic = json['owner_pic'].toString();
- }
- if (json['hide_members'] != null) {
- data.hideMembers = json['hide_members'];
- }
- if (json['fee_type'] != null) {
- data.feeType = json['fee_type'] is String
- ? int.tryParse(json['fee_type'])
- : json['fee_type'].toInt();
- }
- if (json['mobile'] != null) {
- data.mobile = json['mobile'].toString();
- }
- if (json['id'] != null) {
- data.id = json['id'] is String
- ? int.tryParse(json['id'])
- : json['id'].toInt();
- }
- if (json['picture'] != null) {
- data.picture = json['picture'].toString();
- }
- if (json['ban_expire_date'] != null) {
- data.banExpireDate = json['ban_expire_date'].toString();
- }
- if (json['address'] != null) {
- data.address = json['address'].toString();
- }
- if (json['introduction'] != null) {
- data.introduction = json['introduction'].toString();
- }
- if (json['uid'] != null) {
- data.uid = json['uid'] is String
- ? int.tryParse(json['uid'])
- : json['uid'].toInt();
- }
- if (json['name'] != null) {
- data.name = json['name'].toString();
- }
- if (json['ban_start_date'] != null) {
- data.banStartDate = json['ban_start_date'].toString();
- }
- if (json['shop_commission_percent'] != null) {
- data.shopCommissionPercent = json['shop_commission_percent'];
- }
- if (json['owner_pay_platform_fee'] != null) {
- data.ownerPayPlatformFee = json['owner_pay_platform_fee'];
- }
- if (json['longitude'] != null) {
- data.longitude = json['longitude'] is String
- ? double.tryParse(json['longitude'])
- : json['longitude'].toDouble();
- }
- if (json['latitude'] != null) {
- data.latitude = json['latitude'] is String
- ? double.tryParse(json['latitude'])
- : json['latitude'].toDouble();
- }
- return data;
- }
- Map<String, dynamic> storeBeanDataDataToJson(StoreBeanDataData entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['create_time'] = entity.createTime;
- data['inner_trade'] = entity.innerTrade;
- data['shop_commission_threshold'] = entity.shopCommissionThreshold;
- data['notice'] = entity.notice;
- data['state'] = entity.state;
- data['banned'] = entity.banned;
- data['shop_commission_pricing'] = entity.shopCommissionPricing;
- data['private'] = entity.private;
- data['owner_uid'] = entity.ownerUid;
- data['owner_name'] = entity.ownerName;
- data['owner_pic'] = entity.ownerPic;
- data['hide_members'] = entity.hideMembers;
- data['fee_type'] = entity.feeType;
- data['mobile'] = entity.mobile;
- data['id'] = entity.id;
- data['picture'] = entity.picture;
- data['ban_expire_date'] = entity.banExpireDate;
- data['address'] = entity.address;
- data['introduction'] = entity.introduction;
- data['uid'] = entity.uid;
- data['name'] = entity.name;
- data['ban_start_date'] = entity.banStartDate;
- data['shop_commission_percent'] = entity.shopCommissionPercent;
- data['owner_pay_platform_fee'] = entity.ownerPayPlatformFee;
- data['longitude'] = entity.longitude;
- data['latitude'] = entity.latitude;
- return data;
- }
|