feat(content): 추천 API 계약을 추가한다
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.content.data
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Single
|
||||||
|
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||||
|
import retrofit2.http.GET
|
||||||
|
import retrofit2.http.Header
|
||||||
|
|
||||||
|
interface AudioRecommendationsApi {
|
||||||
|
@GET("/api/v2/audio/recommendations")
|
||||||
|
fun getRecommendations(
|
||||||
|
@Header("Authorization") authHeader: String
|
||||||
|
): Single<ApiResponse<AudioRecommendationsResponse>>
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.content.data
|
||||||
|
|
||||||
|
import androidx.annotation.Keep
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import kr.co.vividnext.sodalive.settings.event.EventItem
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class AudioRecommendationsResponse(
|
||||||
|
@SerializedName("banners") val banners: List<AudioBannerResponse>,
|
||||||
|
@SerializedName("originalSeries") val originalSeries: List<OriginalSeriesResponse>,
|
||||||
|
@SerializedName("latestAudios") val latestAudios: List<AudioCardResponse>,
|
||||||
|
@SerializedName("newAndHotAudios") val newAndHotAudios: List<AudioCardResponse>,
|
||||||
|
@SerializedName("freeAudios") val freeAudios: List<AudioCardResponse>,
|
||||||
|
@SerializedName("pointAudios") val pointAudios: List<AudioCardResponse>,
|
||||||
|
@SerializedName("mostCommentedAudios") val mostCommentedAudios: List<CommentedAudioResponse>,
|
||||||
|
@SerializedName("recommendedAudios") val recommendedAudios: List<AudioCardResponse>
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class AudioBannerResponse(
|
||||||
|
@SerializedName("imageUrl") val imageUrl: String,
|
||||||
|
@SerializedName("eventItem") val eventItem: EventItem?,
|
||||||
|
@SerializedName("creatorId") val creatorId: Long?,
|
||||||
|
@SerializedName("seriesId") val seriesId: Long?,
|
||||||
|
@SerializedName("link") val link: String?
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class OriginalSeriesResponse(
|
||||||
|
@SerializedName("seriesId") val seriesId: Long,
|
||||||
|
@SerializedName("coverImageUrl") val coverImageUrl: String?
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class AudioCardResponse(
|
||||||
|
@SerializedName("audioContentId") val audioContentId: Long,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("duration") val duration: 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 CommentedAudioResponse(
|
||||||
|
@SerializedName("audioContentId") val audioContentId: Long,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("imageUrl") val imageUrl: String?,
|
||||||
|
@SerializedName("latestComment") val latestComment: String,
|
||||||
|
@SerializedName("latestCommentWriterProfileImageUrl") val latestCommentWriterProfileImageUrl: String
|
||||||
|
)
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.content.data
|
||||||
|
|
||||||
|
class AudioRecommendationsRepository(private val api: AudioRecommendationsApi) {
|
||||||
|
fun getRecommendations(token: String) = api.getRecommendations(authHeader = token)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user