-
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 #38 from MONEYMONG/MONEYMONG-511
Moneymong 511 강제 업데이트 얼랏창 구현
- Loading branch information
Showing
43 changed files
with
204 additions
and
99 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
package com.moneymong.moneymong | ||
|
||
import com.moneymong.moneymong.common.base.BaseViewModel | ||
import com.moneymong.moneymong.domain.usecase.version.CheckVersionUpdateUseCase | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import org.orbitmvi.orbit.syntax.simple.intent | ||
import org.orbitmvi.orbit.syntax.simple.reduce | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class MainViewModel @Inject constructor() : BaseViewModel<MainState, MainSideEffect>(MainState()) { | ||
class MainViewModel @Inject constructor( | ||
val checkVersionUpdateUseCase: CheckVersionUpdateUseCase | ||
) : BaseViewModel<MainState, MainSideEffect>(MainState()) { | ||
|
||
fun checkShouldUpdate(version: String) = intent { | ||
val shouldUpdate = | ||
checkVersionUpdateUseCase(version = version).isFailure | ||
reduce { | ||
state.copy(shouldUpdate = shouldUpdate) | ||
} | ||
} | ||
} |
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: 5 additions & 0 deletions
5
core/model/src/main/java/com/moneymong/moneymong/model/version/VersionRequest.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,5 @@ | ||
package com.moneymong.moneymong.model.version | ||
|
||
data class VersionRequest( | ||
val version: String | ||
) |
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
13 changes: 13 additions & 0 deletions
13
core/network/src/main/java/com/moneymong/moneymong/network/api/VersionApi.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,13 @@ | ||
package com.moneymong.moneymong.network.api | ||
|
||
import com.moneymong.moneymong.model.version.VersionRequest | ||
import retrofit2.http.Body | ||
import retrofit2.http.POST | ||
|
||
interface VersionApi { | ||
|
||
@POST("api/v1/version") | ||
suspend fun checkUpdate( | ||
@Body version: VersionRequest | ||
): Result<Unit> | ||
} |
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
1 change: 0 additions & 1 deletion
1
core/network/src/main/java/com/moneymong/moneymong/network/response/ErrorResponse.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
2 changes: 1 addition & 1 deletion
2
...network/src/main/java/com/moneymong/moneymong/network/util/MoneyMongTokenAuthenticator.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
19 changes: 0 additions & 19 deletions
19
core/ui/src/main/java/com/moneymong/moneymong/ui/RippleEffect.kt
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
.../src/main/java/com/moneymong/moneymong/data/datasource/version/VersionRemoteDataSource.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,6 @@ | ||
package com.moneymong.moneymong.data.datasource.version | ||
|
||
interface VersionRemoteDataSource { | ||
|
||
suspend fun checkUpdate(version: String): Result<Unit> | ||
} |
13 changes: 13 additions & 0 deletions
13
.../main/java/com/moneymong/moneymong/data/datasource/version/VersionRemoteDataSourceImpl.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,13 @@ | ||
package com.moneymong.moneymong.data.datasource.version | ||
|
||
import com.moneymong.moneymong.model.version.VersionRequest | ||
import com.moneymong.moneymong.network.api.VersionApi | ||
import javax.inject.Inject | ||
|
||
class VersionRemoteDataSourceImpl @Inject constructor( | ||
private val versionApi: VersionApi | ||
) : VersionRemoteDataSource { | ||
override suspend fun checkUpdate(version: String): Result<Unit> { | ||
return versionApi.checkUpdate(VersionRequest(version = version)) | ||
} | ||
} |
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.