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

[Feat] Minigame refact & r2dbc 추가 #21

Merged
merged 22 commits into from
Jun 4, 2024
Merged

[Feat] Minigame refact & r2dbc 추가 #21

merged 22 commits into from
Jun 4, 2024

Conversation

kamothi
Copy link
Member

@kamothi kamothi commented Jun 4, 2024

✏️ 작업 개요

minigame 로직에 대한 리팩토링 및 r2dbc 추가 작업

⛳ 작업 분류

  • 미니 게임에서 발생하는 dto 추가
  • 세션이 끊긴 경우에 대한 로직 추가
  • r2dbc 추가
  • service 로직 개발
  • controller 개발
  • test code 작성

🔨 작업 상세 내용

  1. 미니게임에서 만들어지는 게임 결과를 담는 DTO를 따로 만들었습니다.
  2. 게임 도중 세션이 끊기거나 큐를 잡던 도중 세션이 끊긴 경우에 대한 처리를 추가하였습니다.
  3. r2dbc 드라이버 연결과 관련하여 작업을 처리하였습니다.
  4. 각 레이어 로직 작업을 하고 있습니다.

💡 생각해볼 문제

  • r2dbc를 사용하면 영속성을 보장하지 않는가?
  • r2dbc와 webflux를 쓰는만큼 논블록킹을 제대로 지켜야하는데 잘 지키고 있는가

Copy link

github-actions bot commented Jun 4, 2024

Test Results

12 tests   12 ✅  1s ⏱️
 4 suites   0 💤
 4 files     0 ❌

Results for commit e2c325a.

♻️ This comment has been updated with latest results.


@Table("game_results")
@Builder
@NoArgsConstructor
Copy link
Member

Choose a reason for hiding this comment

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

JPA처럼 엔티티 mapping이 되나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

찾아보니 매핑이 되는 것으로 확인하였습니다. 매핑은 되나 DDL이 지원되지는 않는 것 같습니다. 만약 DB에 해당 테이블이 있다면 매핑은 됩니다.

Copy link
Member

Choose a reason for hiding this comment

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

reactiveCrudRepository가 있는데 따로 만든 이유가 있나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

service에서 repository를 바라 볼 때 인터페이스를 바라보게 하고 싶어 그렇게 하였습니다. 해당 repository를 바로 사용해도 되지많은 mocking을 하든 아니면 repository가 변경이 되든 할 경우 유연하게 대처하고 싶어 의존성을 낮출려는 시도였습니다.

Comment on lines +31 to +32
.flatMap(gameResult -> {
gameResult.update(gameUpdateDTO);
Copy link
Member

Choose a reason for hiding this comment

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

flatMap은 무적인가요? 해당 코드에서 Map을 쓰면 안되나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

아직 리액티브 프로그래밍이 익숙하지 않아 거의 flatMap에 의존하여 사용하고 있는거 같습니다(거의 무적으로 쓰는듯...). 저번에 말해주신 것처럼 코스트가 크다고 했던 걸로 기억하여 대체할만한 것을 찾아 리팩토링 해보겠습니다.

@kamothi kamothi merged commit 1c6e93e into main Jun 4, 2024
3 checks passed
@kamothi kamothi deleted the minigame-refact branch June 4, 2024 14:54
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.

2 participants