커뮤니티 유료 게시글 조회, 구매 기능 추가
This commit is contained in:
@@ -19,6 +19,7 @@ enum CreatorCommunityApi {
|
||||
case getCommentReplyList(commentId: Int, page: Int, size: Int)
|
||||
case modifyComment(request: ModifyCommunityPostCommentRequest)
|
||||
case getLatestPostListFromCreatorsYouFollow
|
||||
case purchaseCommunityPost(postId: Int)
|
||||
}
|
||||
|
||||
extension CreatorCommunityApi: TargetType {
|
||||
@@ -48,12 +49,15 @@ extension CreatorCommunityApi: TargetType {
|
||||
|
||||
case .getLatestPostListFromCreatorsYouFollow:
|
||||
return "/creator-community/latest"
|
||||
|
||||
case .purchaseCommunityPost:
|
||||
return "/creator-community/purchase"
|
||||
}
|
||||
}
|
||||
|
||||
var method: Moya.Method {
|
||||
switch self {
|
||||
case .createCommunityPost, .communityPostLike, .createCommunityPostComment:
|
||||
case .createCommunityPost, .communityPostLike, .createCommunityPostComment, .purchaseCommunityPost:
|
||||
return .post
|
||||
|
||||
case .getCommunityPostList, .getCommunityPostCommentList, .getCommentReplyList, .getCommunityPostDetail, .getLatestPostListFromCreatorsYouFollow:
|
||||
@@ -115,6 +119,9 @@ extension CreatorCommunityApi: TargetType {
|
||||
case .getLatestPostListFromCreatorsYouFollow:
|
||||
let parameters = ["timezone": TimeZone.current.identifier] as [String: Any]
|
||||
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
|
||||
|
||||
case .purchaseCommunityPost(let postId):
|
||||
return .requestJSONEncodable(PurchasePostRequest(postId: postId))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user