feat(creator): FanTalk 탭 API 계약을 추가한다
This commit is contained in:
@@ -5,6 +5,7 @@ import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
import kr.co.vividnext.sodalive.v2.common.data.ContentSort
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.audio.data.CreatorChannelAudioTabResponse
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.community.data.CreatorChannelCommunityTabResponse
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.fantalk.data.CreatorChannelFanTalkTabResponse
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.live.data.CreatorChannelLiveTabResponse
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.series.data.CreatorChannelSeriesTabResponse
|
||||
import retrofit2.http.GET
|
||||
@@ -54,4 +55,12 @@ interface CreatorChannelApi {
|
||||
@Query("size") size: Int,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<CreatorChannelCommunityTabResponse>>
|
||||
|
||||
@GET("/api/v2/creator-channels/{creatorId}/fan-talks")
|
||||
fun getFanTalks(
|
||||
@Path("creatorId") creatorId: Long,
|
||||
@Query("page") page: Int,
|
||||
@Query("size") size: Int,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<CreatorChannelFanTalkTabResponse>>
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import kr.co.vividnext.sodalive.chat.talk.TalkApi
|
||||
import kr.co.vividnext.sodalive.chat.talk.room.CreateChatRoomRequest
|
||||
import kr.co.vividnext.sodalive.explorer.ExplorerRepository
|
||||
import kr.co.vividnext.sodalive.explorer.profile.channel_donation.PostChannelDonationRequest
|
||||
import kr.co.vividnext.sodalive.explorer.profile.cheers.PutModifyCheersRequest
|
||||
import kr.co.vividnext.sodalive.report.ReportRepository
|
||||
import kr.co.vividnext.sodalive.report.ReportRequest
|
||||
import kr.co.vividnext.sodalive.report.ReportType
|
||||
@@ -78,6 +79,18 @@ class CreatorChannelRepository(
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
fun getFanTalks(
|
||||
creatorId: Long,
|
||||
page: Int,
|
||||
size: Int,
|
||||
token: String
|
||||
) = api.getFanTalks(
|
||||
creatorId = creatorId,
|
||||
page = page,
|
||||
size = size,
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
fun followCreator(
|
||||
creatorId: Long,
|
||||
follow: Boolean,
|
||||
@@ -125,4 +138,14 @@ class CreatorChannelRepository(
|
||||
request = ReportRequest(ReportType.PROFILE, reason, reportedMemberId = userId),
|
||||
token = token
|
||||
)
|
||||
|
||||
fun reportFanTalk(fanTalkId: Long, reason: String, token: String) = reportRepository.report(
|
||||
request = ReportRequest(ReportType.CHEERS, reason, cheersId = fanTalkId),
|
||||
token = token
|
||||
)
|
||||
|
||||
fun deleteFanTalk(fanTalkId: Long, token: String) = explorerRepository.modifyCheers(
|
||||
request = PutModifyCheersRequest(cheersId = fanTalkId, isActive = false),
|
||||
token = token
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package kr.co.vividnext.sodalive.v2.creator.channel.fantalk.data
|
||||
|
||||
import androidx.annotation.Keep
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Keep
|
||||
data class CreatorChannelFanTalkTabResponse(
|
||||
@SerializedName("fanTalkCount") val fanTalkCount: Int,
|
||||
@SerializedName("fanTalks") val fanTalks: List<CreatorChannelFanTalkResponse>,
|
||||
@SerializedName("page") val page: Int,
|
||||
@SerializedName("size") val size: Int,
|
||||
@SerializedName("hasNext") val hasNext: Boolean
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class CreatorChannelFanTalkResponse(
|
||||
@SerializedName("fanTalkId") val fanTalkId: Long,
|
||||
@SerializedName("writerId") val writerId: Long,
|
||||
@SerializedName("writerNickname") val writerNickname: String,
|
||||
@SerializedName("writerProfileImageUrl") val writerProfileImageUrl: String,
|
||||
@SerializedName("content") val content: String,
|
||||
@SerializedName("createdAtUtc") val createdAtUtc: String,
|
||||
@SerializedName("creatorReplies") val creatorReplies: List<CreatorChannelFanTalkReplyResponse>
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class CreatorChannelFanTalkReplyResponse(
|
||||
@SerializedName("fanTalkId") val fanTalkId: Long,
|
||||
@SerializedName("writerId") val writerId: Long,
|
||||
@SerializedName("writerNickname") val writerNickname: String,
|
||||
@SerializedName("writerProfileImageUrl") val writerProfileImageUrl: String,
|
||||
@SerializedName("content") val content: String,
|
||||
@SerializedName("createdAtUtc") val createdAtUtc: String
|
||||
)
|
||||
Reference in New Issue
Block a user