-
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 #86 from PawWithU/feature/mypage
feature/mypage: 프로필 정보 수정 기능 구현 및 API 연결
- Loading branch information
Showing
28 changed files
with
538 additions
and
106 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
6 changes: 6 additions & 0 deletions
6
core/data/src/main/java/com/kusitms/connectdog/core/data/api/model/AdditionalAuthBody.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.kusitms.connectdog.core.data.api.model | ||
|
||
data class AdditionalAuthBody( | ||
val name: String, | ||
val phone: String | ||
) |
12 changes: 12 additions & 0 deletions
12
core/data/src/main/java/com/kusitms/connectdog/core/data/api/model/DeleteAccountResponse.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.kusitms.connectdog.core.data.api.model | ||
|
||
data class DeleteAccountResponse( | ||
val code: Int, | ||
val isSuccess: Boolean, | ||
val message: String, | ||
val result: Result | ||
) | ||
|
||
data class Result( | ||
val userId: Long | ||
) |
3 changes: 3 additions & 0 deletions
3
core/data/src/main/java/com/kusitms/connectdog/core/data/repository/ApplyRepository.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,7 +1,10 @@ | ||
package com.kusitms.connectdog.core.data.repository | ||
|
||
import com.kusitms.connectdog.core.data.api.model.AdditionalAuthBody | ||
import com.kusitms.connectdog.core.data.api.model.volunteer.ApplyBody | ||
|
||
interface ApplyRepository { | ||
suspend fun postApplyVolunteer(postId: Long, applyBody: ApplyBody) | ||
suspend fun postAdditionalAuth(additionalAuthBody: AdditionalAuthBody) | ||
suspend fun getAdditionalAuth(): AdditionalAuthBody | ||
} |
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
6 changes: 6 additions & 0 deletions
6
core/data/src/main/java/com/kusitms/connectdog/core/data/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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package com.kusitms.connectdog.core.data.repository | ||
|
||
import com.kusitms.connectdog.core.data.api.model.DeleteAccountResponse | ||
import com.kusitms.connectdog.core.data.api.model.IsDuplicateNicknameResponse | ||
import com.kusitms.connectdog.core.data.api.model.MyInfoResponseItem | ||
import com.kusitms.connectdog.core.data.api.model.volunteer.BadgeResponse | ||
import com.kusitms.connectdog.core.data.api.model.volunteer.BookmarkResponseItem | ||
import com.kusitms.connectdog.core.data.api.model.volunteer.IsDuplicateNicknameBody | ||
import com.kusitms.connectdog.core.data.api.model.volunteer.UserInfoResponse | ||
|
||
interface MyPageRepository { | ||
suspend fun getMyInfo(): MyInfoResponseItem | ||
suspend fun getUserInfo(): UserInfoResponse | ||
suspend fun getBadge(): List<BadgeResponse> | ||
suspend fun getBookmarkData(): List<BookmarkResponseItem> | ||
suspend fun deleteAccount(): DeleteAccountResponse | ||
suspend fun postNickname(nickname: IsDuplicateNicknameBody): IsDuplicateNicknameResponse | ||
suspend fun updateUserInfo(userInfo: UserInfoResponse) | ||
} |
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
Binary file modified
BIN
+0 Bytes
(100%)
core/designsystem/build/kotlin/compileReleaseKotlin/cacheable/last-build.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
core/designsystem/build/kotlin/compileReleaseKotlin/local-state/build-history.bin
Binary file not shown.
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
Binary file modified
BIN
+0 Bytes
(100%)
core/model/build/kotlin/compileReleaseKotlin/cacheable/last-build.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
core/model/build/kotlin/compileReleaseKotlin/local-state/build-history.bin
Binary file not shown.
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
69 changes: 69 additions & 0 deletions
69
feature/home/src/main/java/com/kusitms/connectdog/feature/home/CertificationViewModel.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,69 @@ | ||
package com.kusitms.connectdog.feature.home | ||
|
||
import android.util.Log | ||
import androidx.compose.runtime.MutableState | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.viewModelScope | ||
import com.kusitms.connectdog.core.data.api.model.AdditionalAuthBody | ||
import com.kusitms.connectdog.core.data.repository.ApplyRepository | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.StateFlow | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class CertificationViewModel @Inject constructor( | ||
private val applyRepository: ApplyRepository | ||
) : ViewModel() { | ||
private val _isCertified: MutableStateFlow<Boolean> = MutableStateFlow(false) | ||
val isCertified: StateFlow<Boolean> = _isCertified | ||
|
||
private val _isSendNumber: MutableStateFlow<Boolean> = MutableStateFlow(false) | ||
val isSendNumber: StateFlow<Boolean> = _isSendNumber | ||
|
||
private val _name: MutableState<String> = mutableStateOf("") | ||
val name: String | ||
get() = _name.value | ||
|
||
private val _phoneNumber: MutableState<String> = mutableStateOf("") | ||
val phoneNumber: String | ||
get() = _phoneNumber.value | ||
|
||
private val _certificationNumber: MutableState<String> = mutableStateOf("") | ||
val certificationNumber: String | ||
get() = _certificationNumber.value | ||
|
||
fun updateName(name: String) { | ||
_name.value = name | ||
} | ||
|
||
fun updatePhoneNumber(phoneNumber: String) { | ||
_phoneNumber.value = phoneNumber | ||
} | ||
|
||
fun updateCertificationNumber(certificationNumber: String) { | ||
_certificationNumber.value = certificationNumber | ||
} | ||
|
||
fun updateIsCertified(isCertified: Boolean) { | ||
_isCertified.value = isCertified | ||
} | ||
|
||
fun updateIsSendNumber(value: Boolean) { | ||
_isSendNumber.value = value | ||
} | ||
|
||
fun postAdditionalAuth() { | ||
val body = AdditionalAuthBody(name = _name.value, phone = _phoneNumber.value) | ||
viewModelScope.launch { | ||
try { | ||
val response = applyRepository.postAdditionalAuth(body) | ||
Log.d("testtts", response.toString()) | ||
} catch (e: Exception) { | ||
Log.d("testttserror", e.message.toString()) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.