feat(content): 전체 탭 API 계약을 추가한다
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.content.data
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Single
|
||||||
|
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||||
|
import kr.co.vividnext.sodalive.home.SeriesPublishedDaysOfWeek
|
||||||
|
import kr.co.vividnext.sodalive.v2.common.data.ContentSort
|
||||||
|
import retrofit2.http.GET
|
||||||
|
import retrofit2.http.Header
|
||||||
|
import retrofit2.http.Query
|
||||||
|
|
||||||
|
interface MainContentAllTabApi {
|
||||||
|
@GET("/api/v2/audio/contents")
|
||||||
|
fun getContents(
|
||||||
|
@Header("Authorization") authHeader: String,
|
||||||
|
@Query("type") type: MainContentAllType,
|
||||||
|
@Query("sort") sort: ContentSort,
|
||||||
|
@Query("page") page: Int,
|
||||||
|
@Query("size") size: Int,
|
||||||
|
@Query("dayOfWeek") dayOfWeek: SeriesPublishedDaysOfWeek?
|
||||||
|
): Single<ApiResponse<MainContentAllTabResponse>>
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.content.data
|
||||||
|
|
||||||
|
import androidx.annotation.Keep
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import kr.co.vividnext.sodalive.home.SeriesPublishedDaysOfWeek
|
||||||
|
import kr.co.vividnext.sodalive.v2.common.data.ContentSort
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class MainContentAllTabResponse(
|
||||||
|
@SerializedName("type") val type: MainContentAllType,
|
||||||
|
@SerializedName("totalCount") val totalCount: Int,
|
||||||
|
@SerializedName("audios") val audios: List<MainContentAudioResponse>,
|
||||||
|
@SerializedName("series") val series: List<MainContentSeriesResponse>,
|
||||||
|
@SerializedName("sort") val sort: ContentSort,
|
||||||
|
@SerializedName("dayOfWeek") val dayOfWeek: SeriesPublishedDaysOfWeek?,
|
||||||
|
@SerializedName("page") val page: Int,
|
||||||
|
@SerializedName("size") val size: Int,
|
||||||
|
@SerializedName("hasNext") val hasNext: Boolean
|
||||||
|
)
|
||||||
|
|
||||||
|
enum class MainContentAllType {
|
||||||
|
AUDIO,
|
||||||
|
SERIES,
|
||||||
|
ORIGINAL,
|
||||||
|
FREE,
|
||||||
|
POINT
|
||||||
|
}
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class MainContentAudioResponse(
|
||||||
|
@SerializedName("audioContentId") val audioContentId: Long,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("imageUrl") val imageUrl: String?,
|
||||||
|
@SerializedName("price") val price: Int,
|
||||||
|
@SerializedName("isAdult") val isAdult: Boolean,
|
||||||
|
@SerializedName("isPointAvailable") val isPointAvailable: Boolean,
|
||||||
|
@SerializedName("isFirstContent") val isFirstContent: Boolean,
|
||||||
|
@SerializedName("isOriginalSeries") val isOriginalSeries: Boolean,
|
||||||
|
@SerializedName("creatorNickname") val creatorNickname: String
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class MainContentSeriesResponse(
|
||||||
|
@SerializedName("seriesId") val seriesId: Long,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("coverImageUrl") val coverImageUrl: String?,
|
||||||
|
@SerializedName("creatorNickname") val creatorNickname: String,
|
||||||
|
@SerializedName("isOriginal") val isOriginal: Boolean,
|
||||||
|
@SerializedName("isAdult") val isAdult: Boolean
|
||||||
|
)
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.content.data
|
||||||
|
|
||||||
|
import kr.co.vividnext.sodalive.home.SeriesPublishedDaysOfWeek
|
||||||
|
import kr.co.vividnext.sodalive.v2.common.data.ContentSort
|
||||||
|
|
||||||
|
class MainContentAllTabRepository(private val api: MainContentAllTabApi) {
|
||||||
|
fun getContents(
|
||||||
|
token: String,
|
||||||
|
type: MainContentAllType,
|
||||||
|
sort: ContentSort,
|
||||||
|
page: Int,
|
||||||
|
size: Int,
|
||||||
|
dayOfWeek: SeriesPublishedDaysOfWeek?
|
||||||
|
) = api.getContents(
|
||||||
|
authHeader = token,
|
||||||
|
type = type,
|
||||||
|
sort = sort,
|
||||||
|
page = page,
|
||||||
|
size = size,
|
||||||
|
dayOfWeek = dayOfWeek
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user