|
@@ -85,6 +85,22 @@ public let kCommunityPostReplyApi = "/community/post/reply"
|
|
|
///// 评论&回复
|
|
|
public let kCommunityPostCommentApi = "/community/post/comment"
|
|
|
|
|
|
+//// MARK: - 用户上传音乐
|
|
|
+///// 用户上传音乐
|
|
|
+public let kCommunityUploadMusicApi = "/community/music/upload"
|
|
|
+
|
|
|
+//// MARK: - 热门推荐音乐列表
|
|
|
+///// 热门推荐音乐列表
|
|
|
+public let kCommunityRecMusicListApi = "/community/musicList"
|
|
|
+
|
|
|
+//// MARK: - 获取音乐分类
|
|
|
+///// 获取音乐分类
|
|
|
+public let kCommunityGetMusicCategoryApi = "/community/category/list"
|
|
|
+
|
|
|
+//// MARK: - 获取分类下所有音乐
|
|
|
+///// 获取分类下所有音乐
|
|
|
+public let kCommunityCateMusicListApi = "/community/music"
|
|
|
+
|
|
|
/// 社区
|
|
|
///
|
|
|
/// - communityTopicCategory: 话题组列表
|
|
@@ -106,6 +122,7 @@ public let kCommunityPostCommentApi = "/community/post/comment"
|
|
|
/// - communityPostComments : 评论列表
|
|
|
/// - communityPostReply : 回复列表
|
|
|
/// - communityPostComment : 评论&回复
|
|
|
+/// - communityUploadMusic : 用户上传音乐
|
|
|
|
|
|
public enum SwiftMoyaServiceCommunityApi {
|
|
|
case communityTopicCategory(parameters:Dictionary<String, Any>)
|
|
@@ -127,6 +144,7 @@ public enum SwiftMoyaServiceCommunityApi {
|
|
|
case communityPostComments(parameters:Dictionary<String, Any>)
|
|
|
case communityPostReply(parameters:Dictionary<String, Any>)
|
|
|
case communityPostComment(parameters:Dictionary<String, Any>)
|
|
|
+ case communityUploadMusic(parameters:Dictionary<String, Any>)
|
|
|
}
|
|
|
|
|
|
extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
@@ -151,7 +169,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostDetail,
|
|
|
.communityPostComments,
|
|
|
.communityPostReply,
|
|
|
- .communityPostComment
|
|
|
+ .communityPostComment,
|
|
|
+ .communityUploadMusic
|
|
|
:
|
|
|
return URL(string: kApiDataPrefix())!
|
|
|
}
|
|
@@ -197,6 +216,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
return kCommunityPostReplyApi
|
|
|
case .communityPostComment:
|
|
|
return kCommunityPostCommentApi
|
|
|
+ case .communityUploadMusic:
|
|
|
+ return kCommunityUploadMusicApi
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -205,7 +226,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
case .communityMemberFollowTopic,
|
|
|
.communityPublish,
|
|
|
.communityMemberFollowTopicFollow,
|
|
|
- .communityPostComment
|
|
|
+ .communityPostComment,
|
|
|
+ .communityUploadMusic
|
|
|
:
|
|
|
return .post
|
|
|
case .communityTopicCategory,
|
|
@@ -252,7 +274,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostDetail(var parameters),
|
|
|
.communityPostComments(var parameters),
|
|
|
.communityPostReply(var parameters),
|
|
|
- .communityPostComment(var parameters)
|
|
|
+ .communityPostComment(var parameters),
|
|
|
+ .communityUploadMusic(var parameters)
|
|
|
:
|
|
|
let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
|
|
|
parameters.updateValue(sign, forKey: "sign")
|
|
@@ -293,7 +316,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostDetail,
|
|
|
.communityPostComments,
|
|
|
.communityPostReply,
|
|
|
- .communityPostComment
|
|
|
+ .communityPostComment,
|
|
|
+ .communityUploadMusic
|
|
|
:
|
|
|
return (headerParameters(headerType: .tokenHeader) as! [String : String])
|
|
|
}
|