OSSManager.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // OSSManager.h
  3. // AliyunOSSSDK-iOS-Example
  4. //
  5. // Created by huaixu on 2018/10/23.
  6. // Copyright © 2018 aliyun. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <AliyunOSSiOS/AliyunOSSiOS.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @protocol OSSManagerDelegate <NSObject>
  12. @optional
  13. - (void)stateChange:(NSDictionary *_Nullable)changeMsg;
  14. @end
  15. @interface OSSManager : NSObject
  16. @property (nonatomic,weak) id <OSSManagerDelegate> delegate;
  17. @property (nonatomic, strong) OSSClient *defaultClient;
  18. @property (nonatomic, strong) OSSClient *imageClient;
  19. @property (nonatomic, strong) NSDictionary *OSSInfo;
  20. @property (nonatomic,strong) NSMutableArray * _Nullable uploadTanck;
  21. @property (nonatomic) NSInteger initIme;
  22. + (instancetype)sharedManager;
  23. //普通上传
  24. - (void)asyncPutFile:(NSString *)objectKey localFilePath:(NSString *)filePath thrid:(NSString *)strtime;
  25. //断点续传
  26. - (void)asyncResumableUploadFile:(NSString *)objectKey localFilePath:(NSString *)filePath thrid:(NSString *)strtime;
  27. -(void)addUploadTanckobj:(OSSTask *)task thrid:(NSString *)thrid;
  28. -(BOOL)isuploadTanck:(NSString *)thrid;
  29. -(void)removeUploadTanckobj:(NSString *)thrid;
  30. -(void)stopUploadTanck:(NSString *)thrid;
  31. @end
  32. NS_ASSUME_NONNULL_END