diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelApi.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelApi.kt index 48eb2f89..d9c6c117 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelApi.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelApi.kt @@ -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.donation.data.CreatorChannelDonationTabResponse 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 @@ -63,4 +64,12 @@ interface CreatorChannelApi { @Query("size") size: Int, @Header("Authorization") authHeader: String ): Single> + + @GET("/api/v2/creator-channels/{creatorId}/donations") + fun getDonations( + @Path("creatorId") creatorId: Long, + @Query("page") page: Int, + @Query("size") size: Int, + @Header("Authorization") authHeader: String + ): Single> } diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelRepository.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelRepository.kt index 23332476..2c448a9a 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelRepository.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/data/CreatorChannelRepository.kt @@ -91,6 +91,18 @@ class CreatorChannelRepository( authHeader = token ) + fun getDonations( + creatorId: Long, + page: Int, + size: Int, + token: String + ) = api.getDonations( + creatorId = creatorId, + page = page, + size = size, + authHeader = token + ) + fun followCreator( creatorId: Long, follow: Boolean, diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/data/CreatorChannelDonationTabResponse.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/data/CreatorChannelDonationTabResponse.kt new file mode 100644 index 00000000..03b84eb7 --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/donation/data/CreatorChannelDonationTabResponse.kt @@ -0,0 +1,31 @@ +package kr.co.vividnext.sodalive.v2.creator.channel.donation.data + +import androidx.annotation.Keep +import com.google.gson.annotations.SerializedName + +@Keep +data class CreatorChannelDonationTabResponse( + @SerializedName("donationCount") val donationCount: Int, + @SerializedName("rankings") val rankings: List, + @SerializedName("donations") val donations: List, + @SerializedName("page") val page: Int, + @SerializedName("size") val size: Int, + @SerializedName("hasNext") val hasNext: Boolean +) + +@Keep +data class MemberDonationRankingResponse( + @SerializedName("userId") val userId: Long, + @SerializedName("nickname") val nickname: String, + @SerializedName("profileImage") val profileImage: String, + @SerializedName("donationCan") val donationCan: Int +) + +@Keep +data class CreatorChannelDonationResponse( + @SerializedName("nickname") val nickname: String, + @SerializedName("profileImageUrl") val profileImageUrl: String, + @SerializedName("can") val can: Int, + @SerializedName("message") val message: String, + @SerializedName("createdAtUtc") val createdAtUtc: String +)