generated from GSM-MSG/MSG-Repository-Generator
-
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.
Merge pull request #129 from GSM-MSG/feature/#128_set_up_network_on_i…
…nquiry_my_page 🔀 :: (#128) - Set up network on inquiry my page
- Loading branch information
Showing
8 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
core/data/src/main/java/com/msg/data/repository/user/UserRepository.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,8 +1,10 @@ | ||
package com.msg.data.repository.user | ||
|
||
import com.msg.model.remote.request.user.ChangePasswordRequest | ||
import com.msg.model.remote.response.user.InquiryMyPageResponse | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface UserRepository { | ||
suspend fun changePassword(body: ChangePasswordRequest): Flow<Unit> | ||
suspend fun inquiryMyPage(): Flow<InquiryMyPageResponse> | ||
} |
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/domain/src/main/java/com/msg/domain/user/ChangePasswordUseCase.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.msg.domain.user | ||
|
||
import com.msg.data.repository.user.UserRepository | ||
import com.msg.model.remote.request.user.ChangePasswordRequest | ||
import javax.inject.Inject | ||
|
||
class ChangePasswordUseCase @Inject constructor( | ||
private val userRepository: UserRepository | ||
) { | ||
suspend operator fun invoke(body: ChangePasswordRequest) = runCatching { | ||
userRepository.changePassword(body = body) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
core/domain/src/main/java/com/msg/domain/user/InquiryMyPageUseCase.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.msg.domain.user | ||
|
||
import com.msg.data.repository.user.UserRepository | ||
import javax.inject.Inject | ||
|
||
class InquiryMyPageUseCase @Inject constructor( | ||
private val userRepository: UserRepository | ||
) { | ||
suspend operator fun invoke() = runCatching { | ||
userRepository.inquiryMyPage() | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
core/model/src/main/java/com/msg/model/remote/response/user/InquiryMyPageResponse.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,11 @@ | ||
package com.msg.model.remote.response.user | ||
|
||
import com.msg.model.remote.enumdatatype.Authority | ||
|
||
data class InquiryMyPageResponse( | ||
val name: String, | ||
val email: String, | ||
val phoneNumber: String, | ||
val authority: Authority, | ||
val organization: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package com.msg.network.api | ||
|
||
import com.msg.model.remote.request.user.ChangePasswordRequest | ||
import com.msg.model.remote.response.user.InquiryMyPageResponse | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.PATCH | ||
|
||
interface UserAPI { | ||
@PATCH | ||
@PATCH("user") | ||
suspend fun changePassword( | ||
@Body body: ChangePasswordRequest | ||
) | ||
|
||
@GET("user") | ||
suspend fun inquiryMyPage(): InquiryMyPageResponse | ||
} |
2 changes: 2 additions & 0 deletions
2
core/network/src/main/java/com/msg/network/datasource/user/UserDataSource.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,8 +1,10 @@ | ||
package com.msg.network.datasource.user | ||
|
||
import com.msg.model.remote.request.user.ChangePasswordRequest | ||
import com.msg.model.remote.response.user.InquiryMyPageResponse | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface UserDataSource { | ||
suspend fun changePassword(body: ChangePasswordRequest): Flow<Unit> | ||
suspend fun inquiryMyPage(): Flow<InquiryMyPageResponse> | ||
} |
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