-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] : #83 Ui State Pattern, Home WeekFood StateFlow Migration
- Loading branch information
Showing
11 changed files
with
90 additions
and
58 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
4 changes: 3 additions & 1 deletion
4
app/src/main/java/com/myongsik/myongsikandroid/data/datasource/food/FoodDataSource.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
12 changes: 4 additions & 8 deletions
12
app/src/main/java/com/myongsik/myongsikandroid/data/datasource/food/FoodDataSourceImpl.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
4 changes: 0 additions & 4 deletions
4
app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodRepository.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
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
4 changes: 3 additions & 1 deletion
4
app/src/main/java/com/myongsik/myongsikandroid/data/repository/food/FoodV2RepositoryImpl.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
4 changes: 3 additions & 1 deletion
4
app/src/main/java/com/myongsik/myongsikandroid/domain/repository/food/FoodV2Repository.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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package com.myongsik.myongsikandroid.domain.repository.food | ||
|
||
import com.myongsik.myongsikandroid.base.BaseResult | ||
import com.myongsik.myongsikandroid.domain.model.food.RequestReviewDataEntity | ||
import com.myongsik.myongsikandroid.domain.model.food.ResponseReviewDataEntity | ||
import com.myongsik.myongsikandroid.domain.model.food.ResponseWeekFoodEntity | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface FoodV2Repository { | ||
|
||
suspend fun weekGetFoodArea(s: String): ResponseWeekFoodEntity? | ||
suspend fun weekGetFoodArea(s: String): Flow<BaseResult<ResponseWeekFoodEntity>> | ||
|
||
suspend fun postReview(requestReviewDataEntity: RequestReviewDataEntity): ResponseReviewDataEntity? | ||
} |
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
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
app/src/main/java/com/myongsik/myongsikandroid/presentation/viewmodel/food/WeekFoodState.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.myongsik.myongsikandroid.presentation.viewmodel.food | ||
|
||
import com.myongsik.myongsikandroid.domain.model.food.ResponseWeekFoodEntity | ||
|
||
sealed class WeekFoodState { | ||
|
||
object UnInitialized : WeekFoodState() | ||
|
||
object Loading : WeekFoodState() | ||
|
||
data class SuccessWeekFoodGetData(val getWeekFoodData: ResponseWeekFoodEntity) : WeekFoodState() | ||
|
||
data class Error(val errorCode: Int) : WeekFoodState() | ||
} |