-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
146 additions
and
8 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
7 changes: 7 additions & 0 deletions
7
data/src/main/java/com/terning/data/datasource/MyPageDataSource.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,7 @@ | ||
package com.terning.data.datasource | ||
|
||
import com.terning.data.dto.NonDataBaseResponse | ||
|
||
interface MyPageDataSource { | ||
suspend fun patchLogout(): NonDataBaseResponse | ||
} |
12 changes: 12 additions & 0 deletions
12
data/src/main/java/com/terning/data/datasourceimpl/MyPageDataSourceImpl.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,12 @@ | ||
package com.terning.data.datasourceimpl | ||
|
||
import com.terning.data.datasource.MyPageDataSource | ||
import com.terning.data.dto.NonDataBaseResponse | ||
import com.terning.data.service.MyPageService | ||
import javax.inject.Inject | ||
|
||
class MyPageDataSourceImpl @Inject constructor( | ||
private val myPageService: MyPageService | ||
) : MyPageDataSource { | ||
override suspend fun patchLogout(): NonDataBaseResponse = myPageService.patchLogout() | ||
} |
14 changes: 14 additions & 0 deletions
14
data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.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.terning.data.repositoryimpl | ||
|
||
import com.terning.data.datasource.MyPageDataSource | ||
import com.terning.domain.repository.MyPageRepository | ||
import javax.inject.Inject | ||
|
||
class MyPageRepositoryImpl @Inject constructor( | ||
private val myPageDataSource: MyPageDataSource | ||
) : MyPageRepository { | ||
override suspend fun patchLogout(): Result<Unit> = | ||
runCatching { | ||
myPageDataSource.patchLogout() | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
data/src/main/java/com/terning/data/service/MyPageService.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,10 @@ | ||
package com.terning.data.service | ||
|
||
import com.terning.data.dto.NonDataBaseResponse | ||
import retrofit2.http.PATCH | ||
|
||
interface MyPageService { | ||
@PATCH("api/v1/mypage/logout") | ||
suspend fun patchLogout(): NonDataBaseResponse | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
domain/src/main/java/com/terning/domain/repository/MyPageRepository.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.terning.domain.repository | ||
|
||
interface MyPageRepository { | ||
suspend fun patchLogout() : 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
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
7 changes: 7 additions & 0 deletions
7
feature/src/main/java/com/terning/feature/mypage/MyPageState.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,7 @@ | ||
package com.terning.feature.mypage | ||
|
||
import com.terning.core.state.UiState | ||
|
||
data class MyPageState( | ||
val isSuccess: UiState<Boolean> = UiState.Loading | ||
) |
53 changes: 51 additions & 2 deletions
53
feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.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