//
//  uploadFileManager.h
//  隐私保护
//
//  Created by xd h on 2023/11/15.
//

#import <Foundation/Foundation.h>
#import "uploadFileDataModel.h"
#import "TZImageManager.h"
#import "TZAssetModel+imageData.h"
#import "cachesFileManager.h"
#import "connectDeviceManager.h"


//#define upLoadFile_image_tableName @"upLoadFile_image_tableName"
#define upLoadFile_image_tableName [[NSString alloc] initWithFormat:@"upLoadFile_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]

NS_ASSUME_NONNULL_BEGIN

#define custom_complete_B void(^_Nullable)(BOOL isSuccess)
#define custom_complete_Arr void(^_Nullable)(NSMutableArray * Arr)

@interface uploadFileManager : NSObject
+(uploadFileManager *)shareInstance;
//数据库数据
@property (nonatomic, strong) NSMutableArray * _Nullable databaseArr;

//排队等待上传的文件列表
@property (nonatomic, strong) NSMutableArray * _Nullable fileModelDataArr;
@property (nonatomic, strong) uploadFileDataModel *curUploadFileDataModel;//当前上传的文件
@property (nonatomic, assign) BOOL  isSuspendType;
@property (nonatomic, assign) BOOL  isUploadIngType;
@property (nonatomic, assign) NSInteger  curUploadModelNumbers;

#pragma mark 读取数据库数据
- (void)getDataInDatabaseFun:(BOOL)isReGet complete:(custom_complete_Arr)complete;

//把TZAssetModel 转成 我们需要上传的model
- (void)handlTZAssetModelToUploadFileDataFunBy:(NSMutableArray*)indexPathsForSelectedItems complete:(custom_complete_Arr)complete;
//暂停上传
- (void)suspendUploadFileFun:(BOOL)isSuspendAll;
//文件重新上传
- (void)reUploadFileFunBy:(NSMutableArray*)Arr;

//文件上传完成
- (void)uploadFileDoneFun;
//文件上传失败
- (void)uploadFileFailFun;

//修改文件上传的状态
- (void)changeUploadFileState:(uploadStateType)curUploadStateType withDidUploadBytes:(long)didUpLoadBytes withModel:(uploadFileDataModel*)model complete:(custom_complete_B)complete;

//删除本地数据库记录
- (void)deleteUploadFileRecordBy:(NSMutableArray *)delArr complete:(custom_complete_B)complete;
@end

NS_ASSUME_NONNULL_END
