Skip to content

Commit

Permalink
[FEATURE]#218 : FeatureOverview 서버 드리븐 API 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Jan 30, 2025
1 parent 66141a3 commit fd1745d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import com.bff.wespot.data.remote.source.ImageDecoderDataSource
import com.bff.wespot.data.remote.source.ImageDecoderDataSourceImpl
import com.bff.wespot.data.remote.source.auth.AuthDataSource
import com.bff.wespot.data.remote.source.auth.AuthDataSourceImpl
import com.bff.wespot.data.remote.source.dynamicui.DynamicDataSourceImpl
import com.bff.wespot.data.remote.source.dynamicui.DynamicUiDataSource
import com.bff.wespot.data.remote.source.firebase.config.RemoteConfigDataSource
import com.bff.wespot.data.remote.source.firebase.config.RemoteConfigDataSourceImpl
import com.bff.wespot.data.remote.source.firebase.messaging.MessagingDataSource
Expand Down Expand Up @@ -88,4 +90,10 @@ abstract class DataRemoteModule {
abstract fun bindsImageDecoderDataSource(
imageDecoderDataSourceImpl: ImageDecoderDataSourceImpl
): ImageDecoderDataSource

@Binds
@Singleton
abstract fun bindsDynamicUiDataSource(
dynamicUiDataSourceImpl: DynamicDataSourceImpl
): DynamicUiDataSource
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.bff.wespot.data.remote.source.dynamicui

import com.bff.wespot.data.remote.model.dynamicui.FeatureOverviewDto
import com.bff.wespot.network.extensions.safeRequest
import io.ktor.client.HttpClient
import io.ktor.client.request.parameter
import io.ktor.http.HttpMethod
import io.ktor.http.path
import javax.inject.Inject

class DynamicDataSourceImpl @Inject constructor(
private val httpClient: HttpClient
): DynamicUiDataSource {
override suspend fun getFeatureOverview(notificationType: String): Result<FeatureOverviewDto> =
httpClient.safeRequest {
url {
method = HttpMethod.Get
path("api/v1/update-modal")
parameter("publishNotificationType", notificationType)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.bff.wespot.data.remote.source.dynamicui

import com.bff.wespot.data.remote.model.dynamicui.FeatureOverviewDto

interface DynamicUiDataSource {
suspend fun getFeatureOverview(notificationType: String): Result<FeatureOverviewDto>
}

0 comments on commit fd1745d

Please sign in to comment.