album.dart 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. class Album {
  2. String rEQ;
  3. String rEQDT;
  4. String rESDT;
  5. int status;
  6. List<Result> result;
  7. Album({this.rEQ, this.rEQDT, this.rESDT, this.status, this.result});
  8. Album.fromJson(Map<String, dynamic> json) {
  9. rEQ = json['REQ'];
  10. rEQDT = json['REQ_DT'];
  11. rESDT = json['RES_DT'];
  12. status = json['status'];
  13. if (json['result'] != null) {
  14. result = new List<Result>();
  15. json['result'].forEach((v) {
  16. result.add(new Result.fromJson(v));
  17. });
  18. }
  19. }
  20. Map<String, dynamic> toJson() {
  21. final Map<String, dynamic> data = new Map<String, dynamic>();
  22. data['REQ'] = this.rEQ;
  23. data['REQ_DT'] = this.rEQDT;
  24. data['RES_DT'] = this.rESDT;
  25. data['status'] = this.status;
  26. if (this.result != null) {
  27. data['result'] = this.result.map((v) => v.toJson()).toList();
  28. }
  29. return data;
  30. }
  31. }
  32. class Result {
  33. String sId;
  34. String title;
  35. String section;
  36. String type;
  37. String content;
  38. String charge;
  39. String recommand;
  40. String createdAt;
  41. Poster poster;
  42. double narationDuration;
  43. Poster naration;
  44. Result(
  45. {this.sId,
  46. this.title,
  47. this.section,
  48. this.type,
  49. this.content,
  50. this.charge,
  51. this.recommand,
  52. this.createdAt,
  53. this.poster,
  54. this.narationDuration,
  55. this.naration});
  56. Result.fromJson(Map<String, dynamic> json) {
  57. sId = json['_id'];
  58. title = json['title'];
  59. section = json['section'];
  60. type = json['type'];
  61. content = json['content'];
  62. charge = json['charge'];
  63. recommand = json['recommand'];
  64. createdAt = json['createdAt'];
  65. poster = json['poster'] != null ? new Poster.fromJson(json['poster']) : null;
  66. narationDuration = json['naration_duration'];
  67. naration = json['naration'] != null ? new Poster.fromJson(json['naration']) : null;
  68. }
  69. Map<String, dynamic> toJson() {
  70. final Map<String, dynamic> data = new Map<String, dynamic>();
  71. data['_id'] = this.sId;
  72. data['title'] = this.title;
  73. data['section'] = this.section;
  74. data['type'] = this.type;
  75. data['content'] = this.content;
  76. data['charge'] = this.charge;
  77. data['recommand'] = this.recommand;
  78. data['createdAt'] = this.createdAt;
  79. if (this.poster != null) {
  80. data['poster'] = this.poster.toJson();
  81. }
  82. data['naration_duration'] = this.narationDuration;
  83. if (this.naration != null) {
  84. data['naration'] = this.naration.toJson();
  85. }
  86. return data;
  87. }
  88. }
  89. class Poster {
  90. String name;
  91. String filename;
  92. int length;
  93. String type;
  94. Poster({this.name, this.filename, this.length, this.type});
  95. Poster.fromJson(Map<String, dynamic> json) {
  96. name = json['name'];
  97. filename = json['filename'];
  98. length = json['length'];
  99. type = json['type'];
  100. }
  101. Map<String, dynamic> toJson() {
  102. final Map<String, dynamic> data = new Map<String, dynamic>();
  103. data['name'] = this.name;
  104. data['filename'] = this.filename;
  105. data['length'] = this.length;
  106. data['type'] = this.type;
  107. return data;
  108. }
  109. }