import 'package:fengshui_compass/models/qimen_result.dart';

class Qimen {
  String jieqi;
  String dunju;
  String zhifu;
  String zhishi;
  String bazi;
  List<String> kong;
  List<QimenResult> qimenResult;

  Qimen(
      {this.jieqi,
        this.dunju,
        this.zhifu,
        this.zhishi,
        this.bazi,
        this.kong,
        this.qimenResult});

  Qimen.fromJson(Map<String, dynamic> json) {
    jieqi = json['jieqi'];
    dunju = json['dunju'];
    zhifu = json['zhifu'];
    zhishi = json['zhishi'];
    bazi = json['bazi'];
    kong = json['kong'].cast<String>();
    if (json['qimenResult'] != null) {
      qimenResult = [];
      json['qimenResult'].forEach((v) {
        qimenResult.add(QimenResult.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['jieqi'] = jieqi;
    data['dunju'] = dunju;
    data['zhifu'] = zhifu;
    data['zhishi'] = zhishi;
    data['bazi'] = bazi;
    data['kong'] = kong;
    if (this.qimenResult != null) {
      data['qimenResult'] = qimenResult.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

