feat(explorer): 크리에이터 상세정보 다이얼로그와 SNS 링크를 추가한다

This commit is contained in:
Yu Sung
2026-02-25 16:28:48 +09:00
parent 7ff9360b1e
commit e9bd1e7396
18 changed files with 449 additions and 7 deletions

View File

@@ -35,6 +35,8 @@ final class UserProfileViewModel: ObservableObject {
@Published var navigationTitle = "채널"
@Published private(set) var creatorProfile: GetCreatorProfileResponse?
@Published private(set) var creatorDetail: GetCreatorDetailResponse?
@Published var isCreatorDetailLoading = false
@Published private(set) var communityPostList = [GetCommunityPostListResponse]()
@Published var isShowShareView = false
@@ -97,6 +99,47 @@ final class UserProfileViewModel: ObservableObject {
}
.store(in: &subscription)
}
func getCreatorDetail(userId: Int) {
creatorDetail = nil
isCreatorDetailLoading = true
repository.getCreatorDetail(id: userId)
.sink { [weak self] result in
switch result {
case .finished:
DEBUG_LOG("finish")
case .failure(let error):
ERROR_LOG(error.localizedDescription)
self?.isCreatorDetailLoading = false
}
} receiveValue: { [unowned self] response in
let responseData = response.data
do {
let jsonDecoder = JSONDecoder()
let decoded = try jsonDecoder.decode(ApiResponse<GetCreatorDetailResponse>.self, from: responseData)
if let data = decoded.data, decoded.success {
self.creatorDetail = data
} else {
if let message = decoded.message {
self.errorMessage = message
} else {
self.errorMessage = I18n.Common.commonError
}
self.isShowPopup = true
}
} catch {
self.errorMessage = I18n.Common.commonError
self.isShowPopup = true
}
self.isCreatorDetailLoading = false
}
.store(in: &subscription)
}
func hidePaymentPopup() {
isShowPaymentDialog = false