You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.6KB

  1. class RequestGeneralModel {
  2. int cropId;
  3. int activityId;
  4. String executeDate;
  5. String description;
  6. List<ObjectUpdateDetail> objectUpdateDetail;
  7. RequestGeneralModel(
  8. {this.cropId,
  9. this.activityId,
  10. this.executeDate,
  11. this.description,
  12. this.objectUpdateDetail});
  13. RequestGeneralModel.fromJson(Map<String, dynamic> json) {
  14. cropId = json['cropId'];
  15. activityId = json['activityId'];
  16. executeDate = json['executeDate'];
  17. description = json['description'];
  18. if (json['objectUpdateDetail'] != null) {
  19. objectUpdateDetail = new List<ObjectUpdateDetail>();
  20. json['objectUpdateDetail'].forEach((v) {
  21. objectUpdateDetail.add(new ObjectUpdateDetail.fromJson(v));
  22. });
  23. }
  24. }
  25. Map<String, dynamic> toJson() {
  26. final Map<String, dynamic> data = new Map<String, dynamic>();
  27. data['cropId'] = this.cropId;
  28. data['activityId'] = this.activityId;
  29. data['executeDate'] = this.executeDate;
  30. data['description'] = this.description;
  31. if (this.objectUpdateDetail != null) {
  32. data['objectUpdateDetail'] =
  33. this.objectUpdateDetail.map((v) => v.toJson()).toList();
  34. }
  35. return data;
  36. }
  37. }
  38. class ObjectUpdateDetail {
  39. String name;
  40. String index;
  41. ObjectUpdateDetail({this.name, this.index});
  42. ObjectUpdateDetail.fromJson(Map<String, dynamic> json) {
  43. name = json['name'];
  44. index = json['index'];
  45. }
  46. Map<String, dynamic> toJson() {
  47. final Map<String, dynamic> data = new Map<String, dynamic>();
  48. data['name'] = this.name;
  49. data['index'] = this.index;
  50. return data;
  51. }
  52. }