|
@@ -84,7 +84,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
/// - name: 关键字
|
|
|
/// - page: 分页
|
|
|
/// - completion: 回调
|
|
|
- func communityTopicsApi(categoryId:Int = 0, isSuggest:Int = 0,name:String = "",page:Int = 1,completion: @escaping successCallBack) {
|
|
|
+ func communityTopicsApi(categoryId:Int = 0, isSuggest:Int = 0,name:String = "",page:Int = 1,completion: @escaping successCallBack,fail: @escaping failCallback) {
|
|
|
var parameters = Dictionary<String,Any>()
|
|
|
parameters.updateValue(isSuggest, forKey: "is_suggest")
|
|
|
parameters.updateValue(categoryId, forKey: "category_id")
|
|
@@ -97,6 +97,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
}
|
|
|
SwiftMoyaNetWorkManager.shared.failCallback = {
|
|
|
(loadingStatus) in
|
|
|
+ fail(loadingStatus)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -107,7 +108,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
/// - keyword: 关键字搜索:标题,内容
|
|
|
/// - page: 分页
|
|
|
/// - completion: 回调
|
|
|
- func communityPostsApi(keyword:String = "",topicIds : String = "",page:Int = 1,completion: @escaping successCallBack) {
|
|
|
+ func communityPostsApi(keyword:String = "",topicIds : String = "",page:Int = 1,completion: @escaping successCallBack,fail: @escaping failCallback) {
|
|
|
var parameters = Dictionary<String,Any>()
|
|
|
parameters.updateValue(keyword, forKey: "keyword")
|
|
|
parameters.updateValue(topicIds, forKey: "topic_ids")
|
|
@@ -119,6 +120,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
}
|
|
|
SwiftMoyaNetWorkManager.shared.failCallback = {
|
|
|
(loadingStatus) in
|
|
|
+ fail(loadingStatus)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -326,7 +328,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
/// - Parameters:
|
|
|
/// - page: 多关注页面feed流
|
|
|
/// - completion: 回调
|
|
|
- func communityFollowFeedApi(page:Int = 1,completion: @escaping successCallBack) {
|
|
|
+ func communityFollowFeedApi(page:Int = 1,completion: @escaping successCallBack,fail: @escaping failCallback) {
|
|
|
var parameters = Dictionary<String,Any>()
|
|
|
parameters.updateValue(page, forKey: "page")
|
|
|
SwiftMoyaNetWorkManager.shared.requestObject(CommunityFollowFeedModel.self, target: MultiTarget(SwiftMoyaServiceCommunityApi.communityFollowFeed(parameters: parameters))) { (communityFollowFeedModel) in
|
|
@@ -335,6 +337,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
}
|
|
|
SwiftMoyaNetWorkManager.shared.failCallback = {
|
|
|
(loadingStatus) in
|
|
|
+ fail(loadingStatus)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -345,7 +348,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
/// - Parameters:
|
|
|
/// - page: 多关注页面feed流
|
|
|
/// - completion: completion description
|
|
|
- func communityPostSuggestApi(page:Int = 1,completion: @escaping successCallBack) {
|
|
|
+ func communityPostSuggestApi(page:Int = 1,completion: @escaping successCallBack,fail:@escaping failCallback) {
|
|
|
var parameters = Dictionary<String,Any>()
|
|
|
parameters.updateValue(page, forKey: "page")
|
|
|
|
|
@@ -355,6 +358,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
}
|
|
|
SwiftMoyaNetWorkManager.shared.failCallback = {
|
|
|
(loadingStatus) in
|
|
|
+ fail(loadingStatus)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -485,7 +489,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
/// - postId: 内容id
|
|
|
/// - page: 分页
|
|
|
/// - completion: 回调
|
|
|
- func communityPostCommentsApi(postId:Int,page:Int = 1,completion: @escaping successCallBack) {
|
|
|
+ func communityPostCommentsApi(postId:Int,page:Int = 1,completion: @escaping successCallBack,fail: @escaping failCallback) {
|
|
|
var parameters = Dictionary<String,Any>()
|
|
|
parameters.updateValue(postId, forKey: "post_id")
|
|
|
parameters.updateValue(page, forKey: "page")
|
|
@@ -497,6 +501,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
}
|
|
|
SwiftMoyaNetWorkManager.shared.failCallback = {
|
|
|
(loadingStatus) in
|
|
|
+ fail(loadingStatus)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -507,7 +512,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
/// - postId: 内容id
|
|
|
/// - page: 分页
|
|
|
/// - completion: 回调
|
|
|
- func communityPostReplyApi(postId:Int,page:Int = 1,completion: @escaping successCallBack) {
|
|
|
+ func communityPostReplyApi(postId:Int,page:Int = 1,completion: @escaping successCallBack,fail: @escaping failCallback) {
|
|
|
var parameters = Dictionary<String,Any>()
|
|
|
parameters.updateValue(postId, forKey: "id")
|
|
|
parameters.updateValue(page, forKey: "page")
|
|
@@ -518,6 +523,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
|
|
|
}
|
|
|
SwiftMoyaNetWorkManager.shared.failCallback = {
|
|
|
(loadingStatus) in
|
|
|
+ fail(loadingStatus)
|
|
|
}
|
|
|
}
|
|
|
|