|
@@ -26,9 +26,13 @@ public let kCommunityPostMyApi = "/community/post/my"
|
|
|
public let kCommunityTopicsApi = "/community/topic"
|
|
|
|
|
|
// MARK: - 内容列表
|
|
|
-/// 内容列表
|
|
|
+/// 内容列表(Get)
|
|
|
public let kCommunityPostsApi = "/community/post"
|
|
|
|
|
|
+// MARK: - 发布内容
|
|
|
+/// 发布内容(Post)
|
|
|
+public let kCommunityPublishApi = "/community/post"
|
|
|
+
|
|
|
// MARK: - 关注页面feed流
|
|
|
/// 关注页面feed流
|
|
|
public let kCommunityFollowFeedApi = "/community/feed"
|
|
@@ -45,6 +49,7 @@ public let kCommunityPostSuggestApi = "/community/post/suggest"
|
|
|
/// - communityPostMy: 个人中心内容
|
|
|
/// - communityTopics: 话题列表
|
|
|
/// - communityPosts: 内容列表
|
|
|
+/// - communityPublish: 发布内容
|
|
|
/// - communityFeed: 关注页面feed流
|
|
|
/// - communityPostSuggest: 关注页面feed流
|
|
|
public enum SwiftMoyaServiceCommunityApi {
|
|
@@ -53,6 +58,7 @@ public enum SwiftMoyaServiceCommunityApi {
|
|
|
case communityPostMy(parameters:Dictionary<String, Any>)
|
|
|
case communityTopics(parameters:Dictionary<String, Any>)
|
|
|
case communityPosts(parameters:Dictionary<String, Any>)
|
|
|
+ case communityPublish(parameters:Dictionary<String, Any>)
|
|
|
case communityFollowFeed(parameters:Dictionary<String, Any>)
|
|
|
case communityPostSuggest(parameters:Dictionary<String, Any>)
|
|
|
}
|
|
@@ -66,6 +72,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostMy,
|
|
|
.communityTopics,
|
|
|
.communityPosts,
|
|
|
+ .communityPublish,
|
|
|
.communityFollowFeed,
|
|
|
.communityPostSuggest
|
|
|
:
|
|
@@ -85,6 +92,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
return kCommunityTopicsApi
|
|
|
case .communityPosts:
|
|
|
return kCommunityPostsApi
|
|
|
+ case .communityPublish:
|
|
|
+ return kCommunityPublishApi
|
|
|
case .communityFollowFeed:
|
|
|
return kCommunityFollowFeedApi
|
|
|
case .communityPostSuggest:
|
|
@@ -94,7 +103,8 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
|
|
|
public var method: Moya.Method {
|
|
|
switch self {
|
|
|
- case .communityMemberFollowTopic
|
|
|
+ case .communityMemberFollowTopic,
|
|
|
+ .communityPublish
|
|
|
:
|
|
|
return .post
|
|
|
case .communityTopicCategory,
|
|
@@ -105,7 +115,6 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostSuggest
|
|
|
:
|
|
|
return .get
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -117,6 +126,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostMy(var parameters),
|
|
|
.communityTopics(var parameters),
|
|
|
.communityPosts(var parameters),
|
|
|
+ .communityPublish(var parameters),
|
|
|
.communityFollowFeed(var parameters),
|
|
|
.communityPostSuggest(var parameters)
|
|
|
:
|
|
@@ -146,6 +156,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
|
|
|
.communityPostMy,
|
|
|
.communityTopics,
|
|
|
.communityPosts,
|
|
|
+ .communityPublish,
|
|
|
.communityFollowFeed,
|
|
|
.communityPostSuggest
|
|
|
:
|