liuyuqi-dellpc 1 year ago
parent
commit
6ea2221292
1 changed files with 53 additions and 0 deletions
  1. 53 0
      lib/models/good_model.dart

+ 53 - 0
lib/models/good_model.dart

@@ -0,0 +1,53 @@
+/// Description: good model
+/// Time       : 05/06/2023 Saturday
+/// Author     : liuyuqi.gov@msn.cn
+class GoodsModel {
+  List<Result>? result;
+
+  GoodsModel({result});
+
+  GoodsModel.fromJson(Map<String, dynamic> json) {
+    if (json['result'] != null) {
+      result = <Result>[];
+      json['result'].forEach((v) {
+        result!.add(Result.fromJson(v));
+      });
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    final Map<String, dynamic> data = <String, dynamic>{};
+    if (result != null) {
+      data['result'] = result!.map((v) => v.toJson()).toList();
+    }
+    return data;
+  }
+}
+
+class Result {
+  String? sId;
+  String? title;
+  String? pic;
+  String? pid;
+  String? sort;
+
+  Result({sId, title, pic, pid, sort});
+
+  Result.fromJson(Map<String, dynamic> json) {
+    sId = json['_id'];
+    title = json['title'];
+    pic = json['pic'];
+    pid = json['pid'];
+    sort = json['sort'];
+  }
+
+  Map<String, dynamic> toJson() {
+    final Map<String, dynamic> data = <String, dynamic>{};
+    data['_id'] = sId;
+    data['title'] = title;
+    data['pic'] = pic;
+    data['pid'] = pid;
+    data['sort'] = sort;
+    return data;
+  }
+}