-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from everymeals/feature/review_api
Feature/review api
- Loading branch information
Showing
53 changed files
with
1,063 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
data/src/main/java/com/everymeal/data/datasource/auth/AuthRemoteRemoteDataSourceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
data/src/main/java/com/everymeal/data/datasource/review/ReviewDataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.everymeal.data.datasource.review | ||
|
||
import com.everymeal.data.model.review.ReviewListResponse | ||
import com.everymeal.data.model.review.StoreReviewRequest | ||
|
||
interface ReviewDataSource { | ||
suspend fun getReviewList( | ||
cursorIdx: Int, | ||
mealIdx: Int, | ||
pageSize: Int, | ||
): Result<ReviewListResponse> | ||
|
||
suspend fun postReview(storeReviewRequest: StoreReviewRequest): Result<Boolean> | ||
} |
29 changes: 29 additions & 0 deletions
29
data/src/main/java/com/everymeal/data/datasource/review/ReviewDataSourceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.everymeal.data.datasource.review | ||
|
||
import com.everymeal.data.model.review.ReviewListResponse | ||
import com.everymeal.data.model.review.StoreReviewRequest | ||
import com.everymeal.data.model.unwrapRunCatching | ||
import com.everymeal.data.service.review.StoreReviewApi | ||
import javax.inject.Inject | ||
|
||
class ReviewDataSourceImpl @Inject constructor( | ||
private val storeReviewApi: StoreReviewApi, | ||
) : ReviewDataSource { | ||
|
||
override suspend fun getReviewList( | ||
cursorIdx: Int, | ||
mealIdx: Int, | ||
pageSize: Int, | ||
): Result<ReviewListResponse> = | ||
unwrapRunCatching { | ||
storeReviewApi.getStoreReviewsWithId( | ||
cursorIdx, | ||
mealIdx, | ||
pageSize, | ||
) | ||
} | ||
|
||
override suspend fun postReview( | ||
storeReviewRequest: StoreReviewRequest, | ||
): Result<Boolean> = unwrapRunCatching { storeReviewApi.postStoreReview(storeReviewRequest) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.