Skip to content
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

[PC-555] 매칭 상세화면 API 연결 #63

Merged
merged 12 commits into from
Feb 11, 2025
Merged

Conversation

tgyuuAn
Copy link
Member

@tgyuuAn tgyuuAn commented Feb 11, 2025

1. ⭐️ 변경된 내용

  • 매칭 상세화면 API 연결
  • 매칭된 상대방 데이터 MatchingHome화면에서 사전에 케싱합니다.

4. 📌 이 부분은 꼭 봐주세요!

GetOpponentProfileUseCase에서 케싱된 데이터가 있으면 해당 데이터를 사용하고,

없을경우 서버에 호출한 데이터를 사용합니다.

테스트 코드 꼼꼼히 작성하였으니 테스트 코드에 적혀져있는 명세 참고하시고 궁금한 부분 코멘트주세요!!!

@tgyuuAn tgyuuAn added 기능 ⚒️ 새로운 기능 구현 ⚒️ ㅌㄱ태규 ☀️ 훗날 크게될 ENFP 남성, tgyuuAn labels Feb 11, 2025
@tgyuuAn tgyuuAn requested a review from sksowk156 February 11, 2025 08:54
@tgyuuAn tgyuuAn self-assigned this Feb 11, 2025
@tgyuuAn tgyuuAn force-pushed the feature/tgyuu/PC-555 branch from be8861c to f85e258 Compare February 11, 2025 08:57
Copy link
Contributor

@sksowk156 sksowk156 left a comment

Choose a reason for hiding this comment

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

태규님 고생하셨습니다!!!!!!!!!!!!!!! 👍 👍

@sksowk156 sksowk156 added the 머지 해도될듯염🌟 현재 코드를 기존 코드에 합쳐도 될 것 같다라고 판단..! 🌟 label Feb 11, 2025
@tgyuuAn tgyuuAn marked this pull request as ready for review February 11, 2025 14:17
Comment on lines +59 to +60
# https://github.com/google/gson
gson = "2.12.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

DataStore에 데이터 삽입할때 직렬화/역직렬화를 간단히 하기 위해서 사용하였습니다~

일일이 string 파싱할 수 있는데 유지보수 측면에서 너무 안좋을 것 같아서 채택하였습니다.

Gson을 사용한 이유는 KotlinxSerilization을 사용하려면 DomainModel에 @Serilizable 어노테이션을 붙여야하는데,

Gson은 리플렉션 기반이라서 별다른 어노테이션을 붙이지 않아도 사용 가능합니다...!

Copy link
Contributor

Choose a reason for hiding this comment

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

그럼 DataStroe에 삽입할 때만 쓰는 건가요?!

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 맞습니다~~

객체를 하나의 키로 저장할때 사용해요

Copy link
Contributor

@sksowk156 sksowk156 left a comment

Choose a reason for hiding this comment

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

태규님!! 고생하셨습니다 👍 👍

import com.puzzle.domain.model.profile.OpponentProfile
import com.puzzle.domain.repository.MatchingRepository

class SpyMatchingRepository : MatchingRepository {
Copy link
Contributor

Choose a reason for hiding this comment

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

질문이 하나 있어요!! spy랑 fake랑 차이가 뭔지 궁금합니다!!

Copy link
Member Author

@tgyuuAn tgyuuAn Feb 11, 2025

Choose a reason for hiding this comment

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

Fake는 값만을 내려주는 스텁 객체에요.

우리가 개발에서 쓰는 Dummy데이터의 Dummy도 스텁이에요!

Spy는 스텁 기능에 더해서 호출된 횟수 등과 같은 상호작용까지 감시할 수 있어요.

원래는 Mock이 이런 기능을 하는데 Mock 라이브러리를 사용하지 않고 직접 구현한 것이 Spy입니다!!

로컬 메서드 호출 횟수를 측정하려고 Fake가 아닌 Spy를 썻습니다~~~

}

@Test
fun `로컬에서 데이터를 성공적으로 불러올 경우 서버 요청을 하지 않는다`() = runTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@tgyuuAn tgyuuAn merged commit 1d928f2 into develop Feb 11, 2025
1 check passed
@tgyuuAn tgyuuAn deleted the feature/tgyuu/PC-555 branch February 11, 2025 15:00
@tgyuuAn tgyuuAn added the 테스트 📜 내가 작성한 코드는 내가 책임진다 📜 label Feb 12, 2025
@DongChyeon
Copy link
Member

헉... 테스트 코드까지.... 🫨

@tgyuuAn
Copy link
Member Author

tgyuuAn commented Feb 12, 2025

헉... 테스트 코드까지.... 🫨

사소해~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ㅌㄱ태규 ☀️ 훗날 크게될 ENFP 남성, tgyuuAn 기능 ⚒️ 새로운 기능 구현 ⚒️ 머지 해도될듯염🌟 현재 코드를 기존 코드에 합쳐도 될 것 같다라고 판단..! 🌟 테스트 📜 내가 작성한 코드는 내가 책임진다 📜
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants