Skip to content

Conversation

@mark77234
Copy link
Collaborator

@mark77234 mark77234 commented Jan 8, 2026

작업내용

  • 여자 매칭 조회 api 연동
  • 여자 매칭 수락 및 거절 api 추가 및 연동

@mark77234 mark77234 self-assigned this Jan 8, 2026
Copilot AI review requested due to automatic review settings January 8, 2026 08:01
@mark77234 mark77234 linked an issue Jan 8, 2026 that may be closed by this pull request
3 tasks
@mark77234 mark77234 merged commit bcf1bb2 into dev Jan 8, 2026
4 of 5 checks passed
@mark77234 mark77234 deleted the feat/72 branch January 8, 2026 08:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds male matching functionality to complement the existing female matching features. Males can now view pending match requests from females and accept or reject them through dedicated API endpoints.

Key changes:

  • Introduced HomeMatching data model as a unified representation for both male and female matching data
  • Added new API endpoints and response models for male pending matchings
  • Implemented gender-based conditional UI that shows different actions (confirm for females, accept/reject for males)

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
HomeMatching.kt New unified data model to represent matching data regardless of user gender
MalePendingMatchingResponse.kt New API response model for male pending matchings
MatchingService.kt Added three new API endpoints for male matching operations (get, accept, reject)
HomeViewModel.kt Added gender-based fetching logic, accept/reject methods, and data transformation functions
HomeScreen.kt Updated UI to conditionally show accept/reject buttons for males or confirm button for females
MainRouteScreen.kt Wired gender-based matching fetch on gender state change and connected accept/reject callbacks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +333 to +337
private const val FEMALE_GENDER = "JAPANESE_FEMALE"
private const val MALE_GENDER = "KOREAN_MALE"
}
}

Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FEMALE_GENDER constant is duplicated between this file and HomeViewModel. This duplication can lead to maintenance issues if the value needs to be changed. Consider moving these gender constants to a shared constants file or object to maintain a single source of truth.

Suggested change
private const val FEMALE_GENDER = "JAPANESE_FEMALE"
private const val MALE_GENDER = "KOREAN_MALE"
}
}
private const val FEMALE_GENDER = GenderConstants.FEMALE_GENDER
private const val MALE_GENDER = GenderConstants.MALE_GENDER
}
}
object GenderConstants {
const val FEMALE_GENDER = "JAPANESE_FEMALE"
const val MALE_GENDER = "KOREAN_MALE"
}

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +169
private fun fetchMalePendingMatchings() {
if (_uiState.value.isWaiting) return

viewModelScope.launch {
_uiState.update { it.copy(isLoading = true) }
runCatching {
matchingService.getMalePendingMatchings().awaitResponse()
}.onSuccess { response ->
Log.d(
TAG,
"getMalePendingMatchings success=${response.isSuccessful} code=${response.code()}"
)
if (response.isSuccessful) {
val body = response.body().orEmpty()
Log.d(TAG, "getMalePendingMatchings body=$body")
val data = body.map { it.toHomeMatching() }
if (data.isEmpty()) {
_uiState.update {
it.copy(
isLoading = false,
matchings = emptyList(),
selectedMatching = null,
isWaiting = true
)
}
} else {
_uiState.update {
it.copy(
isLoading = false,
matchings = data,
selectedMatching = null,
isWaiting = false
)
}
}
} else {
_uiState.update {
it.copy(
isLoading = false,
matchings = emptyList(),
selectedMatching = null,
isWaiting = true
)
}
}
}.onFailure { throwable ->
Log.e(TAG, "getMalePendingMatchings failed", throwable)
_uiState.update {
it.copy(
isLoading = false,
matchings = emptyList(),
selectedMatching = null,
isWaiting = true
)
}
}
}
}
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function has significant code duplication with fetchFemaleMatchings. The logic for handling loading states, empty data, success, and failure cases is identical. Consider extracting the common logic into a reusable helper function that accepts the API call and data transformation as parameters to improve maintainability and reduce duplication.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 남자 매칭 조회 확인

2 participants