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] 마이페이지 알림 보관 리스트 기능 구현 #124

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

BackInGone
Copy link
Contributor

@BackInGone BackInGone commented Jan 25, 2024

🎯 목적

  • 새 기능 (New Feature)

  • 리팩토링 (Refactoring)

  • 버그 수정 (Bug Fix)

  • 테스트 (Test)

  • CI/CD

  • 설정 (Setup)

  • 간략한 설명:
    : 댓글/리뷰 작성에 대한 마이페이지 내부 알림 보관 리스트 기능 구현


🛠 작성/변경 사항

  • 알림 테이블 생성 후 , 알림 트리거(여행후기 댓글, 여행지리뷰 댓글, 여행후기 리뷰) 상황 발생시 알림 데이터 저장
  • 알림 트리거 상황에 따라 alarmType필드는 ENUM 활용하여 다르게 저장
  • objectId(트리거 발생 대상객체id) 나 windowId(트리거 발생 대상객체가 포함된 위치 id) 는 도메인 구별없이 숫자로 응답값에 포함됨. 프론트 라우팅 보조용도로 사용
  • alarmArgs 변수에 커스텀 메시지(댓글/리뷰 작성자)를 넣어서 반환

🔗 관련 이슈


💡 특이 사항

  • 주목할 사항
    • 이후 여행후기 리뷰 작성 조건 충족시 리뷰작성요청에 대한 알림 케이스 구현 필요
    • 알림기능 구현에 대한 다른 효과적인 방법이나 기술스택 검토

@BackInGone BackInGone added the feat 기능을 추가합니다. label Jan 25, 2024
@BackInGone BackInGone self-assigned this Jan 25, 2024
Copy link

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 107bb1c. ± Comparison against base commit baf49f1.

Copy link
Member

@meena2003 meena2003 left a comment

Choose a reason for hiding this comment

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

코드에서 불필요한 빈칸이 많이 발견되고 있어요. 전체적으로 코드 라인 정리를 해주시면 좋을듯 합니다!
고생하셨습니다 :) 👍

public class AlarmController {

private final AlarmService alarmService;

Copy link
Member

Choose a reason for hiding this comment

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

한줄이 더 있네요!

private final AlarmService alarmService;


@GetMapping("/v1/member/alarms")
Copy link
Member

Choose a reason for hiding this comment

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

member도 복수형인 s 가 있으면 어떨까요?

NEW_PLACE_REVIEW_COMMENT("새 여행지리뷰 댓글 알림"),
REVIEW_WRITE_REQUEST("리뷰 작성 요청 알림");

private final String message;
Copy link
Member

Choose a reason for hiding this comment

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

각각의 타입마다 message가 있는데 해당 message가 사용되는 곳이 어디인가요? 찾지 못한 것 같아서요

public class AlarmService {

private final AlarmRepository alarmRepository;

Copy link
Member

Choose a reason for hiding this comment

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

여기도 한 칸 띄어져 있습니다!

private String createAlarmArgs(String memberNickname, AlarmType alarmType) {
switch (alarmType) {
case NEW_TRIP_RECORD_REVIEW:
return memberNickname + "님이 여행 후기에 리뷰를 남기셨습니다.";
Copy link
Member

Choose a reason for hiding this comment

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

차라리 "~님이 여행 후기에 리뷰를 남기셨습니다" 라는 문구를 alarmType의 message 형태로 사용하는 건 어떨까요? 지금은 하드코딩의 느낌이 납니다 ㅎㅎ

.alarmType(alarmType)
.windowId(windowId)
.objectId(objectId)
.alarmArgs(alarmArgs)
Copy link
Member

Choose a reason for hiding this comment

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

위에 alarmArgs 변수 선언 대신 바로 인라인 하면 코드가 더 줄어들 것 같아요 :)

@BackInGone BackInGone merged commit ebba4d2 into develop Jan 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능을 추가합니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants