Commit a1efd29b by wanggang

add enum type

parent 4cb32d09
......@@ -29,8 +29,6 @@
739047362411099C00181090 /* CODownloadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 739047352411099C00181090 /* CODownloadCell.m */; };
7390473924110C5700181090 /* WXCOUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 7390473824110C5700181090 /* WXCOUtility.m */; };
739047522411E2C900181090 /* WXDownloadingComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 739047502411E2C900181090 /* WXDownloadingComponent.h */; settings = {ATTRIBUTES = (Public, ); }; };
739047552411E2C900181090 /* WXDownloadingComponent.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7390474E2411E2C900181090 /* WXDownloadingComponent.framework */; };
739047562411E2C900181090 /* WXDownloadingComponent.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7390474E2411E2C900181090 /* WXDownloadingComponent.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
7390475B2411EAE600181090 /* CODownloadCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 739047342411099C00181090 /* CODownloadCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
7390475C2411EAE600181090 /* WXCOMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 7390472E2410F2F900181090 /* WXCOMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
7390475D2411EAE600181090 /* WXCOUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 7390473724110C5700181090 /* WXCOUtility.h */; };
......@@ -66,30 +64,6 @@
D29A4DB3491084FE49C7A871 /* Pods_WXDownloadingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10CEA1B2E7F063CCBAFFB55E /* Pods_WXDownloadingKit.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
739047532411E2C900181090 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 739046932410DB7800181090 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 7390474D2411E2C900181090;
remoteInfo = WXDownloadingComponent;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
7390475A2411E2C900181090 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
739047562411E2C900181090 /* WXDownloadingComponent.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
10CEA1B2E7F063CCBAFFB55E /* Pods_WXDownloadingKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WXDownloadingKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
174BC2B187AD7DCACE6ED9D2 /* Pods-WXDownloadingComponent.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WXDownloadingComponent.release.xcconfig"; path = "Target Support Files/Pods-WXDownloadingComponent/Pods-WXDownloadingComponent.release.xcconfig"; sourceTree = "<group>"; };
......@@ -148,7 +122,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
739047552411E2C900181090 /* WXDownloadingComponent.framework in Frameworks */,
D29A4DB3491084FE49C7A871 /* Pods_WXDownloadingKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -362,13 +335,11 @@
739046972410DB7800181090 /* Sources */,
739046982410DB7800181090 /* Frameworks */,
739046992410DB7800181090 /* Resources */,
7390475A2411E2C900181090 /* Embed Frameworks */,
8DCC734A678E7BBEF7C87853 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
739047542411E2C900181090 /* PBXTargetDependency */,
);
name = WXDownloadingKit;
productName = WXDownloadingKit;
......@@ -564,14 +535,6 @@
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
739047542411E2C900181090 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7390474D2411E2C900181090 /* WXDownloadingComponent */;
targetProxy = 739047532411E2C900181090 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
739046A72410DB7800181090 /* Main.storyboard */ = {
isa = PBXVariantGroup;
......
......@@ -41,74 +41,127 @@ typedef NS_ENUM(NSInteger, checkExpiredValue) {
* 该模型可以将model保存、查询、更新、删除操作,也就是说下载模块只有该类参与了有关数据的交互。
* 这种做法的目的是低耦合,以便于以后更换数据库(比如:CoreData、Realm)时,只对该类做修改即可
*/
@interface CODownloadModel : NSObject <NSCopying, NSCoding> // 如果保存的自定义对象不遵守NSCoding的协议或不实现NSCoding协议的方法,就不能使用YYDiskCache进行长期缓存
/// 如果保存的自定义对象不遵守 NSCoding 的协议或不实现 NSCoding 协议的方法,就不能使用 YYDiskCache 进行长期缓存
@interface CODownloadModel : NSObject <NSCopying, NSCoding>
/// 学习记录所需要的CID
@property (nonatomic, strong) NSString *cid;
@property (nonatomic, copy) NSString *cid;
/// 下载课件所属的课程ID
@property (nonatomic, strong) NSString *course_id;
@property (nonatomic, copy) NSString *course_id;
/// 下载课件所属的课程名称
@property (nonatomic, strong) NSString *course_name;
@property (nonatomic, copy) NSString *course_name;
/// 下载课件所属的课程类型
@property (nonatomic, strong) NSString *courseType;
@property (nonatomic, copy) NSString *courseType;
/// 课程结构名称
@property (nonatomic, strong) NSString *course_structure_name;
@property (nonatomic, copy) NSString *course_structure_name;
/// 课程结构ID
@property (nonatomic, strong) NSString *course_structure_id;
@property (nonatomic, copy) NSString *course_structure_id;
/// 下载课件所属的父级ID,该值有可能是course_id,也有可能是catalog_id
@property (nonatomic, strong) NSString *parent_id;
@property (nonatomic, copy) NSString *parent_id;
/// 下载课件的ID
@property (nonatomic, strong) NSString *lesson_id;
@property (nonatomic, copy) NSString *lesson_id;
/// 下载课件的课件类型
@property (nonatomic, assign) NSInteger lesson_type;
/// 下载课件的直播类型
@property (nonatomic, assign) NSInteger live_type;
/// 如果是lesson_type == COLessonTypeVideo时,记录视频的时长
@property (nonatomic, strong) NSString *video_length;
@property (nonatomic, copy) NSString *video_length;
/// 回放时的房间号
@property (nonatomic, strong) NSString *offline_code;
@property (nonatomic, copy) NSString *offline_code;
/// 中公直播回调鉴权地址
@property (nonatomic, copy) NSString *hook;
/// 鉴权key
@property (nonatomic, copy) NSString *auth_key;
/// 当前已下载的文件大小
@property (nonatomic, assign) NSInteger current_size;
/// 文件的总大小
@property (nonatomic, assign) NSInteger total_size;
/// 下载完成的日期时间
@property (nonatomic, strong) NSString *down_date;
@property (nonatomic, copy) NSString *down_date;
/// 下载文件的名称,可以是课件的名称
@property (nonatomic, strong) NSString *down_name;
@property (nonatomic, copy) NSString *down_name;
/// 下载课件的下载状态
@property (nonatomic, assign) NSInteger down_state;
/// 下载课件的URL。1、视频、PDF的下载地址;2、中公直播回放的password
@property (nonatomic, strong) NSString *down_url;
@property (nonatomic, copy) NSString *down_url;
/// 文件的本地存储文件名
@property (nonatomic, strong) NSString *file_name;
@property (nonatomic, copy) NSString *file_name;
/// PDF的类型,默认是讲义
@property (nonatomic, assign) COPdfType pdf_type;
/// 试卷的难度
@property (nonatomic, strong) NSString *difficulty;
@property (nonatomic, copy) NSString *difficulty;
/// 试卷的内容
@property (nonatomic, strong) NSString *paper_content;
@property (nonatomic, copy) NSString *paper_content;
/// 试卷的类型
@property (nonatomic, assign) NSInteger paper_type;
/// 试卷样式:1 行测 2 申论 3 混合
@property (nonatomic, strong) NSString *paper_pattern;
@property (nonatomic, copy) NSString *paper_pattern;
/// 模考交卷返回的id
@property (nonatomic, strong) NSString *mock_paper_id;
@property (nonatomic, copy) NSString *mock_paper_id;
/// 模考id
@property (nonatomic, strong) NSString *mock_id;
@property (nonatomic, copy) NSString *mock_id;
/// 该下载对象信息是否需要同步至服务器,默认值needSyncValueNO
@property (nonatomic, assign) NSInteger need_sync;
/// 该下载对象信息完成下载后是否要向用户显示,默认值isShowValueNO
@property (nonatomic, assign) NSInteger is_show;
/// 该下载对象信息完成下载后是否要检查所附属的course已过期,默认值checkExpiredValueNO
@property (nonatomic, assign) NSInteger check_expired;
/// 下载内容对应的 channel,题库、IIP 等
@property (nonatomic, copy) NSString *channel;
/// 是否新线
@property (nonatomic, assign) BOOL isNewLine;
/// ERP 订单号
@property (nonatomic, copy) NSString *erp_id;
/// 包 id
@property (nonatomic, copy) NSString *package_id;
/// 组件 id
@property (nonatomic, copy) NSString *unit_id;
/// json 封装的其他参数,保存之后可以用来减少附属查询。other 目前用在了上传讲义库文档,包含了文档 size、name、url、ID 信息,使用json串
@property (nonatomic, copy) NSString *other;
/// 题库相关下载的 PDF 类型和来源
@property (nonatomic, assign) WXDownloadPDFSourceType pdfSourceType;
/// 下载讲义的类型,单一讲义还是讲义夹
@property (nonatomic, assign) WXDownloadHandoutsType handoutsType;
/// 获取用户下载全部下载模型数据
/// @return 下载数据
+ (NSMutableArray <CODownloadModel *> *)getUserAllDownloadDataWithUserID:(NSString *)userID;
......
......@@ -93,6 +93,9 @@ NS_ASSUME_NONNULL_BEGIN
////////////////////////////////////////////////////////////////////////////////////
/// framework add
/// implement in category
///
/// 说明:以下方法之前存在于 CODownloadObject+OffcnLive.h,并在 CODownloadObject 里面做了调用、为了解耦和抽离,在这里做了声明,但在 CODownloadObject+OffcnLive.m 做了实现,这样的方式是不推荐的。
- (void)addOffcnLiveDownloadDelegate;
/// 获取回放已下载的文件大小
......@@ -116,6 +119,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @return 是否已下载完成
- (BOOL)checkOffcnLiveCompleteDownload;
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
/// 以下方法取自 COPlaybackDownloadManager,同样在这里只是声明,在 CODownloadObject+OffcnLive.m 做了实现
/// new add
+ (void)removeAllOffcnLiveDownloadDelegate;
......
......@@ -78,4 +78,39 @@ typedef NS_ENUM(NSUInteger, COPdfType) {
};
/// 题库相关下载的 PDF 类型(对于只做分享的文档,根据来源,将文档、讲义、试卷归为一类)
typedef NS_ENUM(NSUInteger, WXDownloadPDFSourceType) {
/// default
WXDownloadPDFSourceTypeNone = 0,
/// 题库纯客观题 PDF
WXDownloadPDFSourceTypeObjectivePaper = 1,
/// 题库非纯客观题 PDF
WXDownloadPDFSourceTypeOtherPaper = 2,
/// 题库新、旧线优课相关 PDF,其中新线包含文档、讲义、试卷,浏览后需上传学习记录
WXDownloadPDFSourceTypeYouKeDocument = 3,
/// 学习包的文档、讲义、试卷
WXDownloadPDFSourceTypeLearningPackageDocument = 4,
/// 付费人工批改的报告
WXDownloadPDFSourceTypePayedCorrectionReport = 5
};
/// 下载讲义的类型
typedef NS_ENUM(NSUInteger, WXDownloadHandoutsType) {
/// default
WXDownloadHandoutsTypeNone = 0,
/// 单一讲义
WXDownloadHandoutsTypeSingle = 1,
/// 讲义夹
WXDownloadHandoutsTypeCollection = 2
};
#endif /* WXCOMacros_h */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment