feat(live): 온에어 라이브 API를 추가한다
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.live.onair.data
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Single
|
||||||
|
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||||
|
import retrofit2.http.GET
|
||||||
|
import retrofit2.http.Header
|
||||||
|
import retrofit2.http.Query
|
||||||
|
|
||||||
|
interface HomeOnAirLiveApi {
|
||||||
|
@GET("/api/v2/home/on-air-lives")
|
||||||
|
fun getOnAirLives(
|
||||||
|
@Header("Authorization") authHeader: String?,
|
||||||
|
@Query("page") page: Int
|
||||||
|
): Single<ApiResponse<HomeOnAirLivePageResponse>>
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.live.onair.data
|
||||||
|
|
||||||
|
import androidx.annotation.Keep
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class HomeOnAirLivePageResponse(
|
||||||
|
@SerializedName("items") val items: List<HomeOnAirLiveResponse>,
|
||||||
|
@SerializedName("page") val page: Int,
|
||||||
|
@SerializedName("size") val size: Int,
|
||||||
|
@SerializedName("hasNext") val hasNext: Boolean
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class HomeOnAirLiveResponse(
|
||||||
|
@SerializedName("roomId") val roomId: Long,
|
||||||
|
@SerializedName("creatorNickname") val creatorNickname: String,
|
||||||
|
@SerializedName("creatorProfileImage") val creatorProfileImage: String,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("price") val price: Int,
|
||||||
|
@SerializedName("beginDateTimeUtc") val beginDateTimeUtc: String
|
||||||
|
)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.live.onair.data
|
||||||
|
|
||||||
|
class HomeOnAirLiveRepository(
|
||||||
|
private val api: HomeOnAirLiveApi
|
||||||
|
) {
|
||||||
|
fun getOnAirLives(authHeader: String?, page: Int) = api.getOnAirLives(
|
||||||
|
authHeader = authHeader,
|
||||||
|
page = page
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user