feat(live): 온에어 라이브 API를 추가한다

This commit is contained in:
2026-06-26 23:42:55 +09:00
parent e13da00215
commit 6e04a10a3b
3 changed files with 47 additions and 0 deletions

View File

@@ -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>>
}

View File

@@ -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
)

View File

@@ -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
)
}