|
@@ -123,6 +123,9 @@ public let kCommunityCateMusicListApi = "/community/music"
|
|
|
/// - communityPostReply : 回复列表
|
|
|
/// - communityPostComment : 评论&回复
|
|
|
/// - communityUploadMusic : 用户上传音乐
|
|
|
+/// - communityRecMusicList : 热门推荐音乐列表
|
|
|
+/// - communityGetMusicCategory : 获取音乐分类
|
|
|
+/// - communityCateMusicList : 获取分类下所有音乐
|
|
|
|
|
|
public enum SwiftMoyaServiceCommunityApi {
|
|
|
case communityTopicCategory(parameters:Dictionary<String, Any>)
|
|
@@ -145,6 +148,9 @@ public enum SwiftMoyaServiceCommunityApi {
|
|
|
case communityPostReply(parameters:Dictionary<String, Any>)
|
|
|
case communityPostComment(parameters:Dictionary<String, Any>)
|
|
|
case communityUploadMusic(parameters:Dictionary<String, Any>)
|
|
|
+ case communityRecMusicList(parameters:Dictionary<String, Any>)
|
|
|
+ case communityGetMusicCategory(parameters:Dictionary<String, Any>)
|
|
|
+ case communityCateMusicList(parameters:Dictionary<String, Any>)
|
|
|
}
|
|
|
|
|
|
extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
@@ -170,7 +176,10 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostComments,
|
|
|
.communityPostReply,
|
|
|
.communityPostComment,
|
|
|
- .communityUploadMusic
|
|
|
+ .communityUploadMusic,
|
|
|
+ .communityRecMusicList,
|
|
|
+ .communityGetMusicCategory,
|
|
|
+ .communityCateMusicList
|
|
|
:
|
|
|
return URL(string: kApiDataPrefix())!
|
|
|
}
|
|
@@ -218,6 +227,12 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
return kCommunityPostCommentApi
|
|
|
case .communityUploadMusic:
|
|
|
return kCommunityUploadMusicApi
|
|
|
+ case .communityRecMusicList:
|
|
|
+ return kCommunityRecMusicListApi
|
|
|
+ case .communityGetMusicCategory:
|
|
|
+ return kCommunityGetMusicCategoryApi
|
|
|
+ case .communityCateMusicList:
|
|
|
+ return kCommunityCateMusicListApi
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -243,7 +258,10 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityMemberFollowTopicList,
|
|
|
.communityPostDetail,
|
|
|
.communityPostComments,
|
|
|
- .communityPostReply
|
|
|
+ .communityPostReply,
|
|
|
+ .communityRecMusicList,
|
|
|
+ .communityGetMusicCategory,
|
|
|
+ .communityCateMusicList
|
|
|
:
|
|
|
return .get
|
|
|
case .communityMemberFollowTopicCancelFollow
|
|
@@ -275,7 +293,10 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostComments(var parameters),
|
|
|
.communityPostReply(var parameters),
|
|
|
.communityPostComment(var parameters),
|
|
|
- .communityUploadMusic(var parameters)
|
|
|
+ .communityUploadMusic(var parameters),
|
|
|
+ .communityRecMusicList(var parameters),
|
|
|
+ .communityGetMusicCategory(var parameters),
|
|
|
+ .communityCateMusicList(var parameters)
|
|
|
:
|
|
|
let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
|
|
|
parameters.updateValue(sign, forKey: "sign")
|
|
@@ -317,7 +338,10 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostComments,
|
|
|
.communityPostReply,
|
|
|
.communityPostComment,
|
|
|
- .communityUploadMusic
|
|
|
+ .communityUploadMusic,
|
|
|
+ .communityRecMusicList,
|
|
|
+ .communityGetMusicCategory,
|
|
|
+ .communityCateMusicList
|
|
|
:
|
|
|
return (headerParameters(headerType: .tokenHeader) as! [String : String])
|
|
|
}
|