CommunityRecommendMusicListModel.swift 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // CommunityRecommendMusicListModel.swift
  3. // RainbowPlanet
  4. //
  5. // Created by Christopher on 2019/7/17.
  6. // Copyright © 2019 RainbowPlanet. All rights reserved.
  7. //
  8. import Foundation
  9. import ObjectMapper
  10. // 推荐&&分类のModelList
  11. class CommunityRecommendMusicListModel : NSObject, Mappable{
  12. var data : [CommunityMusicItemModel]?
  13. var pagination : PaginationModel?
  14. class func newInstance(map: Map) -> Mappable?{
  15. return CommunityRecommendMusicListModel()
  16. }
  17. required init?(map: Map){}
  18. private override init(){}
  19. func mapping(map: Map)
  20. {
  21. data <- map["data"]
  22. pagination <- map["pagination"]
  23. }
  24. }
  25. // 歌曲Model
  26. class CommunityMusicItemModel : NSObject, Mappable{
  27. var id : Int?
  28. var img : String?
  29. var musicDuration : Int?
  30. var name : String?
  31. var singer : String?
  32. var url : String?
  33. class func newInstance(map: Map) -> Mappable?{
  34. return CommunityMusicItemModel()
  35. }
  36. required init?(map: Map){}
  37. private override init(){}
  38. func mapping(map: Map)
  39. {
  40. id <- map["id"]
  41. img <- map["img"]
  42. musicDuration <- map["music_duration"]
  43. name <- map["name"]
  44. singer <- map["singer"]
  45. url <- map["url"]
  46. }
  47. }