created_order_model.dart 4.16 KB
import 'package:json_annotation/json_annotation.dart';

part 'created_order_model.g.dart';

@JsonSerializable()
class CreatedOrderModel extends Object {
  @JsonKey(name: 'ret')
  int ret;

  @JsonKey(name: 'data')
  CreatedOrderSunModel data;

  @JsonKey(name: 'msg')
  String msg;

  CreatedOrderModel(
    this.ret,
    this.data,
    this.msg,
  );

  factory CreatedOrderModel.fromJson(Map<String, dynamic> srcJson) =>
      _$CreatedOrderModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CreatedOrderModelToJson(this);
}

@JsonSerializable()
class CreatedOrderSunModel extends Object {
  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'rid')
  String rid;
  @JsonKey(name: 'ddate')
  String ddate;

  @JsonKey(name: 'no')
  String no;

  @JsonKey(name: 'row_num')
  String rowNum;

  @JsonKey(name: 'pnum')
  String pnum;

  @JsonKey(name: 'sellerid')
  String sellerid;

  @JsonKey(name: 'openid')
  String openid;

  @JsonKey(name: 'price')
  int price;

  @JsonKey(name: 'type')
  String type;

  @JsonKey(name: 'behavior')
  String behavior;

  @JsonKey(name: 'cdate')
  String cdate;

  @JsonKey(name: 'remark')
  String remark;

  @JsonKey(name: 'cookbooklist')
  List<Cookbooklist> cookbooklist;

  @JsonKey(name: 'seller')
  Seller seller;

  CreatedOrderSunModel(
      this.id,
      this.rid,
      this.ddate,
      this.no,
      this.rowNum,
      this.pnum,
      this.sellerid,
      this.openid,
      this.price,
      this.type,
      this.behavior,
      this.cdate,
      this.cookbooklist,
      this.seller,
      this.remark);

  factory CreatedOrderSunModel.fromJson(Map<String, dynamic> srcJson) =>
      _$CreatedOrderSunModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CreatedOrderSunModelToJson(this);
}

@JsonSerializable()
class Cookbooklist extends Object {
  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'orderid')
  String orderid;

  @JsonKey(name: 'openid')
  String openid;

  @JsonKey(name: 'cookbookid')
  String cookbookid;

  @JsonKey(name: 'total')
  String total;

  @JsonKey(name: 'price')
  String price;

  @JsonKey(name: 'cookname')
  String cookname;

  @JsonKey(name: 'cookunit')
  String cookunit;

  @JsonKey(name: 'cookimage')
  String cookimage;

  @JsonKey(name: 'class_name')
  String className;

  @JsonKey(name: 'classid')
  String classid;

  @JsonKey(name: 'class_order')
  String classOrder;

  @JsonKey(name: 'source')
  String source;

  @JsonKey(name: 'status')
  String status;

  @JsonKey(name: 'identity')
  String identity;

  @JsonKey(name: 'cdate')
  String cdate;

  @JsonKey(name: 'num')
  String number;

  @JsonKey(name: 'practice_name')
  String practiceName;

  @JsonKey(name: 'spec_price')
  String specPrice;

  @JsonKey(name: 'spec_member_price')
  String specMemberPrice;

  @JsonKey(name: 'spec_name')
  String specName;

  Cookbooklist(
      this.id,
      this.orderid,
      this.openid,
      this.cookbookid,
      this.total,
      this.price,
      this.cookname,
      this.cookunit,
      this.cookimage,
      this.className,
      this.classid,
      this.classOrder,
      this.source,
      this.status,
      this.identity,
      this.cdate,
      this.number,
      this.practiceName,
      this.specPrice,
      this.specMemberPrice,
      this.specName
      );

  factory Cookbooklist.fromJson(Map<String, dynamic> srcJson) =>
      _$CookbooklistFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CookbooklistToJson(this);
}

@JsonSerializable()
class Seller extends Object {
  @JsonKey(name: 'id')
  String id;

  @JsonKey(name: 'sellername')
  String sellername;

  @JsonKey(name: 'seller_image')
  String sellerImage;

  @JsonKey(name: 'phone')
  String phone;

  @JsonKey(name: 'map_address')
  String mapAddress;

  @JsonKey(name: 'last_num')
  String lastNum;

  @JsonKey(name: 'long')
  String long;

  @JsonKey(name: 'lat')
  String lat;

  @JsonKey(name: 'daily')
  String daily;

  Seller(
    this.id,
    this.sellername,
    this.sellerImage,
    this.phone,
    this.mapAddress,
    this.lastNum,
    this.long,
    this.lat,
    this.daily,
  );

  factory Seller.fromJson(Map<String, dynamic> srcJson) =>
      _$SellerFromJson(srcJson);

  Map<String, dynamic> toJson() => _$SellerToJson(this);
}