connect.m.dart 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. class ConnectResult {
  2. String? token;
  3. String? uniqueCode;
  4. ConnectResult({
  5. this.token,
  6. this.uniqueCode,
  7. });
  8. factory ConnectResult.fromJson(Map<String, dynamic> map) {
  9. return ConnectResult(
  10. token: map['Token'],
  11. uniqueCode: map['UniqueCode'],
  12. );
  13. }
  14. Map<String, dynamic> toJson() {
  15. final map = Map<String, dynamic>();
  16. if(token != null)
  17. map['Token'] = token;
  18. if(uniqueCode != null)
  19. map['UniqueCode'] = uniqueCode;
  20. return map;
  21. }
  22. }
  23. class ConnectRequest {
  24. String? deviceUniqueCode;
  25. String? password;
  26. String? deviceModel;
  27. String? deviceType;
  28. String? softwareVersion;
  29. String? systemVersion;
  30. String? cPUModel;
  31. String? systemLanguage;
  32. String? description;
  33. String? name;
  34. String? organizationCode;
  35. ConnectRequest({
  36. this.deviceUniqueCode,
  37. this.password,
  38. this.deviceModel,
  39. this.deviceType,
  40. this.softwareVersion,
  41. this.systemVersion,
  42. this.cPUModel,
  43. this.systemLanguage,
  44. this.description,
  45. this.name,
  46. this.organizationCode,
  47. });
  48. factory ConnectRequest.fromJson(Map<String, dynamic> map) {
  49. return ConnectRequest(
  50. deviceUniqueCode: map['DeviceUniqueCode'],
  51. password: map['Password'],
  52. deviceModel: map['DeviceModel'],
  53. deviceType: map['DeviceType'],
  54. softwareVersion: map['SoftwareVersion'],
  55. systemVersion: map['SystemVersion'],
  56. cPUModel: map['CPUModel'],
  57. systemLanguage: map['SystemLanguage'],
  58. description: map['Description'],
  59. name: map['Name'],
  60. organizationCode: map['OrganizationCode'],
  61. );
  62. }
  63. Map<String, dynamic> toJson() {
  64. final map = Map<String, dynamic>();
  65. if(deviceUniqueCode != null)
  66. map['DeviceUniqueCode'] = deviceUniqueCode;
  67. if(password != null)
  68. map['Password'] = password;
  69. if(deviceModel != null)
  70. map['DeviceModel'] = deviceModel;
  71. if(deviceType != null)
  72. map['DeviceType'] = deviceType;
  73. if(softwareVersion != null)
  74. map['SoftwareVersion'] = softwareVersion;
  75. if(systemVersion != null)
  76. map['SystemVersion'] = systemVersion;
  77. if(cPUModel != null)
  78. map['CPUModel'] = cPUModel;
  79. if(systemLanguage != null)
  80. map['SystemLanguage'] = systemLanguage;
  81. if(description != null)
  82. map['Description'] = description;
  83. if(name != null)
  84. map['Name'] = name;
  85. if(organizationCode != null)
  86. map['OrganizationCode'] = organizationCode;
  87. return map;
  88. }
  89. }