uploadFileManager.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // uploadFileManager.h
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2023/11/15.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "uploadFileDataModel.h"
  9. #import "TZImageManager.h"
  10. #import "TZAssetModel+imageData.h"
  11. #import "cachesFileManager.h"
  12. #import "connectDeviceManager.h"
  13. //#define upLoadFile_image_tableName @"upLoadFile_image_tableName"
  14. #define upLoadFile_image_tableName [[NSString alloc] initWithFormat:@"upLoadFile_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
  15. NS_ASSUME_NONNULL_BEGIN
  16. #define custom_complete_B void(^_Nullable)(BOOL isSuccess)
  17. #define custom_complete_Arr void(^_Nullable)(NSMutableArray * Arr)
  18. @interface uploadFileManager : NSObject
  19. +(uploadFileManager *)shareInstance;
  20. //数据库数据
  21. @property (nonatomic, strong) NSMutableArray * _Nullable databaseArr;
  22. //排队等待上传的文件列表
  23. @property (nonatomic, strong) NSMutableArray * _Nullable fileModelDataArr;
  24. @property (nonatomic, strong) uploadFileDataModel *curUploadFileDataModel;//当前上传的文件
  25. @property (nonatomic, assign) BOOL isSuspendType;
  26. @property (nonatomic, assign) BOOL isUploadIngType;
  27. @property (nonatomic, assign) NSInteger curUploadModelNumbers;
  28. @property (nonatomic, assign) NSInteger reUploadIngSelectIndex;
  29. @property (nonatomic, assign) BOOL isNewAddTaskType;
  30. #pragma mark 读取数据库数据
  31. - (void)getDataInDatabaseFun:(BOOL)isReGet complete:(custom_complete_Arr)complete;
  32. //把TZAssetModel 转成 我们需要上传的model
  33. - (void)handlTZAssetModelToUploadFileDataFunBy:(NSMutableArray*)indexPathsForSelectedItems complete:(custom_complete_Arr)complete;
  34. //暂停上传 当 isSuspendAll为NO时候 传指定暂停哪一个
  35. - (void)suspendUploadFileFun:(BOOL)isSuspendAll withModel:(uploadFileDataModel*)model;
  36. //文件重新上传
  37. - (void)reUploadFileFunBy:(NSMutableArray*)Arr withAll:(BOOL)isAllType;
  38. //文件上传完成
  39. - (void)uploadFileDoneFun;
  40. //文件上传失败
  41. - (void)uploadFileFailFun;
  42. //修改文件上传的状态
  43. - (void)changeUploadFileState:(uploadStateType)curUploadStateType withDidUploadBytes:(long)didUpLoadBytes withModel:(uploadFileDataModel*)model complete:(custom_complete_B)complete;
  44. //删除本地数据库记录
  45. - (void)deleteUploadFileRecordBy:(NSMutableArray *)delArr withDelCache:(BOOL)isDelCache complete:(custom_complete_B)complete;
  46. - (void)checkReUploadFileFun;
  47. //检测是否在上传中
  48. - (BOOL)checkUploadingFun;
  49. - (void)checkHadUploadTaskWithComplete:(custom_complete_B)complete;
  50. @end
  51. NS_ASSUME_NONNULL_END