커뮤니티 게시물 삭제 API 적용

This commit is contained in:
Yu Sung
2023-12-21 00:38:30 +09:00
parent 9f360e9fcd
commit f40642f90f
5 changed files with 99 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import Moya
enum CreatorCommunityApi {
case createCommunityPost(parameters: [MultipartFormData])
case modifyCommunityPost(parameters: [MultipartFormData])
case getCommunityPostList(creatorId: Int, page: Int, size: Int)
case communityPostLike(postId: Int)
case createCommunityPostComment(comment: String, postId: Int, parentId: Int?)
@@ -25,7 +26,7 @@ extension CreatorCommunityApi: TargetType {
var path: String {
switch self {
case .createCommunityPost, .getCommunityPostList:
case .createCommunityPost, .getCommunityPostList, .modifyCommunityPost:
return "/creator-community"
case .communityPostLike:
@@ -50,7 +51,7 @@ extension CreatorCommunityApi: TargetType {
case .getCommunityPostList, .getCommunityPostCommentList, .getCommentReplyList:
return .get
case .modifyComment:
case .modifyComment, .modifyCommunityPost:
return .put
}
}
@@ -60,6 +61,9 @@ extension CreatorCommunityApi: TargetType {
case .createCommunityPost(let parameters):
return .uploadMultipart(parameters)
case .modifyCommunityPost(let parameters):
return .uploadMultipart(parameters)
case .getCommunityPostList(let creatorId, let page, let size):
let parameters = [
"creatorId": creatorId,
@@ -95,6 +99,7 @@ extension CreatorCommunityApi: TargetType {
case .modifyComment(let request):
return .requestJSONEncodable(request)
}
}