CommunityVideoListModel.swift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // CommunityVideoListModel.swift
  3. // RainbowPlanet
  4. //
  5. // Created by Christopher on 2019/7/3.
  6. // Copyright © 2019 RainbowPlanet. All rights reserved.
  7. // 视频播放列表のModel
  8. import Foundation
  9. import ObjectMapper
  10. class CommunityVideoListModel : NSObject, Mappable{
  11. var data : [CommunityVideoItemModel]?
  12. var pagination : PaginationModel?
  13. class func newInstance(map: Map) -> Mappable?{
  14. return CommunityVideoListModel()
  15. }
  16. required init?(map: Map){}
  17. private override init(){}
  18. func mapping(map: Map)
  19. {
  20. data <- map["data"]
  21. pagination <- map["pagination"]
  22. }
  23. }
  24. class CommunityVideoItemModel : NSObject, Mappable{
  25. var avatar : String?
  26. var collectCount : Int?
  27. var commentCount : Int?
  28. var content : String?
  29. var descUrl : String?
  30. var h5url : String?
  31. var id : Int?
  32. var img : String?
  33. var isCollect : Int?
  34. var isFollow : Int?
  35. var isLike : Int?
  36. var praiseCount : Int?
  37. var title : String?
  38. var topic : [CommunityVideoTopicModel]?
  39. var type : String?
  40. var uid : Int?
  41. var username : String?
  42. var video : String?
  43. var willCollectBean : Int?
  44. class func newInstance(map: Map) -> Mappable?{
  45. return CommunityVideoItemModel()
  46. }
  47. required init?(map: Map){}
  48. private override init(){}
  49. func mapping(map: Map)
  50. {
  51. avatar <- map["avatar"]
  52. collectCount <- map["collect_count"]
  53. commentCount <- map["comment_count"]
  54. content <- map["content"]
  55. descUrl <- map["desc_url"]
  56. h5url <- map["h5url"]
  57. id <- map["id"]
  58. img <- map["img"]
  59. isCollect <- map["is_collect"]
  60. isFollow <- map["is_follow"]
  61. isLike <- map["is_like"]
  62. praiseCount <- map["praise_count"]
  63. title <- map["title"]
  64. topic <- map["topic"]
  65. type <- map["type"]
  66. uid <- map["uid"]
  67. username <- map["username"]
  68. video <- map["video"]
  69. willCollectBean <- map["will_collect_bean"]
  70. }
  71. }
  72. class CommunityVideoTopicModel : NSObject, Mappable{
  73. var id : Int?
  74. var name : String?
  75. class func newInstance(map: Map) -> Mappable?{
  76. return CommunityVideoTopicModel()
  77. }
  78. required init?(map: Map){}
  79. private override init(){}
  80. func mapping(map: Map)
  81. {
  82. id <- map["id"]
  83. name <- map["name"]
  84. }
  85. }