cookbook_model.dart 4.09 KB
///菜单

class MenuModel {
  String id;
  String sellerid;
  String className;
  dynamic classLabel;
  String order;
  String status;
  String classType;
  List<MenuSunModel> cookbooklist;

  MenuModel(
      {this.id,
      this.sellerid,
      this.className,
      this.classLabel,
      this.order,
      this.status,
      this.classType,
      this.cookbooklist});

  MenuModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sellerid = json['sellerid'];
    className = json['class_name'];
    classLabel = json['class_label'];
    order = json['order'];
    status = json['status'];
    classType = json['class_type'];
    if (json['cookbooklist'] != null) {
      cookbooklist = [];
      json['cookbooklist'][0].forEach((v) {
        cookbooklist.add(new MenuSunModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['sellerid'] = this.sellerid;
    data['class_name'] = this.className;
    data['class_label'] = this.classLabel;
    data['order'] = this.order;
    data['status'] = this.status;
    data['class_type'] = this.classType;
    if (this.cookbooklist != null) {
      data['cookbooklist'] = this.cookbooklist.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class MenuSunModel {
  String id;
  String sellerid;
  String mid;
  String cid;
  String lid;
  String unit;
  String name;
  String price;
  String member_price;
  String first_name;
  String search_code;
  String channel;
  String dishesvideo;
  String dishesgif;
  String status;

  String setup;
  String give;
  String clear_num;
  String record_num;
  String image;
  String is_weigh;
  String desc;
  String order_o;
  String cdate;
  List spec;
  int isSpec;
  List practice;

  MenuSunModel({
    this.id,
    this.sellerid,
    this.mid,
    this.cid,
    this.lid,
    this.unit,
    this.name,
    this.price,
    this.member_price,
    this.first_name,
    this.search_code,
    this.channel,
    this.dishesvideo,
    this.dishesgif,
    this.status,
    this.setup,
    this.give,
    this.clear_num,
    this.record_num,
    this.image,
    this.is_weigh,
    this.desc,
    this.order_o,
    this.cdate,
    this.spec,
    this.isSpec,
    this.practice,
  });

  MenuSunModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sellerid = json['sellerid'];
    mid = json['mid'];
    lid = json['lid'];
    unit = json['unit'];
    name = json['name'];
    price = json['price'];
    member_price = json['member_price'];
    first_name = json['first_name'];
    search_code = json['search_code'];
    channel = json['channel'];
    dishesvideo = json['dishesvideo'];
    dishesgif = json['dishesgif'];
    status = json['status'];
    setup = json['setup'];
    give = json['give'];
    clear_num = json['clear_num'];
    record_num = json['record_num'];
    image = json['image'];
    is_weigh = json['is_weigh'];
    desc = json['desc'];
    order_o = json['order_o'];
    cdate = json['cdate'];
    spec = json['spec'];
    isSpec = json['isSpec'];
    practice = json['practice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['sellerid'] = this.sellerid;
    data['mid'] = this.mid;
    data['lid'] = this.lid;
    data['unit'] = this.unit;
    data['name'] = this.name;
    data['price'] = this.price;
    data['member_price'] = this.member_price;
    data['first_name'] = this.first_name;
    data['search_code'] = this.search_code;
    data['channel'] = this.channel;
    data['dishesvideo'] = this.dishesvideo;
    data['dishesgif'] = this.dishesgif;
    data['status'] = this.status;
    data['setup'] = this.setup;
    data['give'] = this.give;
    data['clear_num'] = this.clear_num;

    data['record_num'] = this.record_num;
    data['image'] = this.image;
    data['is_weigh'] = this.is_weigh;
    data['desc'] = this.desc;
    data['order_o'] = this.order_o;
    data['cdate'] = this.cdate;
    data['spec'] = this.spec;
    data['isSpec'] = this.isSpec;
    data['practice'] = this.practice;
    return data;
  }
}