123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- import 'liveConsultation.m.dart';
- class StorageRequest {
- List<int>? file;
- String? authorization;
- StorageRequest({
- this.file,
- this.authorization,
- });
- factory StorageRequest.fromJson(Map<String, dynamic> map) {
- final fileData = map['File'];
- return StorageRequest(
- file: fileData != null ? (fileData as List).map((e) => e as int).toList(): null,
- authorization: map['Authorization'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (file != null) {
- map['File'] = file;
- }
- if (authorization != null) {
- map['Authorization'] = authorization;
- }
- return map;
- }
- }
- class StorageServiceSettingDTO {
- String? authorization;
- String? contentType;
- String? storageUrl;
- StorageServiceSettingDTO({
- this.authorization,
- this.contentType,
- this.storageUrl,
- });
- factory StorageServiceSettingDTO.fromJson(Map<String, dynamic> map) {
- return StorageServiceSettingDTO(
- authorization: map['Authorization'],
- contentType: map['ContentType'],
- storageUrl: map['StorageUrl'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (authorization != null) {
- map['Authorization'] = authorization;
- }
- if (contentType != null) {
- map['ContentType'] = contentType;
- }
- if (storageUrl != null) {
- map['StorageUrl'] = storageUrl;
- }
- return map;
- }
- }
- class FileServiceRequest extends TokenRequest{
- String? fileName;
- bool isRechristen;
- bool isUpgradePackage;
- List<DataItemDTO>? urlParams;
- List<DataItemDTO>? headerParams;
- String? requestMethod;
- FileServiceRequest({
- this.fileName,
- this.isRechristen = false,
- this.isUpgradePackage = false,
- this.urlParams,
- this.headerParams,
- this.requestMethod,
- String? token,
- }) : super(
- token: token,
- );
- factory FileServiceRequest.fromJson(Map<String, dynamic> map) {
- return FileServiceRequest(
- fileName: map['FileName'],
- isRechristen: map['IsRechristen'],
- isUpgradePackage: map['IsUpgradePackage'],
- urlParams: map['UrlParams'] != null ? (map['UrlParams'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- headerParams: map['HeaderParams'] != null ? (map['HeaderParams'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- requestMethod: map['RequestMethod'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (fileName != null)
- map['FileName'] = fileName;
- map['IsRechristen'] = isRechristen;
- map['IsUpgradePackage'] = isUpgradePackage;
- if (urlParams != null)
- map['UrlParams'] = urlParams;
- if (headerParams != null)
- map['HeaderParams'] = headerParams;
- if (requestMethod != null)
- map['RequestMethod'] = requestMethod;
- return map;
- }
- }
- class CheckStorageRequest {
- String? fileName;
- CheckStorageRequest({
- this.fileName,
- });
- factory CheckStorageRequest.fromJson(Map<String, dynamic> map) {
- return CheckStorageRequest(
- fileName: map['FileName'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (fileName != null) {
- map['FileName'] = fileName;
- }
- return map;
- }
- }
- class CheckFileIsExistRequest {
- String? oriFileName;
- int fileSize;
- bool isNeedPartUpload;
- bool isUpgradePackage;
- CheckFileIsExistRequest({
- this.oriFileName,
- this.fileSize = 0,
- this.isNeedPartUpload = false,
- this.isUpgradePackage = false,
- });
- factory CheckFileIsExistRequest.fromJson(Map<String, dynamic> map) {
- return CheckFileIsExistRequest(
- oriFileName: map['OriFileName'],
- fileSize: map['FileSize'],
- isNeedPartUpload: map['IsNeedPartUpload'],
- isUpgradePackage: map['IsUpgradePackage'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (oriFileName != null) {
- map['OriFileName'] = oriFileName;
- }
- map['FileSize'] = fileSize;
- map['IsNeedPartUpload'] = isNeedPartUpload;
- map['IsUpgradePackage'] = isUpgradePackage;
- return map;
- }
- }
- class CopyToOtherNodeRequest extends TokenRequest{
- String? fileName;
- String? fileUrl;
- CopyToOtherNodeRequest({
- this.fileName,
- this.fileUrl,
- String? token,
- }) : super(
- token: token,
- );
- factory CopyToOtherNodeRequest.fromJson(Map<String, dynamic> map) {
- return CopyToOtherNodeRequest(
- fileName: map['FileName'],
- fileUrl: map['FileUrl'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (fileName != null)
- map['FileName'] = fileName;
- if (fileUrl != null)
- map['FileUrl'] = fileUrl;
- return map;
- }
- }
- class UploadFileTransferRequest extends TokenRequest{
- String? sourceFilePath;
- bool isRechristen;
- bool isNeedPartUpload;
- bool isCopy;
- UploadFileTransferRequest({
- this.sourceFilePath,
- this.isRechristen = false,
- this.isNeedPartUpload = false,
- this.isCopy = false,
- String? token,
- }) : super(
- token: token,
- );
- factory UploadFileTransferRequest.fromJson(Map<String, dynamic> map) {
- return UploadFileTransferRequest(
- sourceFilePath: map['SourceFilePath'],
- isRechristen: map['IsRechristen'],
- isNeedPartUpload: map['IsNeedPartUpload'],
- isCopy: map['IsCopy'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (sourceFilePath != null)
- map['SourceFilePath'] = sourceFilePath;
- map['IsRechristen'] = isRechristen;
- map['IsNeedPartUpload'] = isNeedPartUpload;
- map['IsCopy'] = isCopy;
- return map;
- }
- }
|