커뮤니티 수정 UI, API 추가

This commit is contained in:
Yu Sung
2023-12-21 21:04:08 +09:00
parent f40642f90f
commit 7bd32f8486
12 changed files with 474 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ enum CreatorCommunityApi {
case createCommunityPost(parameters: [MultipartFormData])
case modifyCommunityPost(parameters: [MultipartFormData])
case getCommunityPostList(creatorId: Int, page: Int, size: Int)
case getCommunityPostDetail(postId: Int)
case communityPostLike(postId: Int)
case createCommunityPostComment(comment: String, postId: Int, parentId: Int?)
case getCommunityPostCommentList(postId: Int, page: Int, size: Int)
@@ -40,6 +41,9 @@ extension CreatorCommunityApi: TargetType {
case .getCommentReplyList(let commentId, _, _):
return "/creator-community/comment/\(commentId)"
case .getCommunityPostDetail(let postId):
return "/creator-community/\(postId)"
}
}
@@ -48,7 +52,7 @@ extension CreatorCommunityApi: TargetType {
case .createCommunityPost, .communityPostLike, .createCommunityPostComment:
return .post
case .getCommunityPostList, .getCommunityPostCommentList, .getCommentReplyList:
case .getCommunityPostList, .getCommunityPostCommentList, .getCommentReplyList, .getCommunityPostDetail:
return .get
case .modifyComment, .modifyCommunityPost:
@@ -99,7 +103,10 @@ extension CreatorCommunityApi: TargetType {
case .modifyComment(let request):
return .requestJSONEncodable(request)
case .getCommunityPostDetail:
let parameters = ["timezone": TimeZone.current.identifier] as [String: Any]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
}
}