-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/온보딩 프로필 #28
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
base: main
Are you sure you want to change the base?
The head ref may contain hidden characters: "feature/\uC628\uBCF4\uB529-\uD504\uB85C\uD544"
Feature/온보딩 프로필 #28
Changes from all commits
07799ab
32fa6ae
b89c89c
3ab683b
7019f20
3c8a7b1
1a6f511
f08afb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package umc.onairmate.data.api | ||
|
|
||
| import retrofit2.http.Body | ||
| import retrofit2.http.GET | ||
| import retrofit2.http.Header | ||
| import retrofit2.http.PUT | ||
| import retrofit2.http.Path | ||
| import umc.onairmate.data.model.response.NicknameResponse | ||
| import umc.onairmate.data.model.response.RawDefaultResponse | ||
|
|
||
| interface NicknameService { | ||
| @GET("auth/check-nickname/{nickname}") | ||
| suspend fun checkNickname( | ||
| @Path("nickname") nickname: String | ||
| ): NicknameResponse | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package umc.onairmate.data.model.entity | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain패키지-디렉터리 대소문자 불일치: OnAirMate vs onairmate 현재 파일 경로가 다음 스크립트를 실행하여 디렉터리 경로와 패키지 선언의 대소문자 불일치 여부를 확인해 주세요. 🏁 Script executed: #!/bin/bash
# umc 디렉터리 하위 구조 확인
find app/src/main/java/umc -maxdepth 4 -type d
echo "-----"
# 해당 파일의 패키지 선언 확인
head -n 5 app/src/main/java/umc/OnAirMate/data/model/entity/NicknameData.kt || trueLength of output: 2598 패키지 경로 대소문자 통일 필요
수정 안내:
🤖 Prompt for AI Agents |
||
|
|
||
| import com.google.gson.annotations.SerializedName | ||
|
|
||
| data class NicknameData( | ||
| @SerializedName("available") | ||
| val available: Boolean, | ||
|
|
||
| @SerializedName("message") | ||
| val message: String | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package umc.onairmate.data.model.response | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain패키지-디렉터리 대소문자 불일치: OnAirMate vs onairmate 이 파일도 경로가 아래 스크립트를 실행해서 🏁 Script executed: #!/bin/bash
echo "📂 app/src/main/java/umc 하위 디렉터리 리스트:"
find app/src/main/java/umc -type d | sed 's/^/ - /'
echo ""
echo "📄 NicknameResponse.kt 위치 확인:"
find app/src/main/java/umc -type f -name "NicknameResponse.kt" -printLength of output: 2852 경로·패키지 대소문자 불일치 수정 필요 Linux 등 대소문자를 구분하는 파일시스템에서 빌드가 깨질 수 있습니다. • 디렉터리명 변경
- package umc.onairmate.data.model.response
+ package umc.onairmate.data.model.response(이외 관련된 모든 파일의 경로 및 패키지 선언도 함께 정렬) 위 변경 후 반드시 전체 빌드 및 의존 관계를 확인해주세요.
🤖 Prompt for AI Agents |
||
|
|
||
| import com.google.gson.annotations.SerializedName | ||
| import umc.onairmate.data.model.entity.NicknameData | ||
|
|
||
| class NicknameResponse ( | ||
| @SerializedName("success") | ||
| val success: Boolean, | ||
|
|
||
| @SerializedName("data") | ||
| val data: NicknameData | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package umc.onairmate.data.repository | ||
|
|
||
| interface NicknameRepository { | ||
| suspend fun isNicknameDuplicated(nickname: String): Boolean | ||
| } | ||
|
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain패키지/디렉터리 구조 불일치 가능성(가독성 및 유지보수 관점). 파일 경로가 검증 스크립트: 🏁 Script executed: #!/bin/bash
# Kotlin 소스의 패키지 선언과 실제 디렉토리 구조 불일치 의심 지점 탐색
echo "== Package declarations vs path hints =="
fd -e kt | rg -n 'package\\s+umc\\.onairmate\\.' -NLength of output: 144 🏁 Script executed: #!/bin/bash
echo "== NicknameRepository.kt 파일 위치 확인 =="
fd -e kt NicknameRepository.kt
echo ""
echo "== 패키지 선언 확인 (파일 상단 5줄) =="
fd -e kt NicknameRepository.kt -x sed -n '1,5p' {}
echo ""
echo "== 디렉터리 구조 확인 =="
fd -e kt NicknameRepository.kt -x dirname {}Length of output: 622 패키지 경로와 디렉터리 구조 불일치 수정 필요 현재
수정 제안:
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||||||||
| package umc.onairmate.data.repository.repositoryImpl | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import android.util.Log | ||||||||||||||||||||||||||||||||
| import umc.onairmate.data.api.NicknameService | ||||||||||||||||||||||||||||||||
| import umc.onairmate.data.repository.NicknameRepository | ||||||||||||||||||||||||||||||||
| import javax.inject.Inject | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| class NicknameRepositoryImpl @Inject constructor( | ||||||||||||||||||||||||||||||||
| private val api: NicknameService | ||||||||||||||||||||||||||||||||
| ): NicknameRepository { | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| override suspend fun isNicknameDuplicated(nickname: String): Boolean { | ||||||||||||||||||||||||||||||||
| return try { | ||||||||||||||||||||||||||||||||
| val response = api.checkNickname(nickname) | ||||||||||||||||||||||||||||||||
| // available == true 면 사용 가능한 닉네임, 중복 아님 → 따라서 중복 여부는 반대(!) | ||||||||||||||||||||||||||||||||
| !response.data.available | ||||||||||||||||||||||||||||||||
| } catch (e: Exception) { | ||||||||||||||||||||||||||||||||
| Log.e("NicknameRepository", "닉네임 중복 검사 실패", e) | ||||||||||||||||||||||||||||||||
| // 실패 시 기본값 false 또는 true 선택 가능 (보통 실패는 중복 아님 false로 처리) | ||||||||||||||||||||||||||||||||
| false | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 예외 처리 로직 검토 필요 네트워크 오류나 서버 응답 파싱 실패 시 다음과 같이 예외를 상위로 전파하거나 명확한 오류 상태를 반환하는 것을 권장합니다: override suspend fun isNicknameDuplicated(nickname: String): Boolean {
- return try {
+ try {
val response = api.checkNickname(nickname)
// available == true 면 사용 가능한 닉네임, 중복 아님 → 따라서 중복 여부는 반대(!)
- !response.data.available
+ return !response.data.available
} catch (e: Exception) {
Log.e("NicknameRepository", "닉네임 중복 검사 실패", e)
- // 실패 시 기본값 false 또는 true 선택 가능 (보통 실패는 중복 아님 false로 처리)
- false
+ throw e // 상위에서 처리하도록 전파
}
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| package umc.onairmate.ui.pop_up | ||
|
|
||
| import android.os.Bundle | ||
| import android.text.Editable | ||
| import android.text.TextWatcher | ||
| import android.view.LayoutInflater | ||
| import android.view.View | ||
| import android.view.ViewGroup | ||
| import android.widget.Toast | ||
| import androidx.lifecycle.lifecycleScope | ||
| import com.google.android.material.bottomsheet.BottomSheetDialogFragment | ||
| import dagger.hilt.android.AndroidEntryPoint | ||
| import kotlinx.coroutines.Dispatchers | ||
| import kotlinx.coroutines.launch | ||
| import kotlinx.coroutines.withContext | ||
| import umc.onairmate.R | ||
| import umc.onairmate.data.repository.NicknameRepository | ||
| import umc.onairmate.databinding.PopupChangeNicknameBinding | ||
| import javax.inject.Inject | ||
|
|
||
| @AndroidEntryPoint | ||
| class ChangeNicknamePopup : BottomSheetDialogFragment() { | ||
|
|
||
| private var _binding: PopupChangeNicknameBinding? = null | ||
| private val binding get() = _binding!! | ||
|
|
||
| // 외부에서 중복 체크를 처리하기 위한 콜백 람다 추가 | ||
| var onCheckNickname: ((String, (Boolean) -> Unit) -> Unit)? = null | ||
|
|
||
| // @Inject | ||
| // lateinit var repository: NicknameRepository | ||
|
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain주석 처리된 핵심 기능 활성화 필요 닉네임 중복 확인의 핵심 기능인 다음 스크립트로 Hilt 모듈 구성을 확인해보겠습니다: 🏁 Script executed: #!/bin/bash
# Description: Hilt 모듈 구성 및 NicknameRepository 바인딩 확인
echo "=== ServiceModule에서 NicknameService 제공 확인 ==="
rg -A 5 "fun.*nicknameApi|fun.*NicknameService" --type kt
echo "=== RepositoryModule에서 NicknameRepository 제공 확인 ==="
rg -A 5 "fun.*providesNicknameRepository" --type kt
echo "=== Application 클래스 Hilt 어노테이션 확인 ==="
rg -A 3 "@HiltAndroidApp" --type kt
echo "=== NicknameRepository 인터페이스 정의 확인 ==="
rg -A 5 "interface NicknameRepository" --type ktLength of output: 694 다음 스크립트로 Hilt 모듈 구성과 🏁 Script executed: #!/usr/bin/env bash
# Hilt 모듈 및 리포지토리 정의 확인
echo "=== NicknameRepository 인터페이스 정의 ==="
rg -n "interface NicknameRepository" --glob "*.kt"
echo "=== provides.*NicknameRepository 바인딩 ==="
rg -n "provides.*NicknameRepository" --glob "*.kt"
echo "=== nicknameApi 또는 NicknameService 제공 ==="
rg -n "nicknameApi" --glob "*.kt"
rg -n "NicknameService" --glob "*.kt"
echo "=== Application 클래스 @HiltAndroidApp 어노테이션 ==="
rg -n "@HiltAndroidApp" --glob "*.kt"Length of output: 1832 ChangeNicknamePopup에 NicknameRepository 주입 복원 필요 현재 • 대상 파일:
• 수정 예시: @@ ChangeNicknamePopup.kt (27-28)
-// @Inject
-// lateinit var repository: NicknameRepository
+ @Inject
+ lateinit var repository: NicknameRepository위 변경 후 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| override fun onCreateView( | ||
| inflater: LayoutInflater, container: ViewGroup?, | ||
| savedInstanceState: Bundle? | ||
| ): View { | ||
| _binding = PopupChangeNicknameBinding.inflate(inflater, container, false) | ||
| return binding.root | ||
| } | ||
|
|
||
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| super.onViewCreated(view, savedInstanceState) | ||
|
|
||
| binding.editNickname.addTextChangedListener(object : TextWatcher { | ||
| override fun afterTextChanged(s: Editable?) { | ||
| val input = s.toString() | ||
| val isValid = input.length in 3..10 | ||
|
|
||
| binding.checkNickname.setBackgroundResource( | ||
| if (isValid) R.drawable.bg_btn_main | ||
| else R.drawable.bg_btn_disabled | ||
| ) | ||
| binding.checkNickname.isEnabled = isValid | ||
| } | ||
|
|
||
| override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} | ||
| override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {} | ||
| }) | ||
|
|
||
| binding.checkNickname.setOnClickListener { | ||
| val nickname = binding.editNickname.text.toString() | ||
|
|
||
| if (nickname.length !in 3..10) { | ||
| Toast.makeText(requireContext(), "닉네임은 3자 이상 10자 이하여야 합니다.", Toast.LENGTH_SHORT).show() | ||
| return@setOnClickListener | ||
| } | ||
|
|
||
| // 외부 콜백 호출해서 중복 검사 요청 | ||
| onCheckNickname?.invoke(nickname) { isDuplicated -> | ||
| if (isDuplicated) { | ||
| Toast.makeText(requireContext(), "이미 사용 중인 닉네임입니다.", Toast.LENGTH_SHORT).show() | ||
| binding.editNickname.text?.clear() | ||
| binding.checkNickname.setBackgroundResource(R.drawable.bg_btn_disabled) | ||
| binding.checkNickname.isEnabled = false | ||
| } else { | ||
| Toast.makeText(requireContext(), "사용 가능한 닉네임입니다!", Toast.LENGTH_SHORT).show() | ||
| } | ||
| } | ||
|
|
||
| /* | ||
| viewLifecycleOwner.lifecycleScope.launch { | ||
| val isDuplicated = withContext(Dispatchers.IO) { | ||
| repository.isNicknameDuplicated(nickname) | ||
| } | ||
|
|
||
| if (isDuplicated) { | ||
| Toast.makeText(requireContext(), "이미 사용 중인 닉네임입니다.", Toast.LENGTH_SHORT).show() | ||
| binding.editNickname.text.clear() | ||
| binding.checkNickname.setBackgroundResource(R.drawable.bg_btn_disabled) | ||
| binding.checkNickname.isEnabled = false | ||
| } else { | ||
| Toast.makeText(requireContext(), "사용 가능한 닉네임입니다!", Toast.LENGTH_SHORT).show() | ||
| } | ||
| } | ||
| */ | ||
|
|
||
| // viewLifecycleOwner.lifecycleScope.launch { | ||
| // val isDuplicated = withContext(Dispatchers.IO) { | ||
| // repository.isNicknameDuplicated(nickname) | ||
| // } | ||
| // | ||
| // if (isDuplicated) { | ||
| // Toast.makeText(requireContext(), "이미 사용 중인 닉네임입니다.", Toast.LENGTH_SHORT).show() | ||
| // binding.editNickname.text.clear() | ||
| // binding.checkNickname.setBackgroundResource(R.drawable.bg_btn_disabled) | ||
| // binding.checkNickname.isEnabled = false | ||
| // } else { | ||
| // Toast.makeText(requireContext(), "사용 가능한 닉네임입니다!", Toast.LENGTH_SHORT).show() | ||
| // } | ||
| // } | ||
| } | ||
| } | ||
|
|
||
| override fun onDestroyView() { | ||
| super.onDestroyView() | ||
| _binding = null | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||||||||||||||||||||||||||||
| package umc.onairmate.ui.pop_up | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| import androidx.lifecycle.ViewModel | ||||||||||||||||||||||||||||||||||||||
| import androidx.lifecycle.viewModelScope | ||||||||||||||||||||||||||||||||||||||
| import dagger.hilt.android.lifecycle.HiltViewModel | ||||||||||||||||||||||||||||||||||||||
| import kotlinx.coroutines.launch | ||||||||||||||||||||||||||||||||||||||
| import javax.inject.Inject | ||||||||||||||||||||||||||||||||||||||
| import umc.onairmate.data.repository.NicknameRepository | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| @HiltViewModel | ||||||||||||||||||||||||||||||||||||||
| class ChangeNicknameViewModel @Inject constructor( | ||||||||||||||||||||||||||||||||||||||
| private val nicknameRepository: NicknameRepository | ||||||||||||||||||||||||||||||||||||||
| ) : ViewModel() { | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // 닉네임 중복 확인 결과를 콜백으로 전달하거나 LiveData로 관리 가능 | ||||||||||||||||||||||||||||||||||||||
| fun checkNickname( | ||||||||||||||||||||||||||||||||||||||
| nickname: String, | ||||||||||||||||||||||||||||||||||||||
| onResult: (Boolean) -> Unit | ||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||
| viewModelScope.launch { | ||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||
| val isDuplicated = nicknameRepository.isNicknameDuplicated(nickname) | ||||||||||||||||||||||||||||||||||||||
| onResult(isDuplicated) | ||||||||||||||||||||||||||||||||||||||
| } catch (e: Exception) { | ||||||||||||||||||||||||||||||||||||||
| // 에러 처리 필요하면 여기서 | ||||||||||||||||||||||||||||||||||||||
| onResult(false) // 중복 아님으로 처리하거나 별도 처리 | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+24
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 예외 처리 개선 필요 현재 예외 발생 시 다음과 같이 개선하는 것을 권장합니다: fun checkNickname(
nickname: String,
- onResult: (Boolean) -> Unit
+ onResult: (Boolean?, String?) -> Unit
) {
viewModelScope.launch {
try {
val isDuplicated = nicknameRepository.isNicknameDuplicated(nickname)
- onResult(isDuplicated)
+ onResult(isDuplicated, null)
} catch (e: Exception) {
- // 에러 처리 필요하면 여기서
- onResult(false) // 중복 아님으로 처리하거나 별도 처리
+ Log.e("ChangeNicknameViewModel", "닉네임 중복 확인 실패", e)
+ onResult(null, "네트워크 오류가 발생했습니다. 다시 시도해주세요.")
}
}
}📝 Committable suggestion
Suggested change
🧰 Tools🪛 detekt (1.23.8)[warning] 24-24: The caught exception is swallowed. The original exception could be lost. (detekt.exceptions.SwallowedException) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,14 +8,17 @@ import dagger.hilt.android.scopes.ViewModelScoped | |
| import umc.onairmate.data.api.FriendService | ||
| import umc.onairmate.data.api.ChatRoomService | ||
| import umc.onairmate.data.api.HomeService | ||
| import umc.onairmate.data.api.NicknameService | ||
| import umc.onairmate.data.api.TestService | ||
| import umc.onairmate.data.repository.NicknameRepository | ||
|
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 패키지 경로 불일치로 인한 Hilt 바인딩 오류 가능성
다음 스크립트를 실행하여 패키지 구조 일관성을 확인해보겠습니다: #!/bin/bash
# Description: 닉네임 관련 클래스들의 패키지 구조 일관성 확인
echo "=== NicknameService 클래스 위치 확인 ==="
fd -t f "NicknameService.kt"
echo "=== NicknameRepository 인터페이스 위치 확인 ==="
fd -t f "NicknameRepository.kt"
echo "=== NicknameRepositoryImpl 구현체 위치 확인 ==="
fd -t f "NicknameRepositoryImpl.kt"
echo "=== 각 파일의 패키지 선언 확인 ==="
fd -t f -e kt -x grep -H "^package" {} \; | grep -E "(NicknameService|NicknameRepository)"Also applies to: 21-21 🤖 Prompt for AI Agents |
||
| import umc.onairmate.data.repository.repository.FriendRepository | ||
| import umc.onairmate.data.repository.repository.ChatRoomRepository | ||
| import umc.onairmate.data.repository.repository.HomeRepository | ||
| import umc.onairmate.data.repository.repository.TestRepository | ||
| import umc.onairmate.data.repository.repositoryImpl.FriendRepositoryImpl | ||
| import umc.onairmate.data.repository.repositoryImpl.ChatRoomRepositoryImpl | ||
| import umc.onairmate.data.repository.repositoryImpl.HomeRepositoryImpl | ||
| import umc.onairmate.data.repository.repositoryImpl.NicknameRepositoryImpl | ||
| import umc.onairmate.data.repository.repositoryImpl.TestRepositoryImpl | ||
|
|
||
| @Module | ||
|
|
@@ -26,22 +29,29 @@ object RepositoryModule { | |
| @Provides | ||
| fun providesHomeRepository( | ||
| homeService: HomeService | ||
| ) : HomeRepository = HomeRepositoryImpl(homeService) | ||
| ): HomeRepository = HomeRepositoryImpl(homeService) | ||
|
|
||
| @ViewModelScoped | ||
| @Provides | ||
| fun providesTestRepository( | ||
| testService: TestService | ||
| ) : TestRepository = TestRepositoryImpl(testService) | ||
| ): TestRepository = TestRepositoryImpl(testService) | ||
|
|
||
| @ViewModelScoped | ||
| @Provides | ||
| fun providesFriendRepository( | ||
| friendService: FriendService | ||
| ) : FriendRepository = FriendRepositoryImpl(friendService) | ||
| ): FriendRepository = FriendRepositoryImpl(friendService) | ||
|
|
||
| @ViewModelScoped | ||
| @Provides | ||
| fun providesChatRoomRepository( | ||
| chatRoomService: ChatRoomService | ||
| ) : ChatRoomRepository = ChatRoomRepositoryImpl(chatRoomService) | ||
| } | ||
| ): ChatRoomRepository = ChatRoomRepositoryImpl(chatRoomService) | ||
|
|
||
| @ViewModelScoped | ||
| @Provides | ||
| fun providesNicknameRepository( | ||
| nicknameService: NicknameService | ||
| ): NicknameRepository = NicknameRepositoryImpl(nicknameService) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import retrofit2.Retrofit | |
| import umc.onairmate.data.api.ChatRoomService | ||
| import umc.onairmate.data.api.FriendService | ||
| import umc.onairmate.data.api.HomeService | ||
| import umc.onairmate.data.api.NicknameService | ||
| import umc.onairmate.data.api.TestService | ||
| import javax.inject.Singleton | ||
|
|
||
|
|
@@ -44,4 +45,10 @@ object ServiceModule { | |
| fun friendApi(@NetworkModule.BaseRetrofit retrofit: Retrofit): FriendService{ | ||
| return retrofit.buildService() | ||
| } | ||
|
|
||
| @Provides | ||
| @Singleton | ||
| fun nicknameApi(@NetworkModule.BaseRetrofit retrofit: Retrofit): NicknameService { | ||
| return retrofit.buildService() | ||
| } | ||
|
Comment on lines
+49
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainHilt MissingBinding 에러 원인 가능성 정리 및 제안 수정 보고된 에러(
권장 바인딩 예시: // RepositoryModule.kt
@Module
@InstallIn(SingletonComponent::class)
abstract class RepositoryModule {
@Binds
@Singleton
abstract fun bindNicknameRepository(
impl: NicknameRepositoryImpl
): NicknameRepository
}또한, Fragment/Popup 등 UI 레이어에서 다음 스크립트로 실제 패키지/컴포넌트 불일치 여부를 확인해 보세요. 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Locate NicknameRepository interface =="
fd -a 'NicknameRepository.kt' | sed 's/^/ - /'
echo
echo "== Packages of NicknameRepository =="
fd -a 'NicknameRepository.kt' | xargs -I{} sh -c 'echo "{}"; rg -n "^package " "{}"; echo'
echo
echo "== Locate NicknameRepositoryImpl and annotations =="
fd -a 'NicknameRepositoryImpl.kt' | xargs -I{} sh -c 'echo "{}"; rg -n "^package |@Inject|class\\s+NicknameRepositoryImpl" "{}"; echo' || true
echo
echo "== RepositoryModule @InstallIn target and bindings =="
fd -a 'RepositoryModule.kt' | xargs -I{} sh -c 'echo "{}"; rg -n "@InstallIn\\(|@Module|@Binds|@Provides|@Singleton" "{}"; echo' || true
echo
echo "== Import sites for NicknameRepository (check for mismatched packages) =="
rg -n "import\\s+umc\\.onairmate\\.data\\.repository\\.NicknameRepository" || true
rg -n "import\\s+umc\\.onairmate\\.data\\.repository\\.repository\\.NicknameRepository" || true
echo
echo "== Check directory case mismatch under java/ =="
fd -t d 'OnAirMate' ./app/src/main/java || true
fd -t d 'onairmate' ./app/src/main/java || true
echo
echo "== Confirm ServiceModule provides NicknameService with BaseRetrofit =="
fd -a 'ServiceModule.kt' | xargs -I{} sh -c 'echo "{}"; rg -n "NicknameService|BaseRetrofit" "{}"; echo' || true
echo
echo "== ChangeNicknamePopup usage (ensure repository not injected directly) =="
fd -a 'ChangeNicknamePopup.kt' | xargs -I{} sh -c 'echo "{}"; rg -n "@AndroidEntryPoint|NicknameRepository|by\\s+viewModels|@HiltViewModel" "{}"; echo' || trueLength of output: 4033 UI 레이어에서 Repository 직접 주입 제거 및 ViewModelComponent 유지 현재
(선택) Repository를 앱 전역 싱글톤으로 사용하려면, 위 @InstallIn(SingletonComponent::class)
@Module
abstract class RepositoryModule {
@Binds @Singleton abstract fun bindNicknameRepository(
impl: NicknameRepositoryImpl
): NicknameRepository
}처럼 🤖 Prompt for AI Agents |
||
| } | ||
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.
💡 Verification agent
🧩 Analysis chain
패키지-디렉터리 대소문자 불일치: OnAirMate vs onairmate
서비스 인터페이스 파일 경로 또한
umc/OnAirMate/...로 보입니다. 패키지 선언(umc.onairmate...)과 일치하도록 디렉터리를umc/onairmate/...로 이동해 주세요.아래 스크립트를 실행하여 실제 디렉터리 명칭이 패키지 선언과 일치하는지 확인해주세요.
🏁 Script executed:
Length of output: 1528
파일 경로 대소문자 불일치 수정 필요
현재
app/src/main/java/umc/OnAirMate/data/api/NicknameService.kt파일의 패키지 선언은로, 디렉터리 이름(
OnAirMate)과 맞지 않습니다.• 기존 경로:
app/src/main/java/umc/OnAirMate/data/api/NicknameService.kt• 수정 경로:
app/src/main/java/umc/onairmate/data/api/NicknameService.kt위와 같이 디렉터리 이름을 모두 소문자(
onairmate)로 변경해 패키지 선언과 일치하도록 조치해주세요.🤖 Prompt for AI Agents