OSSManager.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. - (NSString *)fullUploadURLByAppendPath:(NSString *)path;
  32. @end
  33. NS_ASSUME_NONNULL_END