feat(creator): 커뮤니티 게시글 상세를 연결한다

This commit is contained in:
Yu Sung
2026-07-08 01:56:57 +09:00
parent f2d589eca2
commit c0369e6f58
23 changed files with 2187 additions and 138 deletions

View File

@@ -0,0 +1,70 @@
import Foundation
struct CreatorChannelCommunityPostDetailResponse: Decodable, Identifiable {
let postId: Int
let creatorId: Int
let creatorNickname: String
let creatorProfileUrl: String
let createdAtUtc: String
let content: String
let imageUrl: String?
let audioUrl: String?
let price: Int
let isCommentAvailable: Bool
let existOrdered: Bool
let likeCount: Int
let commentCount: Int
let isPinned: Bool
let isLiked: Bool
let comments: CreatorChannelCommunityCommentsResponse
var id: Int { postId }
func relativeTimeText(now: Date = Date()) -> String {
DateParser.relativeTimeText(fromUTC: createdAtUtc, fallback: createdAtUtc, now: now)
}
}
struct CreatorChannelCommunityCommentsResponse: Decodable {
let commentCount: Int
let comments: [CreatorChannelCommunityCommentResponse]
let page: Int
let size: Int
let hasNext: Bool
}
struct CreatorChannelCommunityCommentResponse: Decodable {
let commentId: Int
let writerId: Int
let writerProfileImageUrl: String
let writerNickname: String
let content: String
let createdAtUtc: String
let isSecret: Bool
let latestReply: CreatorChannelCommunityReplyResponse?
func relativeTimeText(now: Date = Date()) -> String {
DateParser.relativeTimeText(fromUTC: createdAtUtc, fallback: createdAtUtc, now: now)
}
}
struct CreatorChannelCommunityReplyResponse: Decodable {
let commentId: Int
let writerId: Int
let writerProfileImageUrl: String
let writerNickname: String
let content: String
let createdAtUtc: String
func relativeTimeText(now: Date = Date()) -> String {
DateParser.relativeTimeText(fromUTC: createdAtUtc, fallback: createdAtUtc, now: now)
}
}
struct CreatorChannelCommunityRepliesResponse: Decodable {
let replyCount: Int
let replies: [CreatorChannelCommunityReplyResponse]
let page: Int
let size: Int
let hasNext: Bool
}