Pārlūkot izejas kodu

视频列表Api

Chris 5 gadi atpakaļ
vecāks
revīzija
82bc8d7137

+ 4 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -623,6 +623,7 @@
 		BDE376E522C22D2B0055E2EA /* AlivcImage.m in Sources */ = {isa = PBXBuildFile; fileRef = BDE376E122C22D2A0055E2EA /* AlivcImage.m */; };
 		BDE376E622C22D2B0055E2EA /* AlivcDefine.m in Sources */ = {isa = PBXBuildFile; fileRef = BDE376E222C22D2B0055E2EA /* AlivcDefine.m */; };
 		BDE376E922C22D4E0055E2EA /* AlivcUIConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = BDE376E722C22D4E0055E2EA /* AlivcUIConfig.m */; };
+		BDE8AD1622CC59EE00E03C65 /* CommunityVideoListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE8AD1522CC59EE00E03C65 /* CommunityVideoListModel.swift */; };
 		BDEF7791228571DC00ED0AC0 /* CommonPayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDEF7790228571DC00ED0AC0 /* CommonPayView.swift */; };
 		BDEF7793228575A800ED0AC0 /* CommonPayCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDEF7792228575A800ED0AC0 /* CommonPayCell.swift */; };
 		BDF45F0D228C00B8004E2682 /* DefaultContactInfoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF45F0C228C00B8004E2682 /* DefaultContactInfoModel.swift */; };
@@ -1390,6 +1391,7 @@
 		BDE376E422C22D2B0055E2EA /* AlivcDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlivcDefine.h; sourceTree = "<group>"; };
 		BDE376E722C22D4E0055E2EA /* AlivcUIConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlivcUIConfig.m; sourceTree = "<group>"; };
 		BDE376E822C22D4E0055E2EA /* AlivcUIConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlivcUIConfig.h; sourceTree = "<group>"; };
+		BDE8AD1522CC59EE00E03C65 /* CommunityVideoListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoListModel.swift; sourceTree = "<group>"; };
 		BDEF7790228571DC00ED0AC0 /* CommonPayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonPayView.swift; sourceTree = "<group>"; };
 		BDEF7792228575A800ED0AC0 /* CommonPayCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonPayCell.swift; sourceTree = "<group>"; };
 		BDF45F0C228C00B8004E2682 /* DefaultContactInfoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultContactInfoModel.swift; sourceTree = "<group>"; };
@@ -3879,6 +3881,7 @@
 				A71CAB3A22C9F21100D908A8 /* CommunityMemberFollowTopicListModel.swift */,
 				BD981A8E22C9FEEF0043D951 /* CommunityPublishModel.swift */,
 				BD0F61F722CAFC8B004650FB /* CommunityVideoAuthModel.swift */,
+				BDE8AD1522CC59EE00E03C65 /* CommunityVideoListModel.swift */,
 			);
 			path = CommunityModel;
 			sourceTree = "<group>";
@@ -5831,6 +5834,7 @@
 				A7CC7526227196A8003C4F38 /* AccountSecurityTableViewCell.swift in Sources */,
 				A7D5F25722C05BE900F8E9AF /* UserDetailModel.swift in Sources */,
 				BDF47D80228288F900941AB9 /* ShoppingCartAccountView.swift in Sources */,
+				BDE8AD1622CC59EE00E03C65 /* CommunityVideoListModel.swift in Sources */,
 				A7284401224DBB7700F82F30 /* SwiftMoyaNetWorkServiceUser.swift in Sources */,
 				A7B4E728228160BA0012914A /* ProductRightSideleftPictureCollectionViewCell.swift in Sources */,
 				BD6122E622C3654500D3F513 /* AliyunTimelineMediaInfo.m in Sources */,

+ 102 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityVideoListModel.swift

