diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingApi.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingApi.kt new file mode 100644 index 00000000..530a5d3d --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingApi.kt @@ -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> +} diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingModels.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingModels.kt new file mode 100644 index 00000000..33389b79 --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingModels.kt @@ -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, + @SerializedName("onAirLives") val onAirLives: List, + @SerializedName("recentChats") val recentChats: List, + @SerializedName("monthlySchedules") val monthlySchedules: List, + @SerializedName("recentNews") val recentNews: List +) + +@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 +} diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingRepository.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingRepository.kt new file mode 100644 index 00000000..3550ccc1 --- /dev/null +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/data/HomeFollowingRepository.kt @@ -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) +}