feat(creator): 라이브 탭 API 계약을 추가한다
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.common.data
|
||||||
|
|
||||||
|
enum class ContentSort {
|
||||||
|
LATEST,
|
||||||
|
POPULAR,
|
||||||
|
OWNED,
|
||||||
|
PRICE_HIGH,
|
||||||
|
PRICE_LOW
|
||||||
|
}
|
||||||
@@ -2,9 +2,12 @@ package kr.co.vividnext.sodalive.v2.creator.channel.data
|
|||||||
|
|
||||||
import io.reactivex.rxjava3.core.Single
|
import io.reactivex.rxjava3.core.Single
|
||||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||||
|
import kr.co.vividnext.sodalive.v2.common.data.ContentSort
|
||||||
|
import kr.co.vividnext.sodalive.v2.creator.channel.live.data.CreatorChannelLiveTabResponse
|
||||||
import retrofit2.http.GET
|
import retrofit2.http.GET
|
||||||
import retrofit2.http.Header
|
import retrofit2.http.Header
|
||||||
import retrofit2.http.Path
|
import retrofit2.http.Path
|
||||||
|
import retrofit2.http.Query
|
||||||
|
|
||||||
interface CreatorChannelApi {
|
interface CreatorChannelApi {
|
||||||
@GET("/api/v2/creator-channels/{creatorId}/home")
|
@GET("/api/v2/creator-channels/{creatorId}/home")
|
||||||
@@ -12,4 +15,13 @@ interface CreatorChannelApi {
|
|||||||
@Path("creatorId") creatorId: Long,
|
@Path("creatorId") creatorId: Long,
|
||||||
@Header("Authorization") authHeader: String
|
@Header("Authorization") authHeader: String
|
||||||
): Single<ApiResponse<CreatorChannelHomeResponse>>
|
): Single<ApiResponse<CreatorChannelHomeResponse>>
|
||||||
|
|
||||||
|
@GET("/api/v2/creator-channels/{creatorId}/live")
|
||||||
|
fun getLive(
|
||||||
|
@Path("creatorId") creatorId: Long,
|
||||||
|
@Query("page") page: Int,
|
||||||
|
@Query("size") size: Int,
|
||||||
|
@Query("sort") sort: ContentSort,
|
||||||
|
@Header("Authorization") authHeader: String
|
||||||
|
): Single<ApiResponse<CreatorChannelLiveTabResponse>>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,10 @@ data class CreatorChannelAudioContentResponse(
|
|||||||
@SerializedName("isPointAvailable") val isPointAvailable: Boolean,
|
@SerializedName("isPointAvailable") val isPointAvailable: Boolean,
|
||||||
@SerializedName("isFirstContent") val isFirstContent: Boolean,
|
@SerializedName("isFirstContent") val isFirstContent: Boolean,
|
||||||
@SerializedName("seriesName") val seriesName: String?,
|
@SerializedName("seriesName") val seriesName: String?,
|
||||||
@SerializedName("isOriginalSeries") val isOriginalSeries: Boolean?
|
@SerializedName("isOriginalSeries") val isOriginalSeries: Boolean?,
|
||||||
|
@SerializedName("isAdult") val isAdult: Boolean = false,
|
||||||
|
@SerializedName("isOwned") val isOwned: Boolean = false,
|
||||||
|
@SerializedName("isRented") val isRented: Boolean = false
|
||||||
)
|
)
|
||||||
|
|
||||||
@Keep
|
@Keep
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import kr.co.vividnext.sodalive.report.ReportRepository
|
|||||||
import kr.co.vividnext.sodalive.report.ReportRequest
|
import kr.co.vividnext.sodalive.report.ReportRequest
|
||||||
import kr.co.vividnext.sodalive.report.ReportType
|
import kr.co.vividnext.sodalive.report.ReportType
|
||||||
import kr.co.vividnext.sodalive.user.UserRepository
|
import kr.co.vividnext.sodalive.user.UserRepository
|
||||||
|
import kr.co.vividnext.sodalive.v2.common.data.ContentSort
|
||||||
|
|
||||||
class CreatorChannelRepository(
|
class CreatorChannelRepository(
|
||||||
private val api: CreatorChannelApi,
|
private val api: CreatorChannelApi,
|
||||||
@@ -21,6 +22,20 @@ class CreatorChannelRepository(
|
|||||||
authHeader = token
|
authHeader = token
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun getLive(
|
||||||
|
creatorId: Long,
|
||||||
|
page: Int,
|
||||||
|
size: Int,
|
||||||
|
sort: ContentSort,
|
||||||
|
token: String
|
||||||
|
) = api.getLive(
|
||||||
|
creatorId = creatorId,
|
||||||
|
page = page,
|
||||||
|
size = size,
|
||||||
|
sort = sort,
|
||||||
|
authHeader = token
|
||||||
|
)
|
||||||
|
|
||||||
fun followCreator(
|
fun followCreator(
|
||||||
creatorId: Long,
|
creatorId: Long,
|
||||||
follow: Boolean,
|
follow: Boolean,
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.creator.channel.live.data
|
||||||
|
|
||||||
|
import androidx.annotation.Keep
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import kr.co.vividnext.sodalive.v2.common.data.ContentSort
|
||||||
|
import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelAudioContentResponse
|
||||||
|
import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelLiveResponse
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class CreatorChannelLiveTabResponse(
|
||||||
|
@SerializedName("liveReplayContentCount") val liveReplayContentCount: Int,
|
||||||
|
@SerializedName("currentLive") val currentLive: CreatorChannelLiveResponse?,
|
||||||
|
@SerializedName("liveReplayContents") val liveReplayContents: List<CreatorChannelAudioContentResponse>,
|
||||||
|
@SerializedName("sort") val sort: ContentSort,
|
||||||
|
@SerializedName("page") val page: Int,
|
||||||
|
@SerializedName("size") val size: Int,
|
||||||
|
@SerializedName("hasNext") val hasNext: Boolean
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user