1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- //
- // CommunityRecommendMusicListModel.swift
- // RainbowPlanet
- //
- // Created by Christopher on 2019/7/17.
- // Copyright © 2019 RainbowPlanet. All rights reserved.
- //
- import Foundation
- import ObjectMapper
- // 推荐&&分类のModelList
- class CommunityRecommendMusicListModel : NSObject, Mappable{
-
- var data : [CommunityMusicItemModel]?
- var pagination : PaginationModel?
-
-
- class func newInstance(map: Map) -> Mappable?{
- return CommunityRecommendMusicListModel()
- }
- required init?(map: Map){}
- private override init(){}
-
- func mapping(map: Map)
- {
- data <- map["data"]
- pagination <- map["pagination"]
-
- }
-
- }
- // 歌曲Model
- class CommunityMusicItemModel : NSObject, Mappable{
-
- var id : Int?
- var img : String?
- var musicDuration : Int?
- var name : String?
- var singer : String?
- var url : String?
-
-
- // 本地添加,用于控制状态
- var isPlaying : Bool? = false
-
- // 本地名字
- var musicName : String?
- // 是否选中
- var isSelected : Bool? = false
- // 是否使用
- var isUse :Bool? = false
- /// 使用中的音乐路径
- var publishNewMusicURL : URL? = nil
-
-
- class func newInstance(map: Map) -> Mappable?{
- return CommunityMusicItemModel()
- }
- required init?(map: Map){}
- public override init(){}
-
- func mapping(map: Map)
- {
- id <- map["id"]
- img <- map["img"]
- musicDuration <- map["music_duration"]
- name <- map["name"]
- singer <- map["singer"]
- url <- map["url"]
-
- }
-
- }
|