瀏覽代碼

1.卡点视频添加图片默认时长

wenweiwei 3 年之前
父節點
當前提交
742be13401

+ 17 - 10
BFFramework/Classes/Base/ViewModel/PQUploadViewModel.swift

@@ -6,9 +6,9 @@
 //  Copyright © 2020 BytesFlow. All rights reserved.
 //
 
-import UIKit
 import BFCommonKit
 import BFNetRequestKit
+import UIKit
 
 public class PQUploadViewModel: NSObject {
     /// 发布视频
@@ -21,12 +21,15 @@ public class PQUploadViewModel: NSObject {
     ///   - descr: 描述
     ///   - videoFromScene 视频来源场景 1:普通上传 2:创作工具,3:普通上传转创作工具,4:后台转换加工,5:卡点视频制作
     /// - Returns: <#description#>
-    class public func publishVideo(projectId: String?, fileExtensions: String?, title: String, videoPath: String, coverImgPath: String?, descr: String, videoFromScene: videoFromScene, reCreateData: PQReCreateModel?, eventTrackData: PQVideoMakeEventTrackModel?, completeHander: @escaping (_ videoData: PQVideoListModel?, _ jsonDict: [String: Any]?, _ msg: String?) -> Void) {
+    public class func publishVideo(projectId: String?, fileExtensions: String?, title: String, videoPath: String, coverImgPath: String?, descr: String, videoFromScene: videoFromScene, reCreateData: PQReCreateModel?, eventTrackData: PQVideoMakeEventTrackModel?, topicId: String? = nil, completeHander: @escaping (_ videoData: PQVideoListModel?, _ jsonDict: [String: Any]?, _ msg: String?) -> Void) {
         BFLog(message: "AKAKAAKprojectId is\(String(describing: projectId)) videoFromScene is \(videoFromScene)")
-        var params : Dictionary<String,Any> = ["title": title, "fileExtensions": fileExtensions ?? "application/octet-stream", "videoPath": videoPath, "descr": descr, "viewStatus": 1, "produceProjectId": (projectId ?? "") as String, "videoFromScene": videoFromScene.rawValue]
-        if coverImgPath != nil && (coverImgPath?.count ?? 0) > 0 {
+        var params: [String: Any] = ["title": title, "fileExtensions": fileExtensions ?? "application/octet-stream", "videoPath": videoPath, "descr": descr, "viewStatus": 1, "produceProjectId": (projectId ?? "") as String, "videoFromScene": videoFromScene.rawValue]
+        if coverImgPath != nil, (coverImgPath?.count ?? 0) > 0 {
             params["coverImgPath"] = coverImgPath
         }
+        if topicId != nil, (topicId?.count ?? 0) > 0 {
+            params["topicId"] = topicId
+        }
         BFNetRequestAdaptor.postRequestData(url: PQENVUtil.shared.longvideoapi + videoSendUrl, parames: params, commonParams: commonParams()) { response, _, error, _ in
             if error != nil {
                 completeHander(nil, nil, error?.msg)
@@ -50,11 +53,11 @@ public class PQUploadViewModel: NSObject {
             }
             PQEventTrackViewModel.baseReportUpload(businessType: .bt_up_process, objectType: .ot_up_publishSuccess, pageSource: nil, extParams: extParams, remindmsg: "上传相关")
             if projectId != nil {
-                PQBaseViewModel.reportSendVideo(projectId!, tempModel.uniqueId ?? "",videoFromScene: videoFromScene) { isSuccess, _ in
+                PQBaseViewModel.reportSendVideo(projectId!, tempModel.uniqueId ?? "", videoFromScene: videoFromScene) { isSuccess, _ in
                     if !isSuccess {
-                        PQBaseViewModel.reportSendVideo(projectId!, tempModel.uniqueId ?? "",videoFromScene: videoFromScene) { isSuccess, _ in
+                        PQBaseViewModel.reportSendVideo(projectId!, tempModel.uniqueId ?? "", videoFromScene: videoFromScene) { isSuccess, _ in
                             if !isSuccess {
-                                PQBaseViewModel.reportSendVideo(projectId!, tempModel.uniqueId ?? "",videoFromScene: videoFromScene) { isSuccess, _ in
+                                PQBaseViewModel.reportSendVideo(projectId!, tempModel.uniqueId ?? "", videoFromScene: videoFromScene) { isSuccess, _ in
                                     if !isSuccess {}
                                 }
                             }
@@ -80,8 +83,12 @@ public class PQUploadViewModel: NSObject {
     ///   - descr: 描述
     ///   - completeHander: <#completeHander description#>
     /// - Returns: <#description#>
-   public class func updateVideo(title: String, videoId: String, coverImgPath: String, descr: String, completeHander: @escaping (_ videoData: PQVideoListModel?, _ msg: String?) -> Void) {
-        BFNetRequestAdaptor.postRequestData(url: PQENVUtil.shared.longvideoapi + updateVideoUrl, parames: ["title": title, "videoId": videoId, "coverImgPath": coverImgPath, "descr": descr, "viewStatus": 1, "barrageSwitch": 1], commonParams: commonParams()) { response, _, error, _ in
+    public class func updateVideo(title: String, videoId: String, coverImgPath: String, descr: String,topicId:Int64? = nil, completeHander: @escaping (_ videoData: PQVideoListModel?, _ msg: String?) -> Void) {
+        var params : Dictionary<String,Any> = ["title": title, "videoId": videoId, "coverImgPath": coverImgPath, "descr": descr, "viewStatus": 1, "barrageSwitch": 1]
+        if topicId != nil && (topicId ?? 0) > 0 {
+            params["topicId"] = topicId!
+        }
+        BFNetRequestAdaptor.postRequestData(url: PQENVUtil.shared.longvideoapi + updateVideoUrl, parames: params, commonParams: commonParams()) { response, _, error, _ in
             if error != nil {
                 completeHander(nil, error?.msg)
                 return
@@ -100,7 +107,7 @@ public class PQUploadViewModel: NSObject {
     ///   - totalTime: 总时长
     ///   - completeHander: <#completeHander description#>
     /// - Returns: <#description#>
-    class public func vodeoCoverImageList(videoId: String, videoPath: String, totalTime: Int, videoHeight: CGFloat, videoWidth: CGFloat, completeHander: @escaping (_ coverImages: [PQUploadModel]?, _ msg: String?) -> Void) {
+    public class func vodeoCoverImageList(videoId: String, videoPath: String, totalTime: Int, videoHeight: CGFloat, videoWidth: CGFloat, completeHander: @escaping (_ coverImages: [PQUploadModel]?, _ msg: String?) -> Void) {
         BFNetRequestAdaptor.postRequestData(url: PQENVUtil.shared.longvideoapi + vodeoCoverImageUrl, parames: ["id": videoId, "videoPath": videoPath, "totalTime": totalTime], commonParams: commonParams()) { response, _, error, _ in
             if error != nil {
                 completeHander(nil, error?.msg)

+ 1 - 0
BFFramework/Classes/PModels/PQVideoListModel.swift

@@ -240,6 +240,7 @@ open class PQVideoListModel: PQBaseModel, BFVideoItemProtocol {
     public var categoryName: String = ""
     // 视频分类图
     public var categoryImage: String?
+    public var topicId: Int64? // 话题id
 
     override public init(jsonDict: [String: Any]) {
         super.init(jsonDict: jsonDict)

+ 0 - 1
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointPublicController.swift

@@ -1377,6 +1377,5 @@ extension PQStuckPointPublicController {
             uploadData?.image  = imageData
             updateCoverImagegOrTitle()
         }
-        
     }
 }