storage.m.dart 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import 'liveConsultation.m.dart';
  2. class StorageRequest {
  3. List<int>? file;
  4. String? authorization;
  5. StorageRequest({
  6. this.file,
  7. this.authorization,
  8. });
  9. factory StorageRequest.fromJson(Map<String, dynamic> map) {
  10. final fileData = map['File'];
  11. return StorageRequest(
  12. file: fileData != null ? (fileData as List).map((e) => e as int).toList(): null,
  13. authorization: map['Authorization'],
  14. );
  15. }
  16. Map<String, dynamic> toJson() {
  17. final map = Map<String, dynamic>();
  18. if(file != null)
  19. map['File'] = file;
  20. if(authorization != null)
  21. map['Authorization'] = authorization;
  22. return map;
  23. }
  24. }
  25. class StorageServiceSettingDTO {
  26. String? authorization;
  27. String? contentType;
  28. String? storageUrl;
  29. StorageServiceSettingDTO({
  30. this.authorization,
  31. this.contentType,
  32. this.storageUrl,
  33. });
  34. factory StorageServiceSettingDTO.fromJson(Map<String, dynamic> map) {
  35. return StorageServiceSettingDTO(
  36. authorization: map['Authorization'],
  37. contentType: map['ContentType'],
  38. storageUrl: map['StorageUrl'],
  39. );
  40. }
  41. Map<String, dynamic> toJson() {
  42. final map = Map<String, dynamic>();
  43. if(authorization != null)
  44. map['Authorization'] = authorization;
  45. if(contentType != null)
  46. map['ContentType'] = contentType;
  47. if(storageUrl != null)
  48. map['StorageUrl'] = storageUrl;
  49. return map;
  50. }
  51. }
  52. class FileServiceRequest extends TokenRequest{
  53. String? fileName;
  54. bool isRechristen;
  55. bool isUpgradePackage;
  56. FileServiceRequest({
  57. this.fileName,
  58. this.isRechristen = false,
  59. this.isUpgradePackage = false,
  60. String? token,
  61. }) : super(
  62. token: token,
  63. );
  64. factory FileServiceRequest.fromJson(Map<String, dynamic> map) {
  65. return FileServiceRequest(
  66. fileName: map['FileName'],
  67. isRechristen: map['IsRechristen'],
  68. isUpgradePackage: map['IsUpgradePackage'],
  69. token: map['Token'],
  70. );
  71. }
  72. Map<String, dynamic> toJson() {
  73. final map = super.toJson();
  74. if(fileName != null)
  75. map['FileName'] = fileName;
  76. map['IsRechristen'] = isRechristen;
  77. map['IsUpgradePackage'] = isUpgradePackage;
  78. return map;
  79. }
  80. }
  81. class CheckStorageRequest {
  82. String? fileName;
  83. CheckStorageRequest({
  84. this.fileName,
  85. });
  86. factory CheckStorageRequest.fromJson(Map<String, dynamic> map) {
  87. return CheckStorageRequest(
  88. fileName: map['FileName'],
  89. );
  90. }
  91. Map<String, dynamic> toJson() {
  92. final map = Map<String, dynamic>();
  93. if(fileName != null)
  94. map['FileName'] = fileName;
  95. return map;
  96. }
  97. }