Blame view

lib/generated/json/product_entity.g.dart 3.09 KB
4224b3f8   吴启风   feat:支付详情页ui
1
2
3
4
5
  import 'package:wow_english/generated/json/base/json_convert_content.dart';
  import 'package:wow_english/models/product_entity.dart';
  
  ProductEntity $ProductEntityFromJson(Map<String, dynamic> json) {
    final ProductEntity productEntity = ProductEntity();
07599105   吴启风   feat:商品列表请求&路由
6
7
8
9
    final int? id = jsonConvert.convert<int>(json['id']);
    if (id != null) {
      productEntity.id = id;
    }
4224b3f8   吴启风   feat:支付详情页ui
10
11
12
13
    final String? name = jsonConvert.convert<String>(json['name']);
    if (name != null) {
      productEntity.name = name;
    }
07599105   吴启风   feat:商品列表请求&路由
14
15
16
17
    final String? title = jsonConvert.convert<String>(json['title']);
    if (title != null) {
      productEntity.title = title;
    }
4224b3f8   吴启风   feat:支付详情页ui
18
19
20
21
    final double? price = jsonConvert.convert<double>(json['price']);
    if (price != null) {
      productEntity.price = price;
    }
07599105   吴启风   feat:商品列表请求&路由
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    final String? picUrl = jsonConvert.convert<String>(json['picUrl']);
    if (picUrl != null) {
      productEntity.picUrl = picUrl;
    }
    final String? bannerPicUrl = jsonConvert.convert<String>(
        json['bannerPicUrl']);
    if (bannerPicUrl != null) {
      productEntity.bannerPicUrl = bannerPicUrl;
    }
    final String? detailPicUrl = jsonConvert.convert<String>(
        json['detailPicUrl']);
    if (detailPicUrl != null) {
      productEntity.detailPicUrl = detailPicUrl;
    }
    final int? saleType = jsonConvert.convert<int>(json['saleType']);
    if (saleType != null) {
      productEntity.saleType = saleType;
    }
    final int? status = jsonConvert.convert<int>(json['status']);
    if (status != null) {
      productEntity.status = status;
    }
    final int? sortOrder = jsonConvert.convert<int>(json['sortOrder']);
    if (sortOrder != null) {
      productEntity.sortOrder = sortOrder;
    }
    final int? validityType = jsonConvert.convert<int>(json['validityType']);
    if (validityType != null) {
      productEntity.validityType = validityType;
    }
4224b3f8   吴启风   feat:支付详情页ui
52
53
54
55
56
    return productEntity;
  }
  
  Map<String, dynamic> $ProductEntityToJson(ProductEntity entity) {
    final Map<String, dynamic> data = <String, dynamic>{};
07599105   吴启风   feat:商品列表请求&路由
57
    data['id'] = entity.id;
4224b3f8   吴启风   feat:支付详情页ui
58
    data['name'] = entity.name;
07599105   吴启风   feat:商品列表请求&路由
59
    data['title'] = entity.title;
4224b3f8   吴启风   feat:支付详情页ui
60
    data['price'] = entity.price;
07599105   吴启风   feat:商品列表请求&路由
61
62
63
64
65
66
67
    data['picUrl'] = entity.picUrl;
    data['bannerPicUrl'] = entity.bannerPicUrl;
    data['detailPicUrl'] = entity.detailPicUrl;
    data['saleType'] = entity.saleType;
    data['status'] = entity.status;
    data['sortOrder'] = entity.sortOrder;
    data['validityType'] = entity.validityType;
4224b3f8   吴启风   feat:支付详情页ui
68
69
70
71
72
    return data;
  }
  
  extension ProductEntityExtension on ProductEntity {
    ProductEntity copyWith({
07599105   吴启风   feat:商品列表请求&路由
73
      int? id,
4224b3f8   吴启风   feat:支付详情页ui
74
      String? name,
07599105   吴启风   feat:商品列表请求&路由
75
      String? title,
4224b3f8   吴启风   feat:支付详情页ui
76
      double? price,
07599105   吴启风   feat:商品列表请求&路由
77
78
79
80
81
82
83
      String? picUrl,
      String? bannerPicUrl,
      String? detailPicUrl,
      int? saleType,
      int? status,
      int? sortOrder,
      int? validityType,
4224b3f8   吴启风   feat:支付详情页ui
84
85
    }) {
      return ProductEntity()
07599105   吴启风   feat:商品列表请求&路由
86
        ..id = id ?? this.id
4224b3f8   吴启风   feat:支付详情页ui
87
        ..name = name ?? this.name
07599105   吴启风   feat:商品列表请求&路由
88
89
90
91
92
93
94
95
96
        ..title = title ?? this.title
        ..price = price ?? this.price
        ..picUrl = picUrl ?? this.picUrl
        ..bannerPicUrl = bannerPicUrl ?? this.bannerPicUrl
        ..detailPicUrl = detailPicUrl ?? this.detailPicUrl
        ..saleType = saleType ?? this.saleType
        ..status = status ?? this.status
        ..sortOrder = sortOrder ?? this.sortOrder
        ..validityType = validityType ?? this.validityType;
4224b3f8   吴启风   feat:支付详情页ui
97
98
    }
  }