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

#import "JSONModel.h"
#import "BGFMDB.h" //添加该头文件,本类就具有了存储功能.
#import <Photos/Photos.h>
NS_ASSUME_NONNULL_BEGIN

typedef enum{
    uploadStateWait = 0,
    uploadStateUploading,
    uploadStateSuspend,
    uploadStateFail,
    uploadStateDone,//
}uploadStateType;

typedef enum{
    uploadFileTypeImage = 0,
    uploadFileTypeVideo,
    uploadFileTypeUnkonw,
}uploadFileType;

//self.fileName = [assetModel.asset valueForKey:@"filename"];
@interface uploadFileDataModel : JSONModel
//目前上传用到的字段有
@property (nonatomic, strong) PHAsset *asset;
@property (nonatomic, copy) NSString *localIdentifier;
@property (nonatomic, copy)  NSString *filename;//image or video
@property (nonatomic, copy)  NSString *videoFirstImageName;
@property (nonatomic, retain) NSData *_Nullable imageData;//image or video
@property (nonatomic, retain) NSData *_Nullable videoData;
@property (nonatomic, assign)  uploadStateType curUploadStateType;
@property (nonatomic, assign)  uploadFileType curUploadFileType;
@property (nonatomic, assign)  long didUploadBytes;//已经上传的字节数
@property (nonatomic, assign)  long totalBytes;//总字节数

@property (nonatomic, assign) NSTimeInterval  preTimeInterval;//计算速度用
@property (nonatomic, assign) NSTimeInterval  curTimeInterval;//计算速度用
@end

NS_ASSUME_NONNULL_END
