repair_query_device_response_entity_helper.dart 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. import 'package:deus_app/model/repair_query_device_response_entity.dart';
  2. repairQueryDeviceResponseEntityFromJson(RepairQueryDeviceResponseEntity data, Map<String, dynamic> json) {
  3. if (json['code'] != null) {
  4. data.code = json['code'] is String
  5. ? int.tryParse(json['code'])
  6. : json['code'].toInt();
  7. }
  8. if (json['data'] != null) {
  9. data.data = RepairQueryDeviceResponseData().fromJson(json['data']);
  10. }
  11. if (json['msg'] != null) {
  12. data.msg = json['msg'].toString();
  13. }
  14. return data;
  15. }
  16. Map<String, dynamic> repairQueryDeviceResponseEntityToJson(RepairQueryDeviceResponseEntity entity) {
  17. final Map<String, dynamic> data = new Map<String, dynamic>();
  18. data['code'] = entity.code;
  19. data['data'] = entity.data.toJson();
  20. data['msg'] = entity.msg;
  21. return data;
  22. }
  23. repairQueryDeviceResponseDataFromJson(RepairQueryDeviceResponseData data, Map<String, dynamic> json) {
  24. if (json['index'] != null) {
  25. data.index = json['index'] is String
  26. ? int.tryParse(json['index'])
  27. : json['index'].toInt();
  28. }
  29. if (json['list'] != null) {
  30. data.xList = (json['list'] as List).map((v) => RepairQueryDeviceResponseDataList().fromJson(v)).toList();
  31. }
  32. if (json['query'] != null) {
  33. data.query = RepairQueryDeviceResponseDataQuery().fromJson(json['query']);
  34. }
  35. if (json['size'] != null) {
  36. data.size = json['size'] is String
  37. ? int.tryParse(json['size'])
  38. : json['size'].toInt();
  39. }
  40. if (json['sort'] != null) {
  41. data.sort = json['sort'] is String
  42. ? int.tryParse(json['sort'])
  43. : json['sort'].toInt();
  44. }
  45. if (json['sortBy'] != null) {
  46. data.sortBy = json['sortBy'].toString();
  47. }
  48. if (json['total'] != null) {
  49. data.total = json['total'] is String
  50. ? int.tryParse(json['total'])
  51. : json['total'].toInt();
  52. }
  53. return data;
  54. }
  55. Map<String, dynamic> repairQueryDeviceResponseDataToJson(RepairQueryDeviceResponseData entity) {
  56. final Map<String, dynamic> data = new Map<String, dynamic>();
  57. data['index'] = entity.index;
  58. data['list'] = entity.xList.map((v) => v.toJson()).toList();
  59. data['query'] = entity.query.toJson();
  60. data['size'] = entity.size;
  61. data['sort'] = entity.sort;
  62. data['sortBy'] = entity.sortBy;
  63. data['total'] = entity.total;
  64. return data;
  65. }
  66. repairQueryDeviceResponseDataListFromJson(RepairQueryDeviceResponseDataList data, Map<String, dynamic> json) {
  67. if (json['activationOn'] != null) {
  68. data.activationOn = json['activationOn'].toString();
  69. }
  70. if (json['activePeriod'] != null) {
  71. data.activePeriod = json['activePeriod'].toString();
  72. }
  73. if (json['authType'] != null) {
  74. data.authType = json['authType'] is String
  75. ? int.tryParse(json['authType'])
  76. : json['authType'].toInt();
  77. }
  78. if (json['channelId'] != null) {
  79. data.channelId = json['channelId'].toString();
  80. }
  81. if (json['connectionProtocol'] != null) {
  82. data.connectionProtocol = json['connectionProtocol'] is String
  83. ? int.tryParse(json['connectionProtocol'])
  84. : json['connectionProtocol'].toInt();
  85. }
  86. if (json['createdOn'] != null) {
  87. data.createdOn = json['createdOn'].toString();
  88. }
  89. if (json['customerId'] != null) {
  90. data.customerId = json['customerId'].toString();
  91. }
  92. if (json['description'] != null) {
  93. data.description = json['description'].toString();
  94. }
  95. if (json['deviceId'] != null) {
  96. data.deviceId = json['deviceId'].toString();
  97. }
  98. if (json['deviceKey'] != null) {
  99. data.deviceKey = json['deviceKey'].toString();
  100. }
  101. if (json['deviceSecret'] != null) {
  102. data.deviceSecret = json['deviceSecret'].toString();
  103. }
  104. if (json['finenessA'] != null) {
  105. data.finenessA = json['finenessA'].toString();
  106. }
  107. if (json['finenessB'] != null) {
  108. data.finenessB = json['finenessB'].toString();
  109. }
  110. if (json['holeCountA'] != null) {
  111. data.holeCountA = json['holeCountA'].toString();
  112. }
  113. if (json['holeCountB'] != null) {
  114. data.holeCountB = json['holeCountB'].toString();
  115. }
  116. if (json['id'] != null) {
  117. data.id = json['id'] is String
  118. ? int.tryParse(json['id'])
  119. : json['id'].toInt();
  120. }
  121. if (json['imei'] != null) {
  122. data.imei = json['imei'].toString();
  123. }
  124. if (json['iotId'] != null) {
  125. data.iotId = json['iotId'].toString();
  126. }
  127. if (json['ip'] != null) {
  128. data.ip = json['ip'].toString();
  129. }
  130. if (json['isActive'] != null) {
  131. data.isActive = json['isActive'] is String
  132. ? int.tryParse(json['isActive'])
  133. : json['isActive'].toInt();
  134. }
  135. if (json['isEnable'] != null) {
  136. data.isEnable = json['isEnable'] is String
  137. ? int.tryParse(json['isEnable'])
  138. : json['isEnable'].toInt();
  139. }
  140. if (json['lastOnlineOn'] != null) {
  141. data.lastOnlineOn = json['lastOnlineOn'].toString();
  142. }
  143. if (json['lastUpdateOn'] != null) {
  144. data.lastUpdateOn = json['lastUpdateOn'].toString();
  145. }
  146. if (json['name'] != null) {
  147. data.name = json['name'].toString();
  148. }
  149. if (json['nodeType'] != null) {
  150. data.nodeType = json['nodeType'] is String
  151. ? int.tryParse(json['nodeType'])
  152. : json['nodeType'].toInt();
  153. }
  154. if (json['number'] != null) {
  155. data.number = json['number'].toString();
  156. }
  157. if (json['positionId'] != null) {
  158. data.positionId = json['positionId'] is String
  159. ? int.tryParse(json['positionId'])
  160. : json['positionId'].toInt();
  161. }
  162. if (json['productId'] != null) {
  163. data.productId = json['productId'] is String
  164. ? int.tryParse(json['productId'])
  165. : json['productId'].toInt();
  166. }
  167. if (json['productKey'] != null) {
  168. data.productKey = json['productKey'].toString();
  169. }
  170. if (json['productName'] != null) {
  171. data.productName = json['productName'].toString();
  172. }
  173. if (json['showName'] != null) {
  174. data.showName = json['showName'].toString();
  175. }
  176. if (json['speedA'] != null) {
  177. data.speedA = json['speedA'].toString();
  178. }
  179. if (json['speedB'] != null) {
  180. data.speedB = json['speedB'].toString();
  181. }
  182. if (json['status'] != null) {
  183. data.status = json['status'] is String
  184. ? int.tryParse(json['status'])
  185. : json['status'].toInt();
  186. }
  187. return data;
  188. }
  189. Map<String, dynamic> repairQueryDeviceResponseDataListToJson(RepairQueryDeviceResponseDataList entity) {
  190. final Map<String, dynamic> data = new Map<String, dynamic>();
  191. data['activationOn'] = entity.activationOn;
  192. data['activePeriod'] = entity.activePeriod;
  193. data['authType'] = entity.authType;
  194. data['channelId'] = entity.channelId;
  195. data['connectionProtocol'] = entity.connectionProtocol;
  196. data['createdOn'] = entity.createdOn;
  197. data['customerId'] = entity.customerId;
  198. data['description'] = entity.description;
  199. data['deviceId'] = entity.deviceId;
  200. data['deviceKey'] = entity.deviceKey;
  201. data['deviceSecret'] = entity.deviceSecret;
  202. data['finenessA'] = entity.finenessA;
  203. data['finenessB'] = entity.finenessB;
  204. data['holeCountA'] = entity.holeCountA;
  205. data['holeCountB'] = entity.holeCountB;
  206. data['id'] = entity.id;
  207. data['imei'] = entity.imei;
  208. data['iotId'] = entity.iotId;
  209. data['ip'] = entity.ip;
  210. data['isActive'] = entity.isActive;
  211. data['isEnable'] = entity.isEnable;
  212. data['lastOnlineOn'] = entity.lastOnlineOn;
  213. data['lastUpdateOn'] = entity.lastUpdateOn;
  214. data['name'] = entity.name;
  215. data['nodeType'] = entity.nodeType;
  216. data['number'] = entity.number;
  217. data['positionId'] = entity.positionId;
  218. data['productId'] = entity.productId;
  219. data['productKey'] = entity.productKey;
  220. data['productName'] = entity.productName;
  221. data['showName'] = entity.showName;
  222. data['speedA'] = entity.speedA;
  223. data['speedB'] = entity.speedB;
  224. data['status'] = entity.status;
  225. return data;
  226. }
  227. repairQueryDeviceResponseDataQueryFromJson(RepairQueryDeviceResponseDataQuery data, Map<String, dynamic> json) {
  228. if (json['search'] != null) {
  229. data.search = json['search'].toString();
  230. }
  231. return data;
  232. }
  233. Map<String, dynamic> repairQueryDeviceResponseDataQueryToJson(RepairQueryDeviceResponseDataQuery entity) {
  234. final Map<String, dynamic> data = new Map<String, dynamic>();
  235. data['search'] = entity.search;
  236. return data;
  237. }