123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- import 'aIDiagnosis.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;
- }
- }
- enum UploadFileTypeEnum {
- Unknown,
- EXE,
- APK,
- IPA,
- ZIP,
- DAT,
- RAR,
- PNG,
- ICON,
- BMP,
- JPEG,
- JPG,
- GIF,
- WEBP,
- TIFF,
- IMG,
- PDF,
- DOC,
- DOCX,
- XLS,
- XLSX,
- MP4,
- MSI,
- VID,
- }
- enum ApplicantTypeEnum {
- Client,
- Device,
- Management,
- ThirdParty,
- Server,
- }
- class FileServiceRequest extends TokenRequest{
- String? fileName;
- UploadFileTypeEnum fileTypeEnum;
- ApplicantTypeEnum applicantTypeEnum;
- FileServiceRequest({
- this.fileName,
- this.fileTypeEnum = UploadFileTypeEnum.Unknown,
- this.applicantTypeEnum = ApplicantTypeEnum.Client,
- String? token,
- }) : super(
- token: token,
- );
- factory FileServiceRequest.fromJson(Map<String, dynamic> map) {
- return FileServiceRequest(
- fileName: map['FileName'],
- fileTypeEnum: UploadFileTypeEnum.values.firstWhere((e) => e.index == map['FileTypeEnum']),
- applicantTypeEnum: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ApplicantTypeEnum']),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(fileName != null)
- map['FileName'] = fileName;
- map['FileTypeEnum'] = fileTypeEnum.index;
- map['ApplicantTypeEnum'] = applicantTypeEnum.index;
- return map;
- }
- }
|