wenweiwei пре 3 година
родитељ
комит
70ee2b6ccf

+ 11 - 11
BFAnalyzeKit/Classes/BFEventTrackAdaptor.swift

@@ -9,7 +9,7 @@ import BFCommonKit
 import BFNetRequestKit
 import UIKit
 
-class BFEventTrackAdaptor: NSObject {
+public class BFEventTrackAdaptor: NSObject {
     /// 基础埋点上报
     /// - Parameters:
     ///   - logType: 数据库类型
@@ -20,7 +20,7 @@ class BFEventTrackAdaptor: NSObject {
     ///   - extParams: extParams 扩展字段,为json对象
     ///   - remindmsg: remindmsg 打印提示信息
     /// - Returns: <#description#>
-    public class func baseReportUpload(logType: statisticsLogType = .st_log_type_simpleevent, businessType: businessType?, objectType: objectType?, pageSource: PAGESOURCE?, params: [String: Any]? = nil, eventData: [String: Any]? = nil, extParams: [String: Any]? = nil, commonParams: [String: Any]? = nil) {
+    public class func baseReportUpload(logType: statisticsLogType = .st_log_type_simpleevent, businessType: businessType?, objectType: objectType?, pageSource: PAGESOURCE?, params: [String: Any]? = nil, eventData: [String: Any]? = nil, extParams: [String: Any]? = nil, commonParams: [String: Any]?) {
         BFBaseEventTrack.bf_frontendReportUpload(url: PQENVUtil.shared.commonapi + staticsFrontendReportUrl, logType: logType.rawValue, businessType: businessType?.rawValue, objectType: objectType?.rawValue, pageSource: pageSource?.rawValue, params: params, eventData: eventData, extParams: extParams, commonParams: commonParams)
     }
 
@@ -36,7 +36,7 @@ class BFEventTrackAdaptor: NSObject {
     ///   - videoIds: <#videoIds description#>
     ///   - playId: <#playId description#>
     ///   - headVideoId: <#headVideoId description#>
-    public class func videoRelationReportUpload(reportLogType: reportLogType, videoData: BFVideoItemProtocol?, pageSource: PAGESOURCE? = nil, businessType: businessType?, objectType: objectType? = nil, extParams: [String: Any]? = nil, shareId: String? = nil, videoIds: String? = nil, playId: String? = nil, headVideoId: String? = nil, projectId: String?, parentProjectId: String?, rootProjectId: String?, canProduce: String?, parentVideoId: String?, commonParams: [String: Any]? = nil) {
+    public class func videoRelationReportUpload(reportLogType: reportLogType, videoData: BFVideoItemProtocol?, pageSource: PAGESOURCE? = nil, businessType: businessType?, objectType: objectType? = nil, extParams: [String: Any]? = nil, shareId: String? = nil, videoIds: String? = nil, playId: String? = nil, headVideoId: String? = nil, projectId: String?, parentProjectId: String?, rootProjectId: String?, canProduce: String?, parentVideoId: String?, commonParams: [String: Any]?) {
         DispatchQueue.global().async {
             var tempExtParams: [String: Any] = extParams ?? [:]
             if videoData?.topicData != nil {
@@ -65,7 +65,7 @@ class BFEventTrackAdaptor: NSObject {
                 tempExtParams["videoId"] = "\(videoData?.id ?? 0)"
             }
             if objectType == .ot_reproduce_clickButton || objectType == .ot_reproduce_collectionBar || objectType == .ot_reproduce_collectionClicButton || objectType == .ot_reproduce_sameSourceButton {
-                baseReportUpload(businessType: businessType, objectType: objectType, pageSource: pageSource != nil ? pageSource! : (videoData?.pageSource ?? .sp_category), extParams: tempExtParams)
+                baseReportUpload(businessType: businessType, objectType: objectType, pageSource: pageSource != nil ? pageSource! : (videoData?.pageSource ?? .sp_category), extParams: tempExtParams, commonParams: commonParams)
             } else {
                 var url: String = PQENVUtil.shared.longvideoapi
                 var params: [String: Any] = [:]
@@ -121,7 +121,7 @@ class BFEventTrackAdaptor: NSObject {
     //   - businessType: <#businessType description#>
     //   - targetUid: <#targetUid description#>
     //   - shareId: <#shareId description#>
-    public class func shareReportUpload(isShareVideo: Bool = true, screenType: Int = 1, videoId: String, pageSource: PAGESOURCE, recommendId: String?, recommendLogVO: String?, flowPool: String?, abInfoData: String?, measureType: Int?, measureId: Int?, businessType: businessType?, targetUid: Int?, shareId: String = "", playId: String?, wxOpenId: String?, extParams: [String: Any]? = nil, commonParams: [String: Any]? = nil) {
+    public class func shareReportUpload(isShareVideo: Bool = true, screenType: Int = 1, videoId: String, pageSource: PAGESOURCE, recommendId: String?, recommendLogVO: String?, flowPool: String?, abInfoData: String?, measureType: Int?, measureId: Int?, businessType: businessType?, targetUid: Int?, shareId: String = "", playId: String?, wxOpenId: String?, extParams: [String: Any]? = nil, commonParams: [String: Any]?) {
         DispatchQueue.global().async {
             var url: String = PQENVUtil.shared.longvideoapi
             switch screenType {
@@ -140,7 +140,7 @@ class BFEventTrackAdaptor: NSObject {
 
     /// DNS上报
     /// - Returns: <#description#>
-    public class func dnsReportUpload(commonParams: [String: Any]? = nil) {
+    public class func dnsReportUpload(commonParams: [String: Any]?) {
         DispatchQueue.global().async {
             let speedExtParams = bf_parseDNS(hostUrl: "speed.piaoquantv.com")
             let rescdnExtParams = bf_parseDNS(hostUrl: "rescdn.yishihui.com")
@@ -233,7 +233,7 @@ class BFEventTrackAdaptor: NSObject {
     ///   - pushTargetId: pushTargetType == 1 视频ID,pushTargetType == 4 用户ID
     ///   - bizParam 扩展参数
     /// - Returns: <#description#>
-    public class func reportPushActionUpload(pushId: String, pushTargetType: Int, pushBrand: String, pushTargetId: String?, bizParam: [String: Any]? = nil, commonParams: [String: Any]? = nil) {
+    public class func reportPushActionUpload(pushId: String, pushTargetType: Int, pushBrand: String, pushTargetId: String?, bizParam: [String: Any]? = nil, commonParams: [String: Any]?) {
         BFBaseEventTrack.bf_pushActionReportUpload(url: PQENVUtil.shared.longvideoapi + pushActionReportUrl, pushId: pushId, pushTargetType: pushTargetType, pushBrand: pushBrand, pushTargetId: pushTargetId, bizParam: bizParam, commonParams: commonParams)
     }
 
@@ -241,7 +241,7 @@ class BFEventTrackAdaptor: NSObject {
     /// - Parameter registerId: 设备id
     /// - Parameter deviceToken: <#deviceToken description#>
     /// - Returns: <#description#>
-    public class func reportPushDeviceTokenUpload(registerId: String, deviceToken: String, brand: String, commonParams: [String: Any]? = nil, completeHander: @escaping (_ isSuccess: Bool) -> Void) {
+    public class func reportPushDeviceTokenUpload(registerId: String, deviceToken: String, brand: String, commonParams: [String: Any]?, completeHander: @escaping (_ isSuccess: Bool) -> Void) {
         BFBaseEventTrack.bf_deviceTokenReportUpload(url: PQENVUtil.shared.longvideoapi + pushDeviceTokenReportUrl, registerId: registerId, deviceToken: deviceToken, brand: brand, commonParams: commonParams, completeHander: completeHander)
     }
 
@@ -252,7 +252,7 @@ class BFEventTrackAdaptor: NSObject {
     ///   - searchNumber: 数量
     ///   - reportType: 1 into 2 click 3 show
     /// - Returns: <#description#>
-    public class func searchReportUpload(keyWord: String, searchType: Int, searchNumber: Int = 10, reportType: Int = 2, commonParams: [String: Any]? = nil) {
+    public class func searchReportUpload(keyWord: String, searchType: Int, searchNumber: Int = 10, reportType: Int = 2, commonParams: [String: Any]?) {
         BFBaseEventTrack.bf_searchReportUpload(url: PQENVUtil.shared.longvideoapi + searchReportUrl, keyWord: keyWord, searchType: searchType, searchNumber: searchNumber, reportType: reportType, commonParams: commonParams)
     }
 
@@ -263,7 +263,7 @@ class BFEventTrackAdaptor: NSObject {
     ///   - ossInfo: <#ossInfo description#>
     ///   - params: <#params description#>
     /// - Returns: <#description#>
-    public class func publishReportUpload(projectId: String?, businessType: businessType, ossInfo: [String: Any], params: [String: Any], commonParams: [String: Any]? = nil) {
+    public class func publishReportUpload(projectId: String?, businessType: businessType, ossInfo: [String: Any], params: [String: Any], commonParams: [String: Any]?) {
         var extParams: [String: Any] = ["ossInfo": bf_dictionaryToJsonString(ossInfo) ?? "", "params": bf_dictionaryToJsonString(params) ?? ""]
         if projectId != nil {
             extParams["projectId"] = projectId
@@ -346,7 +346,7 @@ class BFEventTrackAdaptor: NSObject {
     ///   - extParams: 扩展字段 json格式
     ///   - remindmsg: 打印提示信息
     /// - Returns: <#description#>
-    public class func messageReportUpload(messageIds: String?, clickId: String?, messageType: messageType?, messageSubType: messageSubType?, actionType: actionType?, objectType: objectType?, pageSource: PAGESOURCE?, readStatus: Int = 1, eventData: [String: Any]? = nil, extParams: [String: Any]? = nil, commonParams: [String: Any]? = nil) {
+    public class func messageReportUpload(messageIds: String?, clickId: String?, messageType: messageType?, messageSubType: messageSubType?, actionType: actionType?, objectType: objectType?, pageSource: PAGESOURCE?, readStatus: Int = 1, eventData: [String: Any]? = nil, extParams: [String: Any]? = nil, commonParams: [String: Any]?) {
         BFBaseEventTrack.bf_messageReportUpload(url: PQENVUtil.shared.longvideoapi + messagePeportUrl, messageIds: messageIds, clickId: clickId, messageType: messageType?.rawValue, messageSubType: messageSubType?.rawValue, actionType: actionType?.rawValue, readStatus: readStatus, objectType: objectType?.rawValue, pageSource: pageSource?.rawValue, eventData: eventData, extParams: extParams, commonParams: commonParams)
     }
 }

+ 115 - 115
BFAnalyzeKit/Classes/PQVideoMakeEventTrackModel.swift

@@ -11,118 +11,118 @@ import BFCommonKit
 import BFNetRequestKit
 
 public class PQVideoMakeEventTrackModel: NSObject {
-//    // 进入创作工具的入口
-//    public var entrance: videoMakeEntranceType = .entrancePublicTabCompose {
-//        didSet {
-//            isPureUploadVideo = entrance == .entrancePublicTabUpload
-//            isReproduction = entrance == .entranceReproduction
-//        }
-//    }
-//
-//    // 草稿 Id
-//    public var draftId: String?
-//    // 项目 Id
-//    public var projectId: String?
-//    // 再创作视频的父 projectId - 仅「再创作」视频存在
-//    public var fatherProjectId: String?
-//    // 再创作视频的根 projectId - 仅「再创作」视频存在
-//    public var rootProjectId: String?
-//    // 再编辑视频的父 draftId - 仅「再编辑」视频存在
-//    public var fatherDraftId: String?
-//
-//    // 发布标题
-//    public var title: String?
-//    // 发布描述
-//    public var videoDes: String?
-//    // 发布封面的 URL
-//    public var coverUrl: String?
-//    // 发布的视频 Id
-//    public var videoId: String?
-//
-//    /**
-//      用户创作视频所用的时间成本,单位:毫秒(ms)
-//      (仅包含合成前的时间段,不包含合成后选择封面等时间消耗)
-//     如果是草稿箱项目,不包含之前累计的时间消耗,仅记录发布这一次的时间消耗
-//     如果是再创作项目,不包含别人创作的时间消耗,仅记录发布这一次的时间消耗
-//     如果是多次发布的项目,不包含之前累计的时间消耗,仅记录发布这一次的时间消耗
-//     */
-//    public var editTimeCost: Float64 = 0
-//    // 合成视频所用的时间成本,单位:毫秒(ms)
-//    public var composeTimeCost: Float64 = 0
-//    // 上传视频所用的时间成本,单位:毫秒(ms)
-//    public var uploadTimeCost: Float64 = 0
-//
-//    // 是否为纯上传视频 纯上传视频:true 加工工具视频:false
-//    public var isPureUploadVideo: Bool = false
-//    // 是否为再创作视频 再创作视频:true 非再创作视频:false
-//    public var isReproduction: Bool = false
-//    // 是否为再编辑视频 再编辑视频:true 非再编辑视频:false
-//    public var isCopyVideo: Bool = false
-//    // 段落相关-视频中存在的段落个数:number
-//    public var sectionNum: Int = 1
-//    // 文字相关 段落中的文字长度信息:number[] [​ section1-text-length, section2-text-length, ... ]
-//    public var secTextLength: [Int] = Array<Int>.init()
-//    // 图片 / 视频素材相关 段落中的(本地素材)图片数量:number[] [ section1-localImage-num, section2-localImage-num, ... ]
-//    public var secLocalImageNum: [Int] = Array<Int>.init()
-//    // 图片 / 视频素材相关 段落中的(本地素材)动图数量:number[] [ section1-localGif-num, section2-localGif-num, ... ]
-//    public var secLocalGifNum: [Int] = Array<Int>.init()
-//    // 图片 / 视频素材相关 段落中的(本地素材)视频数量:number[] [ section1-localVideo-num, section2-localVideo-num, ... ]
-//    public var secLocalVideoNum: [Int] = Array<Int>.init()
-//    // 图片/视频素材相关 -段落中的(网络素材)图片数量
-//    public var secCloudImageNum: [Int] = Array<Int>.init()
-//    // 图片/视频素材相关 -段落中(网络素材)动图数量
-//    public var secCloudGifNum: [Int] = Array<Int>.init()
-//    // 图片/视频素材相关 -段落中(网络素材)视频数量
-//    public var secCloudVideoNum: [Int] = Array<Int>.init()
-//    // 文字转语音相关 -段落中使用的语音素材名称,若段落中没有使用则报""
-//    public var secTextToSpeechMaterial: [String] = Array<String>.init()
-//    // 文字转语音相关 -段落中文字转语音的毫秒数
-//    public var secTextToSpeechTime: [Int64] = Array<Int64>.init()
-//    // 语音转文字相关 -每个段落中使用录音的毫秒数
-//    public var secSpeechToTextTime: [Int64] = Array<Int64>.init()
-//
-//    // 开始上传时间
-//    public var startUploadDate: Float64 = 0
-//    // 结束上传时间
-//    public var endUploadDate: Float64 = 0 {
-//        didSet {
-//            uploadTimeCost = (endUploadDate - startUploadDate) * 1000
-//        }
-//    }
-//
-//    // 使用音乐的名称(未使用音乐默认为 "")
-//    public var musicName: String = ""
-//    // 使用音乐Id
-//    public var musicId: String = ""
-//    // 使用音乐的地址(未使用音乐默认为 "")
-//    public var musicUrl: String = ""
-//    // 音乐的类型(未使用音乐默认为 "") - original - 原唱 - accompaniment - 伴奏
-//    public var musicType: String = ""
-//    // 音乐是否为片段(未使用音乐默认为 "")- true - 音乐片段 - false - 完整音乐
-//    public var isMusicClip: Bool = false
-//    // 画布比例
-//    public var canvasRatio: String = "original"
-//    // 卡点视频 使用视频素材数量
-//    public var syncedUpVideoNumber: Int = 0
-//    // 卡点视频 使用图片素材数量
-//    public var syncedUpImageNumber: Int = 0
-//    // 卡点视频 使用音乐Id
-//    public var syncedUpMusicId: String = ""
-//    // 卡点视频 使用音乐名称
-//    public var syncedUpMusicName: String = ""
-//    // 卡点视频 合成后视频长度(单位:毫秒)
-//    public var syncedUpVideoDuration: Float64 = 0
-//    // 卡点视频 原素材总时长(单位:毫秒)视频:报视频时长 图片:一张图报 1000ms
-//    public var syncedUpOriginalMaterialDuration: Float64 = 0
-//    // 卡点视频 视频选用节奏名称(快节奏 1、适中 2、慢节奏 3))
-//    public var syncedUpRhythmNumber: Int = 2
+    // 进入创作工具的入口
+    public var entrance: videoMakeEntranceType = .entrancePublicTabCompose {
+        didSet {
+            isPureUploadVideo = entrance == .entrancePublicTabUpload
+            isReproduction = entrance == .entranceReproduction
+        }
+    }
+
+    // 草稿 Id
+    public var draftId: String?
+    // 项目 Id
+    public var projectId: String?
+    // 再创作视频的父 projectId - 仅「再创作」视频存在
+    public var fatherProjectId: String?
+    // 再创作视频的根 projectId - 仅「再创作」视频存在
+    public var rootProjectId: String?
+    // 再编辑视频的父 draftId - 仅「再编辑」视频存在
+    public var fatherDraftId: String?
+
+    // 发布标题
+    public var title: String?
+    // 发布描述
+    public var videoDes: String?
+    // 发布封面的 URL
+    public var coverUrl: String?
+    // 发布的视频 Id
+    public var videoId: String?
+
+    /**
+      用户创作视频所用的时间成本,单位:毫秒(ms)
+      (仅包含合成前的时间段,不包含合成后选择封面等时间消耗)
+     如果是草稿箱项目,不包含之前累计的时间消耗,仅记录发布这一次的时间消耗
+     如果是再创作项目,不包含别人创作的时间消耗,仅记录发布这一次的时间消耗
+     如果是多次发布的项目,不包含之前累计的时间消耗,仅记录发布这一次的时间消耗
+     */
+    public var editTimeCost: Float64 = 0
+    // 合成视频所用的时间成本,单位:毫秒(ms)
+    public var composeTimeCost: Float64 = 0
+    // 上传视频所用的时间成本,单位:毫秒(ms)
+    public var uploadTimeCost: Float64 = 0
+
+    // 是否为纯上传视频 纯上传视频:true 加工工具视频:false
+    public var isPureUploadVideo: Bool = false
+    // 是否为再创作视频 再创作视频:true 非再创作视频:false
+    public var isReproduction: Bool = false
+    // 是否为再编辑视频 再编辑视频:true 非再编辑视频:false
+    public var isCopyVideo: Bool = false
+    // 段落相关-视频中存在的段落个数:number
+    public var sectionNum: Int = 1
+    // 文字相关 段落中的文字长度信息:number[] [​ section1-text-length, section2-text-length, ... ]
+    public var secTextLength: [Int] = Array<Int>.init()
+    // 图片 / 视频素材相关 段落中的(本地素材)图片数量:number[] [ section1-localImage-num, section2-localImage-num, ... ]
+    public var secLocalImageNum: [Int] = Array<Int>.init()
+    // 图片 / 视频素材相关 段落中的(本地素材)动图数量:number[] [ section1-localGif-num, section2-localGif-num, ... ]
+    public var secLocalGifNum: [Int] = Array<Int>.init()
+    // 图片 / 视频素材相关 段落中的(本地素材)视频数量:number[] [ section1-localVideo-num, section2-localVideo-num, ... ]
+    public var secLocalVideoNum: [Int] = Array<Int>.init()
+    // 图片/视频素材相关 -段落中的(网络素材)图片数量
+    public var secCloudImageNum: [Int] = Array<Int>.init()
+    // 图片/视频素材相关 -段落中(网络素材)动图数量
+    public var secCloudGifNum: [Int] = Array<Int>.init()
+    // 图片/视频素材相关 -段落中(网络素材)视频数量
+    public var secCloudVideoNum: [Int] = Array<Int>.init()
+    // 文字转语音相关 -段落中使用的语音素材名称,若段落中没有使用则报""
+    public var secTextToSpeechMaterial: [String] = Array<String>.init()
+    // 文字转语音相关 -段落中文字转语音的毫秒数
+    public var secTextToSpeechTime: [Int64] = Array<Int64>.init()
+    // 语音转文字相关 -每个段落中使用录音的毫秒数
+    public var secSpeechToTextTime: [Int64] = Array<Int64>.init()
+
+    // 开始上传时间
+    public var startUploadDate: Float64 = 0
+    // 结束上传时间
+    public var endUploadDate: Float64 = 0 {
+        didSet {
+            uploadTimeCost = (endUploadDate - startUploadDate) * 1000
+        }
+    }
+
+    // 使用音乐的名称(未使用音乐默认为 "")
+    public var musicName: String = ""
+    // 使用音乐Id
+    public var musicId: String = ""
+    // 使用音乐的地址(未使用音乐默认为 "")
+    public var musicUrl: String = ""
+    // 音乐的类型(未使用音乐默认为 "") - original - 原唱 - accompaniment - 伴奏
+    public var musicType: String = ""
+    // 音乐是否为片段(未使用音乐默认为 "")- true - 音乐片段 - false - 完整音乐
+    public var isMusicClip: Bool = false
+    // 画布比例
+    public var canvasRatio: String = "original"
+    // 卡点视频 使用视频素材数量
+    public var syncedUpVideoNumber: Int = 0
+    // 卡点视频 使用图片素材数量
+    public var syncedUpImageNumber: Int = 0
+    // 卡点视频 使用音乐Id
+    public var syncedUpMusicId: String = ""
+    // 卡点视频 使用音乐名称
+    public var syncedUpMusicName: String = ""
+    // 卡点视频 合成后视频长度(单位:毫秒)
+    public var syncedUpVideoDuration: Float64 = 0
+    // 卡点视频 原素材总时长(单位:毫秒)视频:报视频时长 图片:一张图报 1000ms
+    public var syncedUpOriginalMaterialDuration: Float64 = 0
+    // 卡点视频 视频选用节奏名称(快节奏 1、适中 2、慢节奏 3))
+    public var syncedUpRhythmNumber: Int = 2
 //    public var syncedUpVideoType:createStickersModel = .createStickersModelPoint
-//    public var syncedUpVideoSpeedMax:Float = 0.0
-//    public var syncedUpVideoSpeedMin:Float = 0.0
-//    
-//    override public init() {
-//        super.init()
-//    }
+    public var syncedUpVideoSpeedMax:Float = 0.0
+    public var syncedUpVideoSpeedMin:Float = 0.0
+    
+    override public init() {
+        super.init()
+    }
 
     /// 初始化
     /// - Parameter projectModel: <#projectModel description#>
@@ -225,8 +225,8 @@ public class PQVideoMakeEventTrackModel: NSObject {
 
 //    /// 转换为字典
 //    /// - Returns: <#description#>
-//    public func toParams() -> [String: Any] {
-//        var eventTrackDic = Dictionary<String, Any>.init()
+    public func toParams() -> [String: Any] {
+        var eventTrackDic = Dictionary<String, Any>.init()
 //        // 进入创作工具的入口
 //        eventTrackDic["entrance"] = entrance.rawValue
 //        // 发布的视频 Id
@@ -330,6 +330,6 @@ public class PQVideoMakeEventTrackModel: NSObject {
 //            eventTrackDic["syncedUpVideoSpeed"] = "[\(syncedUpVideoSpeedMax),\(syncedUpVideoSpeedMin)]"
 //        }
 //        NTLog(message: "创作工具埋点信息数据-\(eventTrackDic)")
-//        return eventTrackDic
-//    }
+        return eventTrackDic
+    }
 }