커뮤니티 유료 게시글 조회, 구매 기능 추가

This commit is contained in:
Yu Sung
2024-05-24 16:19:43 +09:00
parent 0a96509b35
commit 3ae5ea776c
13 changed files with 337 additions and 63 deletions

View File

@@ -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))
}
}