-
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.
- Loading branch information
Showing
10 changed files
with
92 additions
and
0 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/going/data/datasource/SettingDataSource.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.going.data.datasource | ||
|
||
import com.going.data.dto.response.SignOutResponseDto | ||
|
||
interface SettingDataSource { | ||
suspend fun patchSignOut(): SignOutResponseDto | ||
} |
12 changes: 12 additions & 0 deletions
12
data/src/main/java/com/going/data/datasourceImpl/SettingDataSourceImpl.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.going.data.datasourceImpl | ||
|
||
import com.going.data.datasource.SettingDataSource | ||
import com.going.data.dto.response.SignOutResponseDto | ||
import com.going.data.service.SettingService | ||
import javax.inject.Inject | ||
|
||
class SettingDataSourceImpl @Inject constructor( | ||
private val settingService: SettingService, | ||
) : SettingDataSource { | ||
override suspend fun patchSignOut(): SignOutResponseDto = settingService.patchSignOut() | ||
} |
16 changes: 16 additions & 0 deletions
16
data/src/main/java/com/going/data/dto/response/SignOutResponseDto.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,16 @@ | ||
package com.going.data.dto.response | ||
|
||
import com.going.domain.entity.response.SignOutModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class SignOutResponseDto( | ||
@SerialName("status") | ||
val status: Int, | ||
@SerialName("message") | ||
val message: String, | ||
) { | ||
fun toSignOutModel() = | ||
SignOutModel(status, message) | ||
} |
14 changes: 14 additions & 0 deletions
14
data/src/main/java/com/going/data/repositoryImpl/SettingRepositoryImpl.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.going.data.repositoryImpl | ||
|
||
import com.going.data.datasource.SettingDataSource | ||
import com.going.domain.entity.response.SignOutModel | ||
import com.going.domain.repository.SettingRepository | ||
import javax.inject.Inject | ||
|
||
class SettingRepositoryImpl @Inject constructor( | ||
private val settingDataSource: SettingDataSource, | ||
) : SettingRepository { | ||
override suspend fun patchSignOut(): Result<SignOutModel> = runCatching { | ||
settingDataSource.patchSignOut().toSignOutModel() | ||
} | ||
} |
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,9 @@ | ||
package com.going.data.service | ||
|
||
import com.going.data.dto.response.SignOutResponseDto | ||
import retrofit2.http.PATCH | ||
|
||
interface SettingService { | ||
@PATCH("api/users/signout") | ||
suspend fun patchSignOut(): SignOutResponseDto | ||
} |
6 changes: 6 additions & 0 deletions
6
domain/src/main/kotlin/com/going/domain/entity/response/SignOutModel.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.going.domain.entity.response | ||
|
||
data class SignOutModel( | ||
val status: Int, | ||
val message: String, | ||
) |
7 changes: 7 additions & 0 deletions
7
domain/src/main/kotlin/com/going/domain/repository/SettingRepository.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.going.domain.repository | ||
|
||
import com.going.domain.entity.response.SignOutModel | ||
|
||
interface SettingRepository { | ||
suspend fun patchSignOut(): Result<SignOutModel> | ||
} |