@@ -0,0 +1,102 @@
+//
+//  CommunityVideoListModel.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/7/3.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  视频播放列表のModel
+
+import Foundation
+import ObjectMapper
+
+
+class CommunityVideoListModel : NSObject, Mappable{
+    
+    var data : [CommunityVideoItemModel]?
+    var pagination : PaginationModel?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CommunityVideoListModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        data <- map["data"]
+        pagination <- map["pagination"]
+        
+    }
+    
+}
+
+class CommunityVideoItemModel : NSObject, Mappable{
+    
+    var avatar : String?
+    var collectCount : Int?
+    var commentCount : Int?
+    var content : String?
+    var id : Int?
+    var img : String?
+    var isCollect : Int?
+    var isFollow : Int?
+    var isLike : Int?
+    var praiseCount : Int?
+    var title : String?
+    var topic : [CommunityVideoTopicModel]?
+    var type : String?
+    var uid : Int?
+    var username : String?
+    var video : String?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CommunityVideoItemModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        avatar <- map["avatar"]
+        collectCount <- map["collect_count"]
+        commentCount <- map["comment_count"]
+        content <- map["content"]
+        id <- map["id"]
+        img <- map["img"]
+        isCollect <- map["is_collect"]
+        isFollow <- map["is_follow"]
+        isLike <- map["is_like"]
+        praiseCount <- map["praise_count"]
+        title <- map["title"]
+        topic <- map["topic"]
+        type <- map["type"]
+        uid <- map["uid"]
+        username <- map["username"]
+        video <- map["video"]
+        
+    }
+    
+}
+
+class CommunityVideoTopicModel : NSObject, Mappable{
+    
+    var id : Int?
+    var name : String?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CommunityVideoTopicModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        id <- map["id"]
+        name <- map["name"]
+        
+    }
+    
+}

+ 15 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaNetWorkServiceCommunity.swift

@@ -167,6 +167,21 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
         }
     }
     
+    // MARK: - 视频列表
+    /// 视频列表
+    ///
+    /// - Parameters:
+    ///   - id: 内容id(过滤用)
+    func communityVideoListApi(id:Int = 0, completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()
+        parameters.updateValue(id, forKey: "id")
+        SwiftProgressHUD.shared().showWait()
+        SwiftMoyaNetWorkManager.shared.requestObject(CommunityVideoListModel.self, target: MultiTarget(SwiftMoyaServiceCommunityApi.communityVideoList(parameters: parameters))) { (communityVideoListModel) in
+            SwiftProgressHUD.shared().hide()
+            completion(communityVideoListModel)
+        }
+    }
+    
     // MARK: - 多关注页面feed流
     /// 多关注页面feed流
     ///

+ 12 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaServiceCommunityApi.swift

@@ -37,6 +37,10 @@ public let kCommunityPublishApi = "/community/post"
 /// 获取上传地址和凭证
 public let kCommunityVideoUploadAuthApi = "/community/getVodUploadAuth"
 
+// MARK: - 视频列表
+/// 视频列表
+public let kCommunityVideoListApi = "/community/post/video"
+
 // MARK: - 关注页面feed流
 /// 关注页面feed流
 public let kCommunityFollowFeedApi = "/community/feed"
@@ -74,6 +78,7 @@ public let kCommunityMemberFollowTopicCancelFollowApi = "/community/memberFollow
 /// - communityPosts: 内容列表
 /// - communityPublish: 发布内容
 /// - communityVideoUploadAuth: 视频上传凭证
+/// - communityVideoList: 视频列表
 /// - communityFeed: 关注页面feed流
 /// - communityPostSuggest: 关注页面feed流
 /// - communityTopicDetail: 话题详情
@@ -90,6 +95,7 @@ public enum SwiftMoyaServiceCommunityApi {
     case communityPosts(parameters:Dictionary<String, Any>)
     case communityPublish(parameters:Dictionary<String, Any>)
     case communityVideoUploadAuth(parameters:Dictionary<String, Any>)
+    case communityVideoList(parameters:Dictionary<String, Any>)
     case communityFollowFeed(parameters:Dictionary<String, Any>)
     case communityPostSuggest(parameters:Dictionary<String, Any>)
     case communityTopicDetail(parameters:Dictionary<String, Any>)
@@ -110,6 +116,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityPosts,
              .communityPublish,
              .communityVideoUploadAuth,
+             .communityVideoList,
              .communityFollowFeed,
              .communityPostSuggest,
              .communityTopicDetail,
@@ -138,6 +145,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
             return kCommunityPublishApi
         case .communityVideoUploadAuth:
             return kCommunityVideoUploadAuthApi
+        case .communityVideoList:
+            return kCommunityVideoListApi
         case .communityFollowFeed:
             return kCommunityFollowFeedApi
         case .communityPostSuggest:
@@ -167,6 +176,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityTopics,
              .communityPosts,
              .communityVideoUploadAuth,
+             .communityVideoList,
              .communityFollowFeed,
              .communityPostSuggest,
              .communityTopicDetail,
@@ -191,6 +201,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityPosts(var parameters),
              .communityPublish(var parameters),
              .communityVideoUploadAuth(var parameters),
+             .communityVideoList(var parameters),
              .communityFollowFeed(var parameters),
              .communityPostSuggest(var parameters),
              .communityTopicDetail(var parameters),
@@ -227,6 +238,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityPosts,
              .communityPublish,
              .communityVideoUploadAuth,
+             .communityVideoList,
              .communityFollowFeed,
              .communityPostSuggest,
              .communityTopicDetail,