메인 라이브 탭 - 커뮤니티 포스트 영역 추가
This commit is contained in:
@@ -120,6 +120,7 @@ struct CreatorCommunityAllItemView_Previews: PreviewProvider {
|
||||
CreatorCommunityAllItemView(
|
||||
item: GetCommunityPostListResponse(
|
||||
postId: 1,
|
||||
creatorId: 1,
|
||||
creatorNickname: "민하나",
|
||||
creatorProfileUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
||||
imageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
||||
|
@@ -18,6 +18,7 @@ enum CreatorCommunityApi {
|
||||
case getCommunityPostCommentList(postId: Int, page: Int, size: Int)
|
||||
case getCommentReplyList(commentId: Int, page: Int, size: Int)
|
||||
case modifyComment(request: ModifyCommunityPostCommentRequest)
|
||||
case getLatestPostListFromCreatorsYouFollow
|
||||
}
|
||||
|
||||
extension CreatorCommunityApi: TargetType {
|
||||
@@ -44,6 +45,9 @@ extension CreatorCommunityApi: TargetType {
|
||||
|
||||
case .getCommunityPostDetail(let postId):
|
||||
return "/creator-community/\(postId)"
|
||||
|
||||
case .getLatestPostListFromCreatorsYouFollow:
|
||||
return "/creator-community/latest"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +56,7 @@ extension CreatorCommunityApi: TargetType {
|
||||
case .createCommunityPost, .communityPostLike, .createCommunityPostComment:
|
||||
return .post
|
||||
|
||||
case .getCommunityPostList, .getCommunityPostCommentList, .getCommentReplyList, .getCommunityPostDetail:
|
||||
case .getCommunityPostList, .getCommunityPostCommentList, .getCommentReplyList, .getCommunityPostDetail, .getLatestPostListFromCreatorsYouFollow:
|
||||
return .get
|
||||
|
||||
case .modifyComment, .modifyCommunityPost:
|
||||
@@ -107,6 +111,10 @@ extension CreatorCommunityApi: TargetType {
|
||||
case .getCommunityPostDetail:
|
||||
let parameters = ["timezone": TimeZone.current.identifier] as [String: Any]
|
||||
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
|
||||
|
||||
case .getLatestPostListFromCreatorsYouFollow:
|
||||
let parameters = ["timezone": TimeZone.current.identifier] as [String: Any]
|
||||
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -86,6 +86,7 @@ struct CreatorCommunityItemView_Previews: PreviewProvider {
|
||||
CreatorCommunityItemView(
|
||||
item: GetCommunityPostListResponse(
|
||||
postId: 1,
|
||||
creatorId: 1,
|
||||
creatorNickname: "민하나",
|
||||
creatorProfileUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
||||
imageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
||||
|
@@ -48,4 +48,8 @@ class CreatorCommunityRepository {
|
||||
func modifyComment(request: ModifyCommunityPostCommentRequest) -> AnyPublisher<Response, MoyaError> {
|
||||
return api.requestPublisher(.modifyComment(request: request))
|
||||
}
|
||||
|
||||
func getLatestPostListFromCreatorsYouFollow() -> AnyPublisher<Response, MoyaError> {
|
||||
return api.requestPublisher(.getLatestPostListFromCreatorsYouFollow)
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
struct GetCommunityPostListResponse: Decodable {
|
||||
let postId: Int
|
||||
let creatorId: Int
|
||||
let creatorNickname: String
|
||||
let creatorProfileUrl: String
|
||||
let imageUrl: String?
|
||||
|
Reference in New Issue
Block a user