feat(creator-channel): FanTalk 답글 API 응답을 연결한다
This commit is contained in:
@@ -13,6 +13,7 @@ import kr.co.vividnext.sodalive.explorer.profile.channel_donation.PostChannelDon
|
||||
import kr.co.vividnext.sodalive.explorer.profile.donation.GetDonationAllResponse
|
||||
import kr.co.vividnext.sodalive.explorer.profile.follow.GetFollowerListResponse
|
||||
import kr.co.vividnext.sodalive.live.room.detail.GetRoomDetailUser
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.fantalk.data.CreatorChannelFanTalkReplyResponse
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
@@ -73,13 +74,13 @@ interface ExplorerApi {
|
||||
fun writeCheers(
|
||||
@Body request: PostWriteCheersRequest,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<Any>>
|
||||
): Single<ApiResponse<CreatorChannelFanTalkReplyResponse>>
|
||||
|
||||
@PUT("/explorer/profile/cheers")
|
||||
fun modifyCheers(
|
||||
@Body request: PutModifyCheersRequest,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<Any>>
|
||||
): Single<ApiResponse<CreatorChannelFanTalkReplyResponse>>
|
||||
|
||||
@POST("/explorer/profile/channel-donation")
|
||||
fun postChannelDonation(
|
||||
|
||||
+17
@@ -196,4 +196,21 @@ class CreatorChannelRepository(
|
||||
content = content,
|
||||
token = token
|
||||
)
|
||||
|
||||
fun writeFanTalkReply(fanTalkId: Long, creatorId: Long, content: String, token: String) = explorerRepository.writeCheers(
|
||||
parentCheersId = fanTalkId,
|
||||
creatorId = creatorId,
|
||||
content = content,
|
||||
token = token
|
||||
)
|
||||
|
||||
fun modifyFanTalkReply(replyFanTalkId: Long, content: String, token: String) = explorerRepository.modifyCheers(
|
||||
request = PutModifyCheersRequest(cheersId = replyFanTalkId, content = content),
|
||||
token = token
|
||||
)
|
||||
|
||||
fun deleteFanTalkReply(replyFanTalkId: Long, token: String) = explorerRepository.modifyCheers(
|
||||
request = PutModifyCheersRequest(cheersId = replyFanTalkId, isActive = false),
|
||||
token = token
|
||||
)
|
||||
}
|
||||
|
||||
+13
-2
@@ -23,11 +23,22 @@ private fun CreatorChannelFanTalkResponse.toFanTalkUiModel(
|
||||
writerProfileImageUrl = writerProfileImageUrl,
|
||||
content = content,
|
||||
createdAtText = relativeTimeTextFormatter.format(createdAtUtc),
|
||||
reply = creatorReplies.firstOrNull()?.toReplyUiModel(relativeTimeTextFormatter),
|
||||
reply = creatorReplies.orEmpty().firstOrNull()?.toFanTalkReplyUiModel(relativeTimeTextFormatter),
|
||||
rightAction = toRightAction(isOwner = isOwner, currentUserId = currentUserId)
|
||||
)
|
||||
|
||||
private fun CreatorChannelFanTalkReplyResponse.toReplyUiModel(
|
||||
fun CreatorChannelFanTalkReplyResponse.toFanTalkReplyUiModel(
|
||||
relativeTimeTextFormatter: UtcRelativeTimeTextFormatter
|
||||
) = CreatorChannelFanTalkReplyUiModel(
|
||||
fanTalkId = fanTalkId,
|
||||
writerId = writerId,
|
||||
writerNickname = writerNickname,
|
||||
writerProfileImageUrl = writerProfileImageUrl,
|
||||
content = content,
|
||||
createdAtText = relativeTimeTextFormatter.format(createdAtUtc)
|
||||
)
|
||||
|
||||
fun CreatorChannelFanTalkResponse.toFanTalkReplyUiModel(
|
||||
relativeTimeTextFormatter: UtcRelativeTimeTextFormatter
|
||||
) = CreatorChannelFanTalkReplyUiModel(
|
||||
fanTalkId = fanTalkId,
|
||||
|
||||
Reference in New Issue
Block a user