parent
10c215d9bd
commit
68a777c8df
|
@ -8,15 +8,12 @@ import kr.co.vividnext.sodalive.audio_content.order.OrderType
|
|||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.explorer.ExplorerApi
|
||||
import kr.co.vividnext.sodalive.settings.ContentType
|
||||
import kr.co.vividnext.sodalive.user.CreatorFollowRequestRequest
|
||||
import kr.co.vividnext.sodalive.user.UserApi
|
||||
import okhttp3.MultipartBody
|
||||
import okhttp3.RequestBody
|
||||
import java.util.TimeZone
|
||||
|
||||
class AudioContentRepository(
|
||||
private val api: AudioContentApi,
|
||||
private val userApi: UserApi,
|
||||
private val categoryApi: CategoryApi,
|
||||
private val explorerApi: ExplorerApi
|
||||
) {
|
||||
|
@ -91,22 +88,6 @@ class AudioContentRepository(
|
|||
authHeader = token
|
||||
)
|
||||
|
||||
fun registerNotification(
|
||||
creatorId: Long,
|
||||
token: String
|
||||
) = userApi.creatorFollow(
|
||||
request = CreatorFollowRequestRequest(creatorId = creatorId),
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
fun unRegisterNotification(
|
||||
creatorId: Long,
|
||||
token: String
|
||||
) = userApi.creatorUnFollow(
|
||||
request = CreatorFollowRequestRequest(creatorId = creatorId),
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
fun orderContent(
|
||||
contentId: Long,
|
||||
orderType: OrderType,
|
||||
|
|
|
@ -15,6 +15,8 @@ interface SeriesApi {
|
|||
fun getSeriesList(
|
||||
@Query("creatorId") creatorId: Long,
|
||||
@Query("sortType") sortType: SeriesListAllViewModel.SeriesSortType,
|
||||
@Query("isAdultContentVisible") isAdultContentVisible: Boolean,
|
||||
@Query("contentType") contentType: ContentType,
|
||||
@Query("page") page: Int,
|
||||
@Query("size") size: Int,
|
||||
@Header("Authorization") authHeader: String
|
||||
|
@ -23,12 +25,14 @@ interface SeriesApi {
|
|||
@GET("/audio-content/series/{id}")
|
||||
fun getSeriesDetail(
|
||||
@Path("id") seriesId: Long,
|
||||
@Query("isAdultContentVisible") isAdultContentVisible: Boolean,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<GetSeriesDetailResponse>>
|
||||
|
||||
@GET("/audio-content/series/{id}/content")
|
||||
fun getSeriesContentList(
|
||||
@Path("id") seriesId: Long,
|
||||
@Query("isAdultContentVisible") isAdultContentVisible: Boolean,
|
||||
@Query("page") page: Int,
|
||||
@Query("size") size: Int,
|
||||
@Query("sortType") sortType: SeriesListAllViewModel.SeriesSortType,
|
||||
|
|
|
@ -13,6 +13,8 @@ class SeriesRepository(private val api: SeriesApi) {
|
|||
) = api.getSeriesList(
|
||||
creatorId = creatorId,
|
||||
sortType = sortType,
|
||||
isAdultContentVisible = SharedPreferenceManager.isAdultContentVisible,
|
||||
contentType = ContentType.values()[SharedPreferenceManager.contentPreference],
|
||||
page = page - 1,
|
||||
size = size,
|
||||
authHeader = token
|
||||
|
@ -20,6 +22,7 @@ class SeriesRepository(private val api: SeriesApi) {
|
|||
|
||||
fun getSeriesDetail(seriesId: Long, token: String) = api.getSeriesDetail(
|
||||
seriesId = seriesId,
|
||||
isAdultContentVisible = SharedPreferenceManager.isAdultContentVisible,
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
|
@ -31,6 +34,7 @@ class SeriesRepository(private val api: SeriesApi) {
|
|||
token: String
|
||||
) = api.getSeriesContentList(
|
||||
seriesId = seriesId,
|
||||
isAdultContentVisible = SharedPreferenceManager.isAdultContentVisible,
|
||||
page = page - 1,
|
||||
size = size,
|
||||
sortType = sortType,
|
||||
|
|
|
@ -337,7 +337,7 @@ class AppDI(private val context: Context, isDebugMode: Boolean) {
|
|||
factory { ExplorerRepository(get()) }
|
||||
factory { MessageRepository(get()) }
|
||||
factory { NoticeRepository(get()) }
|
||||
factory { AudioContentRepository(get(), get(), get(), get()) }
|
||||
factory { AudioContentRepository(get(), get(), get()) }
|
||||
factory { AudioContentCommentRepository(get()) }
|
||||
factory { PlaybackTrackingRepository(get()) }
|
||||
factory { FollowingCreatorRepository(get()) }
|
||||
|
|
Loading…
Reference in New Issue