Jelajahi Sumber

update common

wenweiwei 3 tahun lalu
induk
melakukan
5c41643b9c

+ 5 - 1
BFCommonKit.podspec

@@ -28,12 +28,16 @@ TODO: Add long description of the pod here.
   s.subspec 'BFEnv' do |gg|
     gg.source_files = 'BFCommonKit/Classes/BFEnv/*'
     gg.frameworks = 'UIKit'
-    gg.dependency 'BFCommonKit/BFConfig'
   end
   s.subspec 'BFEnums' do |ee|
     ee.source_files = 'BFCommonKit/Classes/BFEnums/*'
     ee.frameworks = 'Foundation'
   end
+  s.subspec 'BFProtocols' do |pp|
+    pp.source_files = 'BFCommonKit/Classes/BFProtocols/*'
+    pp.frameworks = 'Foundation'
+    pp.dependency 'BFCommonKit/BFEnums'
+  end
   s.subspec 'BFModels' do |mm|
     mm.source_files = 'BFCommonKit/Classes/BFModels/*'
     mm.frameworks = 'Foundation'

+ 1 - 1
BFCommonKit/Classes/BFConfig/BFConfig.swift

@@ -85,7 +85,7 @@ public class BFConfig: NSObject {
     // 闪音:6c481442-aeb4-49ec-a2ae-21359bfef44a
     public var buglyAppkey: String = "6c481442-aeb4-49ec-a2ae-21359bfef44a"
 
-    // add by ak 公用参数使用
+    // add by ak 公用参数使用 13:票圈视频 15:闪音卡点 16:乐活圈
     public var appType: String = "15"
     // 苹果后台创建的 APPID
     public var appId: String = "1570572849"

+ 112 - 84
BFCommonKit/Classes/BFEnums/Enums.swift

@@ -11,7 +11,7 @@ import Foundation
 // MARK: - 视频播放页面类型
 
 /// 视频播放页面类型
-public  enum  PQVIDEOPAGETYPE {
+public enum PQVIDEOPAGETYPE {
     case PQVIDEOPAGETYPE_Normal // 默认-单个视频详情
     case PQVIDEOPAGETYPE_RECOMM // 默认-推荐
     case PQVIDEOPAGETYPE_ATTEN // 关注
@@ -29,7 +29,7 @@ public  enum  PQVIDEOPAGETYPE {
 // MARK: - 视频播放状态
 
 /// 视频播放状态
-public  enum  PQVIDEO_PLAY_STATUS {
+public enum PQVIDEO_PLAY_STATUS {
     case PQVIDEO_PLAY_STATUS_LOADING // 加载中
     case PQVIDEO_PLAY_STATUS_BEGIN // 开始播放
     case PQVIDEO_PLAY_STATUS_END // 播放结束
@@ -42,7 +42,7 @@ public  enum  PQVIDEO_PLAY_STATUS {
 // MARK: - 页面场景
 
 /// 页面场景
-public  enum  PAGESOURCE: String {
+public enum PAGESOURCE: String {
     /*************** 视频相关pageSource ***************/
     case sp_category = "speedApp-category" // 首页-单列
     case sp_hotList = "speedApp_hotList" // 首页-热榜
@@ -56,7 +56,7 @@ public  enum  PAGESOURCE: String {
     case sp_videoDetail_upload_recommend = "speedApp-videoDetail_upload_recommend" // 、由我的tab中“作品”列表进入
     case sp_mine_favorite = "speedApp_mine_favorite" // 我的喜欢列表
     case sp_videoDetail_favorite = "speedApp-videoDetail_favorite" // 由我的喜欢列表进入
-    
+
     case sp_videoDetail_share = "speedApp-videoDetail_share" // 由我的分享列表进入
     case sp_videoDetail_favorite_recommend = "speedApp-videoDetail_favorite_recommend" // 由我的喜欢列表推荐
     case sp_userHomePage = "speedApp-userHomePage" // 用户个人主页
@@ -108,7 +108,7 @@ public  enum  PAGESOURCE: String {
     case sp_material_search = "vlog-pages/user-videos-share" // 素材搜索上报
 
     /*************** 消息pageSource ***************/
-    
+
     case sp_msg_shareSpace = "speedApp-message" // 分享空间
     case sp_msg_shareSpace_detail = "speedApp-message_shareSpace" // 分享空间详情
     case sp_msg_share = "speedApp-message_share" // 分享
@@ -116,7 +116,7 @@ public  enum  PAGESOURCE: String {
     case sp_msg_fans = "speedApp-message_fans" // 粉丝
     case sp_msg_push = "speedApp-message_push" // 通知
     case sp_msg_detail = "speedApp-videoDetail_message" // 消息详情
-    
+
     /*************** 草稿箱相关pageSource ***************/
     case sp_draft_projectList = "speedApp-projectList" // 草稿箱列表
     case sp_reproduce_childList = "speedApp-reproduceCollection_child" // 再制作子列表页面
@@ -132,7 +132,7 @@ public  enum  PAGESOURCE: String {
     case sp_stuck_previewSyncedUp = "speedApp_previewSyncedUp" // 预览页面曝光上报
     case sp_stuck_searchSyncedUpMusic = "speedApp_searchSyncedUpMusic" // 音乐素材搜索页
     case sp_stuck_publishSyncedUp = "speedApp_publishSyncedUp" // 合成发布页
-    
+
     /*************** 话题相关pageSource ***************/
     case sp_cmunit_collect = "collectAgeGenderPage" // 年龄 / 话题收集页
     case sp_cmunit_recommend = "recommendPage" // 推荐页(P0)
@@ -153,21 +153,28 @@ public  enum  PAGESOURCE: String {
     case sp_cmunit_cmtMsgPage = "commentMessagePage" // 评论消息页
     case sp_cmunit_mePage = "mePage" // 我的页
     case sp_cmunit_userPage = "homePage" // 个人主页
-    //点击上报:首页点击底部“我的”页面入口
+    // 点击上报:首页点击底部“我的”页面入口
     case sp_shanyinApp_main = "speedApp-main"
-    //页面曝光上报:“我的”页面曝光
+    // 页面曝光上报:“我的”页面曝光
     case sp_shanyinApp_mine = "shanyinApp-mine"
-    
-    func pageName(app:String) -> String {
-        // 获取AppName
-        return app + self.rawValue
+
+    public func realRawValue(prefix: String? = nil) -> String {
+        if prefix != nil, (prefix?.count ?? 0) > 0 {
+            if prefix == "shanyinApp", rawValue.hasPrefix("speedApp") {
+                return rawValue.replacingOccurrences(of: "speedApp", with: prefix ?? "")
+            } else if prefix == "speedApp", rawValue.hasPrefix("shanyinApp") {
+                return rawValue.replacingOccurrences(of: "shanyinApp", with: prefix ?? "")
+            }
+            return rawValue
+        }
+        return rawValue
     }
 }
 
 // MARK: - objectType
 
 /// objectType
-public  enum  objectType: String {
+public enum objectType: String {
     /*************** tab点击相关pageSource ***************/
 
     case ot_home_tabBtn = "speedApp-categoryTabButton" //  首页tab
@@ -290,7 +297,7 @@ public  enum  objectType: String {
     case ot_shareMomentBtn = "shareMomentButton" // 分享朋友圈
     case ot_click_shareWechatMoment = "speedApp_clickButton_shareWechatMoment" // 点击上报:分享朋友圈
     case ot_click_finished = "speedApp_clickButton_finished" // 点击上报:完成
-    
+
     // 闪音点击上报:首页点击底部+
     case ot_shanyinApp_clickButton_syncedUpMusic = "shanyinApp_clickButton_syncedUpMusic"
 
@@ -304,44 +311,44 @@ public  enum  objectType: String {
     // 编辑标题和封面
     case ot_shanyinApp_clickButton_changeTitle = "speedApp_clickButton_changeTitle"
     case ot_shanyinApp_clickButton_changeCover = "speedApp_clickButton_changeCover"
-    
-    //1.2.0版本快慢速
-    //点击快慢速
+
+    // 1.2.0版本快慢速
+    // 点击快慢速
     case ot_shanyinApp_musicVideoPreview_selectPatternSpeed = "speedApp_musicVideoPreview_selectPatternSpeed"
-    //点击跳跃卡点
+    // 点击跳跃卡点
     case ot_shanyinApp_musicVideoPreview_selectPatternMusicVideo = "speedApp_musicVideoPreview_selectPatternMusicVideo"
-    //点击仅音乐
+    // 点击仅音乐
     case ot_shanyinApp_musicVideoPreview_selectPatternBgm = "speedApp_musicVideoPreview_selectPatternBgm"
-    
-    //音乐库相统计
-    //- 音乐tab点击数
+
+    // 音乐库相统计
+    // - 音乐tab点击数
     case ot_shanyinApp_musicVideoPreview_musicTab = "speedApp_musicVideoPreview_musicTab"
-    //- 剪辑tab点击
+    // - 剪辑tab点击
     case ot_shanyinApp_musicVideoPreview_videoTab = "speedApp_musicVideoPreview_videoTab"
-    //- 音乐素材曝光数
+    // - 音乐素材曝光数
     case ot_shanyinApp_musicVideoPreview_musicView = "speedApp_musicVideoPreview_musicView"
-    //- 音乐试听数
+    // - 音乐试听数
     case ot_shanyinApp_musicVideoPreview_musicCategorySelect = "speedApp_musicVideoPreview_musicCategorySelect"
-    //- 音乐使用数
+    // - 音乐使用数
     case ot_shanyinApp_musicVideoPreview_musicSelect = "speedApp_musicVideoPreview_musicSelect"
-    //- 音乐选框移动数(与原推荐位置不一致)
+    // - 音乐选框移动数(与原推荐位置不一致)
     case ot_shanyinApp_musicVideoPreview_musicPeriodSelect = "speedApp_musicVideoPreview_musicPeriodSelect"
-    //- 搜索页面曝光
+    // - 搜索页面曝光
     case ot_shanyinApp_musicVideoPreview_musicSearch = "speedApp_musicVideoPreview_musicSearch"
-    
-    //- 音乐试听数
+
+    // - 音乐试听数
     case ot_shanyinApp_musicVideoPreview_musicSearchAudition = "speedApp_musicVideoPreview_musicSearchAudition"
-    //- 音乐使用数
+    // - 音乐使用数
     case ot_shanyinApp_musicVideoPreview_musicSearchSelect = "speedApp_musicVideoPreview_musicSearchSelect"
-    
-    //快慢速模式
+
+    // 快慢速模式
     //  - 抛留比例按钮切换点击数
     case ot_shanyinApp_musicVideoPreview_selectSpeed = "speedApp_musicVideoPreview_selectSpeed"
     //  - 自定义抛留比按钮点击数
     case ot_shanyinApp_musicVideoPreview_customizeSpeed = "speedApp_musicVideoPreview_customizeSpeed"
     //  - 选择节奏
     case ot_shanyinApp_musicVideoPreview_selectSpeedRhythm = "speedApp_musicVideoPreview_selectSpeedRhythm"
-    
+
     // 跳跃卡点模式
     //  - 抛留比例按钮切换点击数
     case ot_shanyinApp_musicVideoPreview_selectRatio = "speedApp_musicVideoPreview_selectRatio"
@@ -349,8 +356,7 @@ public  enum  objectType: String {
     case ot_shanyinApp_musicVideoPreview_customizeRatio = "speedApp_musicVideoPreview_customizeRatio"
     //  - 选择节奏
     case ot_shanyinApp_musicVideoPreview_selectMusicVideoRhythm = "speedApp_musicVideoPreview_selectMusicVideoRhythm"
-   
- 
+
     // 仅配乐模式
     // 循环比例按钮切换点击数
     case ot_shanyinApp_musicVideoPreview_selectRepeatTimes = "speedApp_musicVideoPreview_selectRepeatTimes"
@@ -358,7 +364,7 @@ public  enum  objectType: String {
     case ot_shanyinApp_musicVideoPreview_customizeRepeatTimes = "speedApp_musicVideoPreview_customizeRepeatTimes"
     //  - 选择节奏
     case ot_shanyinApp_musicVideoPreview_selectMusicVideoRepeatRhythm = "speedApp_musicVideoPreview_selectMusicVideoRepeatRhythm"
-        
+
     /*************** 话题相关objectType ***************/
     case ot_cmunit_syncedBtn = "syncedUpMusicButton" // 音乐视频
     case ot_cmunit_createBtn = "videoIdeaButton" // 视频想法
@@ -382,7 +388,7 @@ public  enum  objectType: String {
     case ot_cmunit_skipBtn = "skipButton" // 点击「跳过」按钮
     case ot_cmunit_loginButton = "loginButton" // 点击「登录」按钮
     case ot_cmunit_cmtMsgItem = "commentMessageItem" // 评论消息item
-    
+
     /*************** 活动相关businessType ***************/
     case ot_actity_incentive = "weapp_sharer_incentivePlanWindow" // 分享者激励计划活动弹窗的曝光
     case ot_actity_share = "weapp_share_plan" // 分享者激励计划活动弹窗按钮的点击
@@ -391,15 +397,27 @@ public  enum  objectType: String {
     case ot_videoShareButton = "videoShareButton" // 分享按键点击
     case ot_videoShareFriend = "videoShareFriend" // 用户点击分享好友
     case ot_videoShareH5 = "videoShareH5" // 视频被用户点击分享朋友圈
-    case ot_notificationButton = "notificationButton"   // 活动通知入口点击
+    case ot_notificationButton = "notificationButton" // 活动通知入口点击
     case ot_videoShareFriend_fullScreen = "videoShareFriend_fullScreen" // 视频全屏状态-分享好友
     case ot_hotBoard_videoButton = "videoButton" // 热榜视频曝光
+
+    public func realRawValue(prefix: String? = nil) -> String {
+        if prefix != nil, (prefix?.count ?? 0) > 0 {
+            if prefix == "shanyinApp", rawValue.hasPrefix("speedApp") {
+                return rawValue.replacingOccurrences(of: "speedApp", with: prefix ?? "")
+            } else if prefix == "speedApp", rawValue.hasPrefix("shanyinApp") {
+                return rawValue.replacingOccurrences(of: "shanyinApp", with: prefix ?? "")
+            }
+            return rawValue
+        }
+        return rawValue
+    }
 }
 
 // MARK: - 视频上报类型
 
 /// 视频上报类型
-public  enum  businessType: String {
+public enum businessType: String {
     /*************** 视频相关businessType ***************/
     case bt_videoView = "videoView" //  视频展示到屏幕,在此APP中 首页中:视频展示但未播放时,用于后端算法相关逻辑 相关推荐:在播放中下部展示出相关推荐的3个视频时,上报这3个视频的videoView。同一次播放下不重复上报3个推荐视频的videoView
     case bt_videoPreView = "videoPreView"
@@ -411,7 +429,7 @@ public  enum  businessType: String {
     case bt_videoPlayException = "videoPlayException"
     case bt_videoPlay_normal = "videoPlay"
     case bt_videoAutoPlay = "videoAutoPlay"
-    public  enum  bt_videoPlay: String {
+    public enum bt_videoPlay: String {
         case bt_videoPlay_userSlideSingle = "userSlideSingle" // 用户在沉浸态下滑动切换视频(极速版、爱电影)
         case bt_videoPlay_userClickCover = "userClickCover" // 用户点击封面播放
         case bt_videoPlay_userSlideList = "userSlideList" // 用户在列表中滑动停止导致的播放
@@ -482,18 +500,29 @@ public  enum  businessType: String {
     case bt_ad_close = "adClose" // 广告被关闭-非需求
     case bt_ad_configRequest = "adConfigRequest" // 客户端请求广告配置
     case bt_ad_configLoaded = "adConfigLoaded" // 客户端请求广告配置成功
-    
+
     /*************** 话题相关businessType ***************/
     case bt_cmunit_clickTopic = "videoClickTopic" // 增加首页话题点击上报
     case bt_cmunit_videoReport = "videoReport" // 举报视频
     case bt_cmunit_comment = "videoComment" // 视频被用户评论
     case bt_cmunit_likeComment = "videoLikeComent" // 视频中的评论被点赞
+    public func realRawValue(prefix: String? = nil) -> String {
+        if prefix != nil, (prefix?.count ?? 0) > 0 {
+            if prefix == "shanyinApp", rawValue.hasPrefix("speedApp") {
+                return rawValue.replacingOccurrences(of: "speedApp", with: prefix ?? "")
+            } else if prefix == "speedApp", rawValue.hasPrefix("shanyinApp") {
+                return rawValue.replacingOccurrences(of: "shanyinApp", with: prefix ?? "")
+            }
+            return rawValue
+        }
+        return rawValue
+    }
 }
 
 // MARK: - autoType 自动动作的类型
 
 /// autoType 自动动作的类型
-public  enum  autoType: Int {
+public enum autoType: Int {
     case AUTO_TYPE_SCROLL_VERTICAL_DOWN = 11 // 用户手动下划触发播放(播上一个视频)
     case AUTO_TYPE_SCROLL_VERTICAL_UP = 12 // 用户手动上划触发播放(播下一个视频)
     case AUTO_TYPE_SCROLL_HORIZON_RIGHT = 13 // 用户手动右划触发播放
@@ -510,7 +539,7 @@ public  enum  autoType: Int {
 // MARK: - 消息动作:表示该条日志属于某条消息生命周期的哪个漏斗环节
 
 /// 消息动作:表示该条日志属于某条消息生命周期的哪个漏斗环节
-public  enum  actionType: String {
+public enum actionType: String {
     case at_msg_backendReturn = "backendReturn" // 后端将消息返回给客户端
     case at_msg_frontendPull = "frontendPull" // 客户端获取到
     case at_msg_view = "view" // 在客户端消息被滑动展示在屏幕上
@@ -520,7 +549,7 @@ public  enum  actionType: String {
 // MARK: - 消息类型
 
 /// 消息类型
-public  enum  messageType: Int {
+public enum messageType: Int {
     case mt_nomal = 0 // 未知消息
     case mt_fans = 1 // 粉丝消息
     case mt_like = 2 // 喜欢/赞
@@ -533,7 +562,7 @@ public  enum  messageType: Int {
 }
 
 /// 分享空间二级界面数据请求类型  1,观看 2,分享,3,喜欢 4, 评论
-public  enum  sharePageType: Int {
+public enum sharePageType: Int {
     case share_page_play = 1 // 分享空间-播放列表
     case share_page_share = 2 // 分享空间-分享列表
     case share_page_favorite = 3 // 分享空间-收藏列表
@@ -543,7 +572,7 @@ public  enum  sharePageType: Int {
 // MARK: - 消息子类型
 
 /// 消息子类型
-public  enum  messageSubType: Int {
+public enum messageSubType: Int {
     case mtsub_nomal = 0 // 未知消息
     case mtsub_fansAtt = 101 // 粉丝-关注
     case mtsub_fansSbs = 102 // 粉丝-订阅
@@ -574,7 +603,7 @@ public  enum  messageSubType: Int {
 // MARK: - 埋点上报消息类型(暂未统一)
 
 /// 埋点上报消息类型(暂未统一)
-public  enum  messagePointType: Int {
+public enum messagePointType: Int {
     case mt_point_nomal = 0 // 未知消息
     case mt_point_fans = 1 // 粉丝消息
     case mt_point_praise = 2 // 赞
@@ -590,7 +619,7 @@ public  enum  messagePointType: Int {
 // MARK: - 日志库类型
 
 /// 日志库类型
-public  enum  statisticsLogType: Int {
+public enum statisticsLogType: Int {
     case st_log_type_abtestinfo = 10 // abtestinfo-Log ABTEST的 dlog Store
     case st_log_type_operation = 20 // operation-Log 漏斗模型的相关上报
     case st_log_type_simpleevent = 30 // simpleevent-Log 独立事件的相关上报
@@ -608,7 +637,7 @@ public  enum  statisticsLogType: Int {
 // MARK: - 冷启动方式
 
 /// coldLaunchType // 冷启动方式。若为热启动,则不用上报该字段
-public  enum  coldLaunchType: String {
+public enum coldLaunchType: String {
     case coldLaunchType_userActiveOpen = "userActiveOpen" // 用户主动打开
     case coldLaunchType_appRecall = "appRecall" // 其它APP唤起,包括H5应用宝唤起
     case coldLaunchType_pushRecall = "pushRecall" // 推送唤起
@@ -617,7 +646,7 @@ public  enum  coldLaunchType: String {
 // MARK: - 上报日志类型
 
 /// 上报日志类型
-public  enum  reportLogType {
+public enum reportLogType {
     case reportLogType_view // 显示页面
     case reportLogType_realPlay // 真实播放 视频播放到20s或播放到总时长30%,哪个先到为准
     case reportLogType_play // 记录播放的视频
@@ -628,7 +657,7 @@ public  enum  reportLogType {
 // MARK: - 底部tab
 
 /// 底部tab
-public  enum  TAB_PAGETYPE: String {
+public enum TAB_PAGETYPE: String {
     case TAB_PAGETYPE_NORMAL = "nomalTab" // 默认
     case TAB_PAGETYPE_RECOMM = "categoryTab" // 推荐
     case TAB_PAGETYPE_ATTEN = "followTab" // 关注
@@ -640,7 +669,7 @@ public  enum  TAB_PAGETYPE: String {
 // MARK: - 关注跟粉丝cell类型
 
 /// 关注跟粉丝cell类型
-public  enum  atttendAndFansCellType {
+public enum atttendAndFansCellType {
     case cellType_attend // 关注
     case cellType_fans // 粉丝
     case cellType_banned // 黑名单
@@ -649,7 +678,7 @@ public  enum  atttendAndFansCellType {
 // MARK: - 视频全屏播放操作类型
 
 /// 视频全屏播放操作类型
-public  enum  fullScreenActionType {
+public enum fullScreenActionType {
     case volume // 声音
     case brightness // 亮度
     case progress // 进度
@@ -658,7 +687,7 @@ public  enum  fullScreenActionType {
 // MARK: - 活动提示页类型
 
 /// 活动提示页类型
-public  enum  activityRemindType {
+public enum activityRemindType {
     case nomal //
     case newUser // 新用户专享
     case yesterDay_finish // 昨日已完成
@@ -669,7 +698,7 @@ public  enum  activityRemindType {
 // MARK: - 制作工具素材搜索msgType
 
 /// 制作工具素材搜索msgType
-public  enum  material_msgType: String {
+public enum material_msgType: String {
     case all = "ALL_SEARCH_EVENT" // 所有
     case image = "IMAGE_SEARCH_EVENT" // 图片
     case video = "VIDEO_SEARCH_EVENT" // 视频
@@ -680,7 +709,7 @@ public  enum  material_msgType: String {
 }
 
 // 画布类型
-public  enum  videoCanvasType: Int {
+public enum videoCanvasType: Int {
     case origin = 1 // 原始
     case nineToSixteen = 2 // 9:16
     case oneToOne = 3 // 1:1
@@ -688,7 +717,7 @@ public  enum  videoCanvasType: Int {
 }
 
 /// 贴纸类型
-public  enum  StickerType: String {
+public enum StickerType: String {
     case UNKONW = "unknow"
     case IMAGE = "image" // 图片
     case VIDEO = "video" // 视频
@@ -721,7 +750,7 @@ public  enum  StickerType: String {
 
     /// 媒体类型
     /// - Returns: <#description#>
-   public func mimeType() -> String {
+    public func mimeType() -> String {
         var mimeType: String = "application/octet-stream"
         switch self {
         case .IMAGE:
@@ -740,7 +769,7 @@ public  enum  StickerType: String {
         return mimeType
     }
 
-   public func pathExtension() -> String {
+    public func pathExtension() -> String {
         var pathExtension: String = ""
         switch self {
         case .IMAGE:
@@ -763,13 +792,13 @@ public  enum  StickerType: String {
 // MARK: - 贴纸裁剪方式
 
 /// 贴纸裁剪方式
-public  enum  stickerContentModeDef: Int {
+public enum stickerContentModeDef: Int {
     case aspectFit = 0 // 自适应
     case aspectFill = 1 // 铺满
 }
 
 /// 贴纸裁剪方式 add by ak v2
-public  enum  stickerContentMode: String {
+public enum stickerContentMode: String {
     case aspectFitStr = "complete" // 完整显示(有黑边)
     case aspectFillStr = "full" // 铺满
 }
@@ -777,14 +806,14 @@ public  enum  stickerContentMode: String {
 // MARK: - 适配模式
 
 /// 适配模式
-public  enum  adapterModeDef: Int {
+public enum adapterModeDef: Int {
     case speedyAuto = 0 // 快速自适应
     case loopAuto = 1 // 自动循环
     case crop = 2 // 定帧/裁剪
 }
 
 /// 适配模式 add by ak  v2
-public  enum  adapterMode: String {
+public enum adapterMode: String {
     case multiple // 快速自适应
     case loopAuto = "loop" // 自动循环
     case staticFrame // 定帧/裁剪
@@ -793,7 +822,7 @@ public  enum  adapterMode: String {
 // MARK: - 上传视频类型
 
 /// 上传视频类型
-public  enum  videoUploadSourceType: String {
+public enum videoUploadSourceType: String {
     case videoUpload // 上传
     case videoCompose // 合成制作
     case videoUploadToCompose // 上传转合成制作
@@ -802,7 +831,7 @@ public  enum  videoUploadSourceType: String {
 // MARK: - 进入创作工具入口
 
 /// 素材上传、保存、收藏相关
-public  enum  videoMakeEntranceType: String {
+public enum videoMakeEntranceType: String {
     case entranceMineTabDraft = "draft_metab" // 我的Tab -> 草稿箱列表 -> 创作工具
     case entrancePublicTabDraft = "draft_uploadpopup" // 发布Tab -> 草稿箱列表 -> 创作工具
     case entrancePublicTabCompose = "composeVideo" // 发布Tab -> 视频合成 -> 创作工具
@@ -824,7 +853,7 @@ public  enum  videoMakeEntranceType: String {
 // MARK: - 段落类型
 
 /// 段落类型
-public  enum  sectionType: String {
+public enum sectionType: String {
     case normal // 普通段
     case global // 全局段
 }
@@ -832,7 +861,7 @@ public  enum  sectionType: String {
 // MARK: - 音乐类型
 
 /// 音乐类型
-public  enum  VOICETYPT: String {
+public enum VOICETYPT: String {
     case PRODUCE = "produce" // 合成语音
     case BGM = "bgm" // 背景音乐
     case SPEECH = "speech" // 录音
@@ -842,7 +871,7 @@ public  enum  VOICETYPT: String {
 // MARK: - 输入框状态B
 
 /// 输入框状态
-public  enum  inputStatus {
+public enum inputStatus {
     case normal // 写故事,可智能配音,自动生成字幕
     case inputing // 输入中
     case recording // 语音识别成文字中…
@@ -854,7 +883,7 @@ public  enum  inputStatus {
 // MARK: - 画面比例
 
 /// 画面比例
-public  enum  aspectRatio {
+public enum aspectRatio {
     case origin(width: CGFloat, height: CGFloat) // 原始
     case oneToOne // 1:1
     case sixteenToNine // 16:9
@@ -864,14 +893,14 @@ public  enum  aspectRatio {
 // MARK: - 卡点视频音乐页面类型
 
 /// 卡点视频音乐页面类型
-public  enum  stuckPointMusicContentType {
+public enum stuckPointMusicContentType {
     case catagery
     case serach
     case page
 }
 
 // 视频发布来源场景 1:普通上传 2:创作工具,3:普通上传转创作工具,4:后台转换加工,5:卡点视频制作
-public  enum  videoFromScene: Int {
+public enum videoFromScene: Int {
     case UploadNormal = 1 // 普通上传
     case UploadMakeVideo = 2 // 创作工具
     case UploadNormalToMakeVideo = 3 // 普通上传转创作工具
@@ -882,7 +911,7 @@ public  enum  videoFromScene: Int {
 // MARK: - 广告来源渠道
 
 /// 广告来源渠道
-public  enum  adChannel: String {
+public enum adChannel: String {
     case wechat // 微信广告
     case byteDouce = "pangle" // 穿山甲广告(字节跳动)
     case pdd // 多多进宝广告(拼多多)
@@ -892,7 +921,7 @@ public  enum  adChannel: String {
 // MARK: - 广告类型
 
 /// 广告类型
-public  enum  adType: Int {
+public enum adType: Int {
     case banner = 1 // Banner 广告(即:固定位展示广告)
     case drawVideo = 2 // 信息流视频广告
     case preMovie = 3 // 贴片广告(场景举例:暂停贴片广告)
@@ -903,7 +932,7 @@ public  enum  adType: Int {
 // MARK: - 广告投放人群
 
 /// 广告投放人群
-public  enum  adCrowd: Int {
+public enum adCrowd: Int {
     case highCrowd = 1 // 高分享人群
     case mediumCrowd = 2 // 中分享人群
     case lowCrowd = 3 // 低分享人群
@@ -912,26 +941,25 @@ public  enum  adCrowd: Int {
 // MARK: - 广告内部位置值
 
 /// 广告内部位置值
-public  enum  adPosition: String {
+public enum adPosition: String {
     case splashAd // 票圈视频 App 闪屏页广告位
     case videoFlowAd // 票圈视频 App 视频流广告位
 }
 
-
 // MARK: - 风格
 
 /// 风格
-public  enum  styleColor: String {
-    case nomal = "#F1034D"          // 票圈红
-    case green = "#3DC1C1"          // 闪音蓝
-    case red = "#EE0051"            // 乐活红
-    case intrGreen = "#28BE67"      // 讲解绿
+public enum styleColor: String {
+    case nomal = "#F1034D" // 票圈红
+    case green = "#3DC1C1" // 闪音蓝
+    case red = "#EE0051" // 乐活红
+    case intrGreen = "#28BE67" // 讲解绿
 }
 
 // MARK: - statusBar
 
 /// statusBar
-public enum  statusBarStyle {
+public enum statusBarStyle {
     case light
     case dark
 }

+ 8 - 8
BFCommonKit/Classes/BFEnv/PQRequestURLUtil.swift

@@ -186,10 +186,10 @@ public let systemAppConfigUrl = "sys/app/config"
 /**  取 APP 的常规配置参数 如推荐的10个标题 */
 public let getBaseConfigURL = "frontConfig/getBaseConfig"
 
-/** 用户协议 */
-public let cUserProtocol = "https://weapppiccdn.yishihui.com/resources/agreements/videoservice.html?type=\(BFConfig.shared.appType)"
-/** 隐私政策 */
-public let cPrivacy = "https://weapppiccdn.yishihui.com/resources/agreements/videoagreement.html?type=\(BFConfig.shared.appType)"
+/** 用户协议-后面缀对应产品type */
+public let cUserProtocol = "https://weapppiccdn.yishihui.com/resources/agreements/videoservice.html?type="
+/** 隐私政策-后面缀对应产品type */
+public let cPrivacy = "https://weapppiccdn.yishihui.com/resources/agreements/videoagreement.html?type="
 /** 互联网管理规定 */
 public let cNetManagePrivacy = "http://www.cac.gov.cn/2017-08/25/c_1121541842.htm"
 // ***************** 埋点上报地址 **********************//
@@ -402,10 +402,10 @@ public let stuckPointProjectMusicInfoUrl = "producevideo/getProjectRhythmMusicIn
 
 // 获取广告配置信息
 public let adPositionInfoUrl = "ad/position/info"
-// 意见反馈地址
-public let feedbackUrl = "https://support.qq.com/product/\(BFConfig.shared.txFeedbackAppId)"
-// 意见反馈主页
-public let feedbackPageUrl = "https://support.qq.com/embed/phone/\(BFConfig.shared.txFeedbackAppId)"
+// 意见反馈地址 https://support.qq.com/product/\(BFConfig.shared.txFeedbackAppId)
+public let feedbackUrl = "https://support.qq.com/product/"
+// 意见反馈主页 https://support.qq.com/embed/phone/\(BFConfig.shared.txFeedbackAppId)
+public let feedbackPageUrl = "https://support.qq.com/embed/phone/"
 
 
 // ***************** 激励相关地址 **********************//

+ 31 - 0
BFCommonKit/Classes/BFModels/PQUploadModel.swift

@@ -0,0 +1,31 @@
+
+//
+//  PQUploadModel.swift
+//  PQSpeed
+//
+//  Created by SanW on 2020/8/1.
+//  Copyright © 2020 BytesFlow. All rights reserved.
+//
+
+import Photos
+import UIKit
+
+open class PQUploadModel: BFBaseModel {
+   public var image: UIImage? // 图片
+   public var localPath: String? // 地址
+   public var duration: TimeInterval = 0 // 时间
+   public var asset: PHAsset? // 视频资源
+   public var videoBucketKey: String? // 上传视频功能
+   public var imageBucketKey: String? // 上传图片地址
+   public var assetCollection: PHAssetCollection? // 相簿
+   public var categoryList: PHFetchResult<PHAsset> = PHFetchResult<PHAsset>.init() // 子相册集合
+   public var assetList: [PHAsset] = Array<PHAsset>.init() // 子相册集合
+   public var uploadID: String? // 上传ID
+   public var videoWidth: CGFloat = 0 // 视频宽
+   public var videoHeight: CGFloat = 0 // 视频高
+   public var contentMode: UIView.ContentMode = .scaleAspectFill
+   public var stsToken: [String: Any]? // 上传信息
+
+    // add by ak 上传来源类型
+   public var videoFromScene: videoFromScene = .UploadNormal
+}

+ 122 - 0
BFCommonKit/Classes/BFProtocols/BFProtocols.swift

@@ -0,0 +1,122 @@
+//
+//  BFProtocols.swift
+//  BFCommonKit
+//
+//  Created by SanW on 2021/12/10.
+//
+
+import UIKit
+
+public protocol BFVideoItemProtocol {
+    dynamic var uniqueId: String? { get set } // 唯一ID
+    dynamic var videoId: Int { get set } // 视频ID
+    dynamic var id: UInt64 { get set } // 视频ID
+    dynamic var eventId: String? { get set } // 事件ID
+    dynamic var title: String? { get set } // 标题
+    dynamic var attributedTitle: NSMutableAttributedString? { get set } // 富文本标题
+    dynamic var summary: String? { get set } // 描述
+    dynamic var imageUrl: String { get set } // 图片地址
+    dynamic var selectedImage: String { get set } // 图片地址
+    dynamic var isSelected: Bool { get set }
+    dynamic var recommendLogVO: String? { get set } // 推荐日志对象
+    dynamic var flowPool: String? { get set } // 流量池数据 eg:#1#12#5#169182931029
+    dynamic var abInfoData: String? { get set } // AB
+    dynamic var pageCategoryId: Int { get set } // 页面分类ID
+    dynamic var version: String { get set } // 版本号
+    dynamic var mid: String { get set } // 设备ID
+    dynamic var date: Int { get set } // 当前时间戳  Float64(Date.init().timeIntervalSince1970) * 1000
+    var headVideoId: String? { get set } // 当前的相关推荐视频是属于哪个视频的相关推荐,值为那个头部视频的videoId
+    var auditStatus: Int { get set } // 审核状态 1 审核中,2 不通过 3 待修改,4 自己可见 5 通过 ,
+    var barrageCount: Int { get set } // 弹幕数量
+    var barrageSwitch: Int { get set } // 是否打开弹幕 1打开 -1关闭 ,
+    var auditReason: String? { get set } // 审核不通过或者待修改的原因
+    var barrage: Any? { get set } // 弹幕集合
+    var chargeDetail: [String: Any]? { get set } // 收费的相关信息
+    var commentCount: Int { get set } // 评论数量
+    var coverImg: [String: Any]? { get set } // 封面对象 ,
+    var cutVoStr: String? { get set } // h5剪切板内容 ,
+    var descr: String? { get set } // 视频简介 ,
+    var encryption: Int { get set } // 是否加密视频:0是1不是 ,
+    var favorited: Bool { get set } // 是否收藏 ,
+    var favoriteds: Int { get set } //  收藏数 ,
+    var fileExtensions: String? { get set } // 视频后缀 ,
+    var firstPicture: Bool { get set } // 封面是否是第一帧,false不是true是 ,
+    var gmtCreate: String? { get set } // 创建时间 ,
+    var gmtCreateDescr: String? { get set } // 发视频时间描述 ,
+    var gmtCreateTimestamp: Int { get set } // 创建时间戳 ,
+    var gmtModifie: String? { get set } // 修改时间 ,
+    var gmtModifiedTimestamp: Int { get set } // 修改时间戳 ,
+    var h5ShareImgPath: String? { get set } // h5分享图URL ,
+    var hasShareSpaceData: Bool { get set } // 是否有分享空间数据,
+    var isRecommendShare: Int { get set } // 是否有分发推荐的封面和标题 1 有 0 无 传空或者不传默认为0,
+    var lastTimestamp: Int { get set } // 时间戳 ,
+    //  liteVideoData (LiteVideoDataVO, optional): lite数据,
+    var measure: Int { get set }
+    var measureId: Int { get set }
+    var measureType: Int { get set } // 0 非流量池 1曝光池2普通推荐测试池3待推荐测试池 ,
+    var playBeforeDay: Int { get set } // 播放时间距离今天的天数 ,
+    var playCount: Int { get set } // 播放次数 ,
+    var playCountFormatStr: String? { get set } //  用户视频总播放数,格式化后的值,前端直接显示 ,
+    var playCountTotal: Int { get set } // 总播放次数 ,
+    var playTime: Int { get set } // 播放时间 ,
+    var processShareHeadLab: [String: Any]? { get set } // 视频分享片尾数据 ,
+    var processShareTailLab: [String: Any]? { get set } // 视频分享片尾数据 ,
+    var pwd: String? { get set } // 视频密码 ,
+    var recommendId: String? { get set } // 推荐链路ID ,
+    var recommendSource: Int { get set } // 0 默认 1 第四范式
+    var recommendStatus: Int { get set } // 推荐状态 ,
+    var rotate: Int { get set } // 旋转角度 ,
+    var sampleJobId: String? { get set }
+    var sampleRequestId: String? { get set }
+    var sampleTotalTime: Int { get set }
+    var sampleTranscodeStatus: Int { get set }
+    var sampleTransedVideoPath: String? { get set }
+    var sendBeforeDay: Int { get set } // 发视频距离今天的天数 ,
+    var sensitiveMsg: String? { get set } // 敏感提示信息 ,
+    var sensitiveStatus: Int { get set } //  内容敏感状态(0:未检验,1:不敏感,2:敏感,3:敏感已审) ,
+    var shareCount: Int { get set } // 分享到朋友圈次数 ,
+    var shareId: String? { get set } // 分享的 ID
+    var shareCountFriend: Int { get set } // 分享到微信好友 ,
+    var shareImgPath: String? { get set } // 分享图URL ,
+    var shareLinkType: Int { get set } // 分享到微信好友的图片的链接的类型 ,
+    var sharePageType: Int { get set } // 0 综合模块 1 feed流 ,
+    var shareTitle: String? { get set } // 分享到微信好友的图片的title ,
+    var showHotRecommend: Bool { get set } // 是否需要显示热门推荐 ,
+    var size: Int { get set } //  大小 ,
+    var status: Int { get set } // 数据状态,1 有效,2 已删除,3 已屏蔽,4 关注可见,5 分享可见 6 自己可见 ,
+    var tabShareImgPath: String? { get set } // 转发分享图URL ,
+    var thumbnailImagePath: String? { get set } // 缩略图URL ,
+    var totalTime: Int { get set } // 视频时长 ,
+    var totalTimeParas: String? { get set } // 视频时长十分秒 ,
+    var transcodeStatus: Int { get set } // 转码状态:1-不需转码 2-转码中 3-转码完成 4-转码失败 ,
+    var transcodeVOList: [Any]? { get set } // 多码率数据 ,
+    var uid: Int { get set } // 视频的用户ID ,
+    var user: [String: Any]? { get set } //  用户对象 ,
+    var videoCollectionId: Int { get set } // 视频所在的视频集ID ,
+    var videoCoverSnapshotPath: String? { get set } // 原始封面图片 ,
+    var videoPath: String? { get set } // 视频地址 ,
+    var videoReportMeta: String? { get set } // 视频上报数据,上报时原样返回 ,
+    var videoShareJumpModel: [String: Any]? { get set } // 分享页跳转的信息 ,
+    var playProgress: Float64 { get set } // 已播放时长
+    var duration: Float64 { get set } // 视频总时长
+    var tab_pageType: TAB_PAGETYPE { get set } // 0-推荐 1-关注
+    var pageSource: PAGESOURCE { get set }
+    var isVerticality: Bool { get set }
+    var isShareList: Bool { get set } // 是否是分享列表
+    var uplpadBucketKey: String? { get set } // 上传视频地址
+    var uplpadStatus: Int { get set } // 上传视频状态  1-上传中 2-上传完成 3-上传失败 4-发布中 4-发布完成
+    var uplpadRequest: Any? { get set }
+    var stsToken: [String: Any]? { get set } // 上传信息
+    var localPath: String? { get set } // 地址
+    var progress: Float { get set }
+    var projectId: String? { get set } // 项目ID-发布创作的视频时必传,会在进入创作工具页时生成,以app_no_projectdata为前缀
+    var autoType: autoType? { get set } // autoType 自动动作的类型
+    // 发布视频来源类型
+    var videoFromScene: videoFromScene { get set }
+    // extParams: 额外参数-传入发布页 - 主要中秋红包塞活动使用
+    var extParams:String { get set }
+    // 话题信息
+    var topicData: [String: Any]? { get set }
+    var uplpadImage: UIImage? { get set } // 上传的图片封面
+}
+

+ 4 - 1
Example/Podfile.lock

@@ -6,6 +6,7 @@ PODS:
     - BFCommonKit/BFEnums (= 1.5.2)
     - BFCommonKit/BFEnv (= 1.5.2)
     - BFCommonKit/BFModels (= 1.5.2)
+    - BFCommonKit/BFProtocols (= 1.5.2)
     - BFCommonKit/BFUtility (= 1.5.2)
     - BFCommonKit/BFVendors (= 1.5.2)
   - BFCommonKit/BFCategorys (1.5.2):
@@ -19,6 +20,8 @@ PODS:
     - BFCommonKit/BFEnums
     - ObjectMapper (= 4.2.0)
     - RealmSwift (= 10.7.6)
+  - BFCommonKit/BFProtocols (1.5.2):
+    - BFCommonKit/BFEnums
   - BFCommonKit/BFUtility (1.5.2):
     - Alamofire (= 5.4.4)
     - BFCommonKit/BFCategorys
@@ -71,7 +74,7 @@ EXTERNAL SOURCES:
 
 SPEC CHECKSUMS:
   Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9
-  BFCommonKit: 261846b8eeebdebc817f20bec78bff2cc3905dea
+  BFCommonKit: ea8b893eb9cd74249d9d55e00b46df7784eb9490
   KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
   Kingfisher: 016c8b653a35add51dd34a3aba36b580041acc74
   KingfisherWebP: dec17a5eb1af2658791bde1f93ae9a853678f826