feat(home): 팔로잉 탭 API 계약을 추가한다
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.home.data
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Single
|
||||||
|
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||||
|
import retrofit2.http.GET
|
||||||
|
import retrofit2.http.Header
|
||||||
|
|
||||||
|
interface HomeFollowingApi {
|
||||||
|
@GET("/api/v2/home/following")
|
||||||
|
fun getFollowing(
|
||||||
|
@Header("Authorization") authHeader: String?
|
||||||
|
): Single<ApiResponse<HomeFollowingTabResponse>>
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.home.data
|
||||||
|
|
||||||
|
import androidx.annotation.Keep
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import kr.co.vividnext.sodalive.v2.common.CreatorActivityType
|
||||||
|
import kr.co.vividnext.sodalive.v2.main.chat.data.ChatRoomListItemResponse
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class HomeFollowingTabResponse(
|
||||||
|
@SerializedName("isLoginRequired") val isLoginRequired: Boolean,
|
||||||
|
@SerializedName("followingCreators") val followingCreators: List<FollowingCreatorResponse>,
|
||||||
|
@SerializedName("onAirLives") val onAirLives: List<FollowingLiveResponse>,
|
||||||
|
@SerializedName("recentChats") val recentChats: List<ChatRoomListItemResponse>,
|
||||||
|
@SerializedName("monthlySchedules") val monthlySchedules: List<FollowingScheduleResponse>,
|
||||||
|
@SerializedName("recentNews") val recentNews: List<FollowingNewsResponse>
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class FollowingCreatorResponse(
|
||||||
|
@SerializedName("creatorId") val creatorId: Long,
|
||||||
|
@SerializedName("creatorNickname") val creatorNickname: String,
|
||||||
|
@SerializedName("creatorProfileImageUrl") val creatorProfileImageUrl: String
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class FollowingLiveResponse(
|
||||||
|
@SerializedName("liveId") val liveId: Long,
|
||||||
|
@SerializedName("creatorProfileImageUrl") val creatorProfileImageUrl: String,
|
||||||
|
@SerializedName("creatorNickname") val creatorNickname: String,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("startedAtUtc") val startedAtUtc: String
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class FollowingScheduleResponse(
|
||||||
|
@SerializedName("scheduleId") val scheduleId: String,
|
||||||
|
@SerializedName("creatorId") val creatorId: Long,
|
||||||
|
@SerializedName("creatorProfileImageUrl") val creatorProfileImageUrl: String,
|
||||||
|
@SerializedName("creatorNickname") val creatorNickname: String,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("type") val type: CreatorActivityType,
|
||||||
|
@SerializedName("targetId") val targetId: Long,
|
||||||
|
@SerializedName("scheduledAtUtc") val scheduledAtUtc: String,
|
||||||
|
@SerializedName("isOnAir") val isOnAir: Boolean
|
||||||
|
)
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
data class FollowingNewsResponse(
|
||||||
|
@SerializedName("newsId") val newsId: String,
|
||||||
|
@SerializedName("type") val type: FollowingNewsType,
|
||||||
|
@SerializedName("creatorProfileImageUrl") val creatorProfileImageUrl: String,
|
||||||
|
@SerializedName("creatorNickname") val creatorNickname: String,
|
||||||
|
@SerializedName("title") val title: String,
|
||||||
|
@SerializedName("body") val body: String,
|
||||||
|
@SerializedName("thumbnailImageUrl") val thumbnailImageUrl: String?,
|
||||||
|
@SerializedName("targetId") val targetId: Long,
|
||||||
|
@SerializedName("occurredAtUtc") val occurredAtUtc: String,
|
||||||
|
@SerializedName("visibleFromAtUtc") val visibleFromAtUtc: String,
|
||||||
|
@SerializedName("rank") val rank: Int?
|
||||||
|
)
|
||||||
|
|
||||||
|
enum class FollowingNewsType {
|
||||||
|
@SerializedName("CREATOR_RANKING")
|
||||||
|
CREATOR_RANKING,
|
||||||
|
|
||||||
|
@SerializedName("CONTENT_RANKING")
|
||||||
|
CONTENT_RANKING,
|
||||||
|
|
||||||
|
@SerializedName("COMMUNITY_POST")
|
||||||
|
COMMUNITY_POST,
|
||||||
|
|
||||||
|
@SerializedName("AUDIO_CONTENT")
|
||||||
|
AUDIO_CONTENT,
|
||||||
|
|
||||||
|
@SerializedName("PHOTO_CONTENT")
|
||||||
|
PHOTO_CONTENT
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package kr.co.vividnext.sodalive.v2.main.home.data
|
||||||
|
|
||||||
|
class HomeFollowingRepository(private val api: HomeFollowingApi) {
|
||||||
|
fun getFollowing(authHeader: String?) = api.getFollowing(authHeader = authHeader)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user