Skip to content

refactor: sendKeywordNotification 메소드 리팩토링#2203

Closed
Soundbar91 wants to merge 2 commits intofeat/2191-separate-keyword-notification-threadfrom
refactor/2201-send-keyword-notification
Closed

refactor: sendKeywordNotification 메소드 리팩토링#2203
Soundbar91 wants to merge 2 commits intofeat/2191-separate-keyword-notification-threadfrom
refactor/2201-send-keyword-notification

Conversation

@Soundbar91
Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 commented Mar 30, 2026

🔍 개요


🚀 주요 변경 내용

KeywordNotificationRequest updateNotification 자료형 수정

  • KeywordService의 sendKeywordNotification 메소드에서 distinct 메소드를 통해 updateNotification으로 넘어오는 id 값 중복 제거
  • 해당 로직 간결화를 위해 자료형을 List에서 Set으로 수정 (Jackson 역직렬화 과정에서 중복제거)

유효성 검증 로직 삭제

var articleById = fetchedArticles.stream()
    .collect(Collectors.toMap(Article::getId, article -> article));

List<Article> articles = updateNotificationIds.stream()
    .map(articleId -> {
        Article article = articleById.get(articleId);
        if (article == null) {
            throw ArticleNotFoundException.withDetail("articleId: " + articleId);
        }
        return article;
    })
    .toList();
  • DB에서 조회된 Article들의 Id와 요청값으로 들어온 articlesId의 유효성 검증 로직으로 확인
  • 과도한 방어 로직이라 판단하여 삭제

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e398ec02-e0a2-4b94-918a-0445ac00b1d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/2201-send-keyword-notification

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added 공통 백엔드 공통으로 작업할 이슈입니다. 리팩터링 리팩터링을 위한 이슈입니다 labels Mar 30, 2026
@Soundbar91 Soundbar91 marked this pull request as draft March 30, 2026 07:07
@Soundbar91 Soundbar91 changed the title Refactor/2201 send keyword notification refactor: sendKeywordNotification 메소드 리팩토링 Mar 30, 2026
@Soundbar91 Soundbar91 self-assigned this Mar 30, 2026
@Soundbar91 Soundbar91 closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

공통 백엔드 공통으로 작업할 이슈입니다. 리팩터링 리팩터링을 위한 이슈입니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant