123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. List<ContentImageList> jsonToContentList(list) {
  2. List<ContentImageList> contList = [];
  3. list.forEach((item) {
  4. contList.add(ContentImageList.fromJson(item));
  5. });
  6. return contList;
  7. }
  8. List<BannerImageList> jsonToImagesList(list) {
  9. List<BannerImageList> contList = [];
  10. list.forEach((item) {
  11. contList.add(BannerImageList.fromJson(item));
  12. });
  13. return contList;
  14. }
  15. class CardInfo {
  16. // @ApiModelProperty(value = "农机Id")
  17. String? machineryId;
  18. // @ApiModelProperty(value = "名称")
  19. String? name;
  20. // @ApiModelProperty(value = "农机类型")
  21. String? typeId;
  22. // @ApiModelProperty(value = "类型名称")
  23. String? typeName;
  24. // @ApiModelProperty(value = "农机价格")
  25. num? price;
  26. // @ApiModelProperty(value = "主图")
  27. String? thumb;
  28. // @ApiModelProperty(value = "当前位置")
  29. String? location;
  30. // @ApiModelProperty(value = "距离")
  31. double? distance;
  32. // @ApiModelProperty(value = "机构ID")
  33. String? orgId;
  34. // @ApiModelProperty(value = "机构名称")
  35. String? orgName;
  36. // @ApiModelProperty(value = "工作状态")
  37. String? jobStatus;
  38. // @ApiModelProperty(value = "状态")
  39. int? status;
  40. // @ApiModelProperty(value = "内容详情")
  41. List<ContentImageList>? contentList=[];
  42. // @ApiModelProperty(value = "图片列表")
  43. List<BannerImageList>? imagesList=[];
  44. CardInfo();
  45. CardInfo.fromJson(Map<String, dynamic> json)
  46. : machineryId = json["machineryId"],
  47. name = json["name"],
  48. typeId = json["typeId"],
  49. typeName = json["typeName"],
  50. price = json["price"],
  51. thumb = json["thumb"],
  52. location = json["location"],
  53. distance = json["distance"],
  54. orgId = json["orgId"],
  55. orgName = json["orgName"],
  56. jobStatus = json["jobStatus"],
  57. status = json["status"],
  58. contentList = jsonToContentList(json["contentList"]),
  59. imagesList = jsonToImagesList(json["imagesList"]);
  60. Map<String, dynamic> toJson() => {
  61. 'machineryId': machineryId,
  62. 'name': name,
  63. 'typeId': typeId,
  64. 'typeName': typeName,
  65. 'price': price,
  66. 'thumb': thumb,
  67. 'location': location,
  68. 'distance': distance,
  69. 'orgId': orgId,
  70. 'orgName': orgName,
  71. 'jobStatus': jobStatus,
  72. 'status': status,
  73. 'contentList': contentList,
  74. 'imagesList': imagesList,
  75. };
  76. }
  77. class ContentImageList {
  78. String? content;
  79. String? contentType;
  80. String? createDate;
  81. String? extId;
  82. String? sort;
  83. String? targetId;
  84. String? targetType;
  85. ContentImageList();
  86. ContentImageList.fromJson(Map<String, dynamic> json)
  87. : content = json["content"],
  88. contentType = json["contentType"],
  89. createDate = json["createDate"],
  90. extId = json["extId"],
  91. sort = json["sort"],
  92. targetId = json["targetId"],
  93. targetType = json["targetType"];
  94. Map<String, dynamic> toJson() => {
  95. 'content': content,
  96. 'contentType': contentType,
  97. 'createDate': createDate,
  98. 'extId': extId,
  99. 'sort': sort,
  100. 'targetId': targetId,
  101. 'targetType': targetType,
  102. };
  103. }
  104. class BannerImageList {
  105. String? createDate;
  106. String? imageId;
  107. num? status;
  108. String? targetId;
  109. String? targetType;
  110. String? url;
  111. BannerImageList();
  112. BannerImageList.fromJson(Map<String, dynamic> json)
  113. : createDate = json["createDate"],
  114. imageId = json["imageId"],
  115. status = json["status"],
  116. targetId = json["targetId"],
  117. targetType = json["targetType"],
  118. url = json["url"];
  119. Map<String, dynamic> toJson() => {
  120. 'createDate': createDate,
  121. 'imageId': imageId,
  122. 'status': status,
  123. 'targetId': targetId,
  124. 'targetType': targetType,
  125. 'url': url,
  126. };
  127. }