diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/data/CreatorChannelCommunityTabResponse.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/data/CreatorChannelCommunityTabResponse.kt new file mode 100644 index 00000000..371cc55c --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/community/data/CreatorChannelCommunityTabResponse.kt @@ -0,0 +1,31 @@ +package kr.co.vividnext.sodalive.v2.creator.channel.community.data + +import androidx.annotation.Keep +import com.google.gson.annotations.SerializedName + +@Keep +data class CreatorChannelCommunityTabResponse( + @SerializedName("communityPostCount") val communityPostCount: Int, + @SerializedName("communityPosts") val communityPosts: List, + @SerializedName("page") val page: Int, + @SerializedName("size") val size: Int, + @SerializedName("hasNext") val hasNext: Boolean +) + +@Keep +data class CreatorChannelCommunityPostResponse( + @SerializedName("postId") val postId: Long, + @SerializedName("creatorId") val creatorId: Long, + @SerializedName("creatorNickname") val creatorNickname: String, + @SerializedName("creatorProfileUrl") val creatorProfileUrl: String, + @SerializedName("createdAtUtc") val createdAtUtc: String, + @SerializedName("content") val content: String, + @SerializedName("imageUrl") val imageUrl: String?, + @SerializedName("audioUrl") val audioUrl: String?, + @SerializedName("price") val price: Int, + @SerializedName("existOrdered") val existOrdered: Boolean, + @SerializedName("isCommentAvailable") val isCommentAvailable: Boolean, + @SerializedName("likeCount") val likeCount: Int, + @SerializedName("commentCount") val commentCount: Int, + @SerializedName("isPinned") val isPinned: Boolean +) 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 f28be282..453adaf6 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 @@ -4,6 +4,7 @@ import io.reactivex.rxjava3.core.Single 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.live.data.CreatorChannelLiveTabResponse import kr.co.vividnext.sodalive.v2.creator.channel.series.data.CreatorChannelSeriesTabResponse import retrofit2.http.GET @@ -45,4 +46,12 @@ interface CreatorChannelApi { @Query("sort") sort: ContentSort, @Header("Authorization") authHeader: String ): Single> + + @GET("/api/v2/creator-channels/{creatorId}/community") + fun getCommunity( + @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 bca71aec..eb469291 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 @@ -66,6 +66,18 @@ class CreatorChannelRepository( authHeader = token ) + fun getCommunity( + creatorId: Long, + page: Int, + size: Int, + token: String + ) = api.getCommunity( + creatorId = creatorId, + page = page, + size = size, + authHeader = token + ) + fun followCreator( creatorId: Long, follow: Boolean,