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/FEAT] 회원수정 7일동안 안할 시 알림 보내기 기능 #312

Merged
merged 12 commits into from
Jun 8, 2024

Conversation

LJH098
Copy link
Collaborator

@LJH098 LJH098 commented Jun 6, 2024

⚠️ 관련 이슈

closes #294

📢 주요 변경사항

  • 스키마.sql 수정
  • quartz 스케줄러 추가
  • SSE 추가
  • 이벤트 핸들러에서 몸무게 수정하라는 알림 전송
  • Notification Entity 추가
    • Notification Entity를 따로 만든 이유는 SSE로 보내는 것이 여러 종류일 수 있다. ex) 알림, 채팅 etc..
    • 그리고 isRead라는 컬럼을 두어 사용자가 알림을 읽었는지 안읽었는지 확인 할 수 있다.
      • 예를 들어 지금은 구현되지 않았지만 사용자가 앱 알림을 클릭하면 isRead를 true로 바꾸는 요청을 보내게끔 할 수 도 있고 안읽은 알림재전송 할 수도 있다.

@LJH098 LJH098 requested a review from hwangdaesun June 6, 2024 12:28
@LJH098 LJH098 self-assigned this Jun 6, 2024
Copy link
Collaborator

@hwangdaesun hwangdaesun left a comment

Choose a reason for hiding this comment

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

Good~!!

Comment on lines +34 to +35
sendEmitterUseCase.sendNotification(
emitter, eventId, eventId, "EventStream Created. [memberId=" + memberId + "]");
Copy link
Collaborator

Choose a reason for hiding this comment

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

3번째 파라미터 eventId -> emitterId로 수정해야할 것 같아요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

여기서 emitterId가 eventId랑 같기때문에 궅이 emitterId를 만들어서 넣을 필요는 없어 보여요


@Service
@RequiredArgsConstructor
public class sendEmitterService implements SendEmitterUseCase {
Copy link
Collaborator

Choose a reason for hiding this comment

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

"S"endEmitterService...

Comment on lines 75 to 76
return Long.parseLong(eventId.split("_")[1]);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

parseLong 메서드는 원시형으로 타입을 반환해서 Long 타입을 반환한다면 valueOf 메서드를 사용하는 것이 좋아보입니다.


@UseCase
public interface ConnectEmitterUseCase {
SseEmitter connect(final String memberId, final String lastEventId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

인터페이스 이름에서 Connect한다는 거를 나타내고 있기도 하고 저희 메서드 네이밍 규칙에 맞추는 게 좋을 거 같은 데 어떻게 생각하시나요?

@hwangdaesun hwangdaesun merged commit 28a469b into be Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants