//
//  CODownloadManager+Paper.h
//  WXQuestion
//
//  Created by hyz on 2019/4/1.
//  Copyright © 2019 中公网校. All rights reserved.
//

#import "CODownloadManager.h"
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class CODownloadPaperModel;
/**
 * 该类是根据具体业务类型做的扩展
 *
 * 该类可以处理试卷类型的文件下载
 *
 * 根据WXExamPaperModel数据创建下载的分类管理器,是根据具体业务类型做的扩展
 */
@interface CODownloadManager (Paper)

/// 执行试卷下载操作
/// @param paperArray 试卷数据的集合
/// @param block 下载操作是否被取消的回调，rejectArray被拒原因数组
/// @param isPriority 是否是要执行优先下载
- (void)co_startPaperDownload:(NSMutableArray <CODownloadPaperModel *>*)paperArray
                       userID:(NSString *)userID
          downloadRejectBlock:(nullable void (^)(NSMutableArray <CODownloadRejectModel *> * _Nullable rejectArray))block
         withPriorityDownload:(BOOL)isPriority;

/// 执行暂停试卷下载操作
/// @param paperArray 试卷数据的集合
- (void)co_pausePaperDownload:(NSMutableArray <CODownloadPaperModel *>*)paperArray;

/// 执行删除下载对象操作，带有操作是否取消block
/// @param paperArray 试卷数据的集合
/// @param presentVc 删除时弹框所依附的ViewController
/// @param block 本次操作是否取消
- (void)co_deletePaperDownload:(NSMutableArray <CODownloadPaperModel *>*)paperArray
            withViewController:(UIViewController *)presentVc
                        userID:(NSString *)userID
                   cancelBlock:(nullable void(^)(BOOL cancel))block;

/// 通过试卷模型数据获取下载对象，如果没有匹配到数据，则返回nil
/// @param model 试卷模型数据
/// @return 下载数据
- (CODownloadObject *)co_getDownloadObjectByPaperModel:(CODownloadPaperModel *)model;

@end

NS_ASSUME_NONNULL_END
