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

[BE] refactor: 알림 서비스 다른 도메인 의존성 제거 #740

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ehtjsv2
Copy link
Contributor

@ehtjsv2 ehtjsv2 commented Nov 20, 2024

이슈

개발 사항

  • 알림 서비스 다른 도메인 의존성 제거
  • ChatNotificationService 클래스 생성
  • Chat 관련 알림 데이터 생성 시 Map.of() NPE 가능성 완화
    • null의 가능성이 큰 부분만 대처함

Copy link

github-actions bot commented Nov 20, 2024

Test Results

226 tests  +149   226 ✅ +149   19s ⏱️ +18s
 46 suites + 34     0 💤 ±  0 
 46 files   + 34     0 ❌ ±  0 

Results for commit 2e452d7. ± Comparison against base commit 6bc242f.

This pull request removes 77 and adds 226 tests. Note that renamed tests count towards both.
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ Gender 필터를 선택하면 해당 필터들만 반환되어야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ Size 필터를 선택하면 해당 필터들만 반환되어야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 선택 된 GenderFilter가 없다면, GenderFilter를 확인하는 로직은 false를 반환해야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 선택 된 GenderFilter가 있다면, GenderFilter를 확인하는 로직은 true를 반환해야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 선택 된 SizeFilter가 없다면, SizeFilter를 확인하는 로직은 false를 반환해야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 선택 된 SizeFilter가 있다면, SizeFilter를 확인하는 로직은 true를 반환해야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 여러 필터를 추가하면 ClubFilterSelector에 모든 필터가 추가되어야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 이미 추가 된 필터가 있다면 해당 필터는 추가되지 않아야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 필터 목록을 초기화하면 주어진 필터들로 초기화되어야 한다()
com.happy.friendogly.presentation.ui.club.common.model.ClubFilterSelectorTest ‑ 필터를 제거하면 해당 필터는 ClubFilterSelector에서 삭제되어야 한다()
…
com.happy.friendogly.DataSourceRoutingTest ‑ 읽기 전용 트랜잭션이 아니면, Writer DB 데이터소스가 바운딩된다.
com.happy.friendogly.DataSourceRoutingTest ‑ 읽기전용 트랜잭션이면 reader DB 데이터소스가 바운딩된다.
com.happy.friendogly.chatmessage.controller.ChatMessageControllerTest ‑ 두 시점 사이의 채팅 메시지를 조회할 수 있다.
com.happy.friendogly.chatroom.service.ChatRoomCommandServiceTest ‑ 1대1 채팅방 저장 과정에서, 이미 채팅방이 존재하면 기존 채팅방 ID를 반환한다.
com.happy.friendogly.chatroom.service.ChatRoomCommandServiceTest ‑ 새로운 1대1 채팅방을 개설할 수 있다.
com.happy.friendogly.chatroom.service.ChatRoomCommandServiceTest ‑ 채팅방에서 나간다.
com.happy.friendogly.chatroom.service.ChatRoomCommandServiceTest ‑ 채팅방을 나가고 모임을 나가도 예외가 발생하지 않는다.
com.happy.friendogly.chatroom.service.ChatRoomQueryServiceTest ‑ 내가 속해 있는 채팅방을 찾을 수 있다.
com.happy.friendogly.chatroom.service.ChatRoomQueryServiceTest ‑ 자신이 참여한 채팅방이 아니면 채팅방에서 모임 정보를 받아올 수 없다.
com.happy.friendogly.chatroom.service.ChatRoomQueryServiceTest ‑ 참여중인 1대1 채팅방과 최근 메시지를 조회한다.
…

♻️ This comment has been updated with latest results.

takoyakimchi
takoyakimchi previously approved these changes Nov 20, 2024
Copy link
Contributor

@takoyakimchi takoyakimchi left a comment

Choose a reason for hiding this comment

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

조금 스파게티였던 구조가 훨씬 깔끔해졌네요 👍

Comment on lines +35 to +36
notificationService.sendNotification(
DEFAULT_TITLE,
Copy link
Contributor

Choose a reason for hiding this comment

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

예전에 작성된 코드같긴 한데
하는 김에 DEFAULT_TITLE을 static으로 두면 어떨까요?


void sendFootprintNotification(String title, String content, List<String> receiverTokens);

void sendChatNotification(Long chatRoomId, ChatMessageSocketResponse response, Club club);

void sendPlaygroundJoinNotification(String title, String content, List<String> receiverTokens);
Copy link
Contributor

Choose a reason for hiding this comment

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

오오 추상 메서드가 많이 줄어들었네요

Comment on lines +37 to +38
"profilePictureUrl", response.profilePictureUrl() == null ? "" : response.profilePictureUrl(),
"clubPictureUrl", club.getImageUrl() == null ? "" : club.getImageUrl(),
Copy link
Contributor

Choose a reason for hiding this comment

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

image

아하 이런 문제가 있었군요 !!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

테스트가 터져서 확인해보니 해당부분 문제가 보이더라구요~!

J-I-H-O
J-I-H-O previously approved these changes Nov 22, 2024
Copy link
Contributor

@J-I-H-O J-I-H-O left a comment

Choose a reason for hiding this comment

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

고생 많았습니다 👍

Comment on lines 3 to 4
import static com.happy.friendogly.notification.domain.NotificationType.FOOTPRINT;

Copy link
Contributor

Choose a reason for hiding this comment

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

static import는 제거하는게 어떨까요?
클래스 내부에 선언된 private 상수인지, 공통적으로 사용하는 enum인지 알아보기 어려워지는 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

동의합니다

jimi567
jimi567 previously approved these changes Nov 22, 2024
Copy link
Member

@jimi567 jimi567 left a comment

Choose a reason for hiding this comment

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

고생하셨어요.

@ehtjsv2 ehtjsv2 dismissed stale reviews from jimi567, J-I-H-O, and takoyakimchi via 2e452d7 November 24, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants