-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/IPLC-21] 이력서 파트 api 연결 #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "feat/IPLC-21-\uC774\uB825\uC11C-\uD30C\uD2B8-API-\uC5F0\uACB0"
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
224557a
[feat] 유저 정보 response dto 수정 및 name/nickname 구분
MinseoSONG 718a250
[feat] 이력서 내 정보 조회 api 연동
MinseoSONG 6eed6d8
[feat] 이력서 뷰 - 마이페이지 이동 네비게이션 연결
MinseoSONG 620cbd0
[feat] 경력 뷰 - 경력 수정 뷰 구현 및 네비게이션 연결
MinseoSONG d741737
[feat] 경력 수정 API 연결
MinseoSONG 8f94f0a
[feat] 대내외활동 API 연결
MinseoSONG 38377f2
[style] 이력서 기간 포맷 수정
MinseoSONG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
16 changes: 16 additions & 0 deletions
16
app/src/main/java/org/sopt/certi/domain/usecase/activity/EditActivityUseCase.kt
This file contains hidden or 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 org.sopt.certi.domain.usecase.activity | ||
|
|
||
| import org.sopt.certi.domain.repository.ActivityRepository | ||
|
|
||
| class EditActivityUseCase( | ||
| private val activityRepository: ActivityRepository | ||
| ) { | ||
| suspend operator fun invoke( | ||
| activityId: Long, | ||
| startAt: String, | ||
| endAt: String, | ||
| place: String, | ||
| name: String, | ||
| description: String | ||
| ): Result<Unit> = activityRepository.editActivity(activityId, startAt, endAt, place, name, description) | ||
| } |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/org/sopt/certi/domain/usecase/career/EditCareerUseCase.kt
This file contains hidden or 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 org.sopt.certi.domain.usecase.career | ||
|
|
||
| import org.sopt.certi.domain.repository.CareerRepository | ||
|
|
||
| class EditCareerUseCase( | ||
| private val careerRepository: CareerRepository | ||
| ) { | ||
| suspend operator fun invoke( | ||
| careerId: Long, | ||
| startAt: String, | ||
| endAt: String, | ||
| place: String, | ||
| name: String, | ||
| description: String | ||
| ): Result<Unit> = careerRepository.editCareer(careerId, startAt, endAt, place, name, description) | ||
| } |
105 changes: 105 additions & 0 deletions
105
app/src/main/java/org/sopt/certi/presentation/ui/activity/EditActivitiesViewModel.kt
This file contains hidden or 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,105 @@ | ||
| package org.sopt.certi.presentation.ui.activity | ||
|
|
||
| import androidx.lifecycle.SavedStateHandle | ||
| import androidx.lifecycle.ViewModel | ||
| import androidx.lifecycle.viewModelScope | ||
| import dagger.hilt.android.lifecycle.HiltViewModel | ||
| import kotlinx.coroutines.flow.MutableStateFlow | ||
| import kotlinx.coroutines.flow.SharingStarted | ||
| import kotlinx.coroutines.flow.StateFlow | ||
| import kotlinx.coroutines.flow.combine | ||
| import kotlinx.coroutines.flow.stateIn | ||
| import kotlinx.coroutines.launch | ||
| import org.sopt.certi.domain.usecase.activity.EditActivityUseCase | ||
| import org.sopt.certi.domain.usecase.activity.GetActivityListUseCase | ||
| import org.sopt.certi.presentation.ui.activity.state.AddActivityUiState | ||
| import javax.inject.Inject | ||
|
|
||
| @HiltViewModel | ||
| class EditActivitiesViewModel @Inject constructor( | ||
| private val getActivityListUseCase: GetActivityListUseCase, | ||
| private val editActivityUseCase: EditActivityUseCase, | ||
| savedStateHandle: SavedStateHandle | ||
| ) : ViewModel() { | ||
|
|
||
| private val activityId: Long = checkNotNull(savedStateHandle["activityId"]) | ||
|
|
||
| private val _startDate = MutableStateFlow("") | ||
| private val _endDate = MutableStateFlow("") | ||
| private val _organizationValue = MutableStateFlow("") | ||
| private val _activityValue = MutableStateFlow("") | ||
| private val _descriptionValue = MutableStateFlow("") | ||
|
|
||
| private val _editActivitySuccess = MutableStateFlow(false) | ||
| val editActivitySuccess: StateFlow<Boolean> = _editActivitySuccess | ||
|
|
||
| val addActivityUiState: StateFlow<AddActivityUiState> = | ||
| combine( | ||
| _startDate, | ||
| _endDate, | ||
| _organizationValue, | ||
| _activityValue, | ||
| _descriptionValue | ||
| ) { startDate, endDate, organization, activity, description -> | ||
| AddActivityUiState( | ||
| startDate = startDate, | ||
| endDate = endDate, | ||
| organizationValue = organization, | ||
| activityValue = activity, | ||
| descriptionValue = description, | ||
| addButtonEnabled = listOf(startDate, endDate, organization, activity, description).all { it.isNotBlank() } | ||
| ) | ||
| }.stateIn( | ||
| scope = viewModelScope, | ||
| started = SharingStarted.WhileSubscribed(5_000), | ||
| initialValue = AddActivityUiState("", "", "", "", "", false) | ||
| ) | ||
|
|
||
| init { | ||
| loadInitial() | ||
| } | ||
|
|
||
| private fun loadInitial() { | ||
| viewModelScope.launch { | ||
| getActivityListUseCase.invoke().fold( | ||
| onSuccess = { list -> | ||
| val item = list.find { it.activityId == activityId } | ||
| if (item != null) { | ||
| _startDate.value = item.startAt | ||
| _endDate.value = item.endAt | ||
| _organizationValue.value = item.organization | ||
| _activityValue.value = item.role /* 또는 name/activityValue 필드에 맞게 */ | ||
| _descriptionValue.value = item.description | ||
| } | ||
| }, | ||
| onFailure = { } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| fun onStartDateChanged(value: String) { _startDate.value = value } | ||
| fun onEndDateChanged(value: String) { _endDate.value = value } | ||
| fun onOrganizationChanged(value: String) { _organizationValue.value = value } | ||
| fun onActivityChanged(value: String) { _activityValue.value = value } | ||
| fun onDescriptionChanged(value: String) { _descriptionValue.value = value } | ||
|
|
||
| fun editActivity() { | ||
| viewModelScope.launch { | ||
| editActivityUseCase( | ||
| activityId = activityId, | ||
| startAt = _startDate.value, | ||
| endAt = _endDate.value, | ||
| place = _organizationValue.value, | ||
| name = _activityValue.value, | ||
| description = _descriptionValue.value | ||
| ).fold( | ||
| onSuccess = { _editActivitySuccess.value = true }, | ||
| onFailure = { _editActivitySuccess.value = false } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| fun resetEditActivitySuccess() { | ||
| _editActivitySuccess.value = false | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[3] 이거 combine 최대 5개 아닌가여 더 늘어나면 어케여