Skip to content

Commit

Permalink
[feat] detail_image / 사진 정보 가져오기 api datasource까지 완료 (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
2chang5 committed Jul 22, 2022
1 parent 0f0856b commit 1d100fa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ interface RemoteDataSourceModule {
@Binds
@Singleton
fun bindsRemoteTagListDataSource(source: RemoteTagListDataSourceImpl): RemoteTagListDataSource

@Binds
@Singleton
fun bindsRemoteTagListDataSource(source: RemoteImageDataSourceImpl): RemoteImageDataSource
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.photosurfer.android.data.remote.datasource

import com.photosurfer.android.data.remote.calladapter.NetworkState
import com.photosurfer.android.data.remote.model.response.BaseResponse
import com.photosurfer.android.data.remote.model.response.DetailImageResponse

interface RemoteImageDataSource {

suspend fun getDetailImageInfo(photoId: Int): NetworkState<BaseResponse<DetailImageResponse>>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.photosurfer.android.data.remote.datasource

import com.photosurfer.android.data.remote.calladapter.NetworkState
import com.photosurfer.android.data.remote.model.response.BaseResponse
import com.photosurfer.android.data.remote.model.response.DetailImageResponse
import com.photosurfer.android.data.remote.service.DetailImageService
import javax.inject.Inject

class RemoteImageDataSourceImpl @Inject constructor(
private val detailImageService: DetailImageService
) : RemoteImageDataSource {

override suspend fun getDetailImageInfo(photoId: Int): NetworkState<BaseResponse<DetailImageResponse>> =
detailImageService.getDetailImageInfo(photoId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import retrofit2.http.Path
interface DetailImageService {
@GET("photo/detail/{photoId}")
suspend fun getDetailImageInfo(
@Path("photoID") photo: Int
@Path("photoID") photoId: Int
): NetworkState<BaseResponse<DetailImageResponse>>
}

0 comments on commit 1d100fa

Please sign in to comment.