Skip to content

feat: 알림 모두 읽음 처리 API 추가 - #374

Merged
hd0rable merged 1 commit into
developfrom
feat/notification-mark-all-read
Aug 7, 2026
Merged

feat: 알림 모두 읽음 처리 API 추가#374
hd0rable merged 1 commit into
developfrom
feat/notification-mark-all-read

Conversation

@hd0rable

@hd0rable hd0rable commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • 유저가 자신의 읽지 않은 모든 알림을 한 번에 읽음 처리하는 POST /notifications/check-all API 추가
  • 단건 읽음 처리(POST /notifications/check)와 동일한 계층 구조(Controller → UseCase → Service → Port → Adapter)를 따름
  • NotificationJpaRepository@Modifying JPQL 벌크 업데이트 쿼리 추가 (is_checked=false인 알림만 대상)

Test plan

  • ./gradlew compileJava 성공
  • NotificationMarkAllToCheckedApiTest 신규 작성 및 통과 (본인 알림만 읽음 처리, 타 유저 알림 미영향 / 읽지 않은 알림 없을 때도 정상 동작)
  • konkuk.thip.notification.* 전체 테스트 통과 (회귀 없음)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 새 기능

    • 모든 알림을 한 번에 읽음 처리할 수 있는 기능을 추가했습니다.
    • 본인의 알림만 읽음 처리되며, 읽지 않은 알림이 없어도 정상적으로 완료됩니다.
  • 테스트

    • 전체 알림 읽음 처리와 사용자별 적용 범위를 검증하는 통합 테스트를 추가했습니다.

유저가 자신의 읽지 않은 모든 알림을 한 번에 읽음 처리할 수 있도록
POST /notifications/check-all 엔드포인트를 추가한다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 39bbb235-81d7-48fb-b40b-35b7873fb2d5

📥 Commits

Reviewing files that changed from the base of the PR and between 3a7af51 and b744eaf.

📒 Files selected for processing (8)
  • src/main/java/konkuk/thip/common/swagger/SwaggerResponseDescription.java
  • src/main/java/konkuk/thip/notification/adapter/in/web/NotificationCommandController.java
  • src/main/java/konkuk/thip/notification/adapter/out/persistence/NotificationCommandPersistenceAdapter.java
  • src/main/java/konkuk/thip/notification/adapter/out/persistence/repository/NotificationJpaRepository.java
  • src/main/java/konkuk/thip/notification/application/port/in/NotificationMarkUseCase.java
  • src/main/java/konkuk/thip/notification/application/port/out/NotificationCommandPort.java
  • src/main/java/konkuk/thip/notification/application/service/NotificationMarkService.java
  • src/test/java/konkuk/thip/notification/adapter/in/web/NotificationMarkAllToCheckedApiTest.java

Walkthrough

사용자별 모든 미확인 알림을 읽음 상태로 변경하는 POST /notifications/check-all API를 추가했습니다. 애플리케이션 포트와 영속성 계층을 연결하고, 대상 사용자와 빈 알림 상태를 검증하는 통합 테스트를 추가했습니다.

Changes

알림 전체 읽음 처리

Layer / File(s) Summary
API 및 애플리케이션 처리
src/main/java/konkuk/thip/notification/adapter/in/web/NotificationCommandController.java, src/main/java/konkuk/thip/notification/application/..., src/main/java/konkuk/thip/common/swagger/SwaggerResponseDescription.java
POST /notifications/check-all이 인증된 사용자 ID로 markAllToChecked를 호출합니다. 유스케이스, 서비스, 출력 포트에 일괄 처리 메서드를 추가했습니다. Swagger 응답 설명도 추가했습니다.
일괄 영속성 처리 및 통합 검증
src/main/java/konkuk/thip/notification/adapter/out/persistence/..., src/test/java/konkuk/thip/notification/adapter/in/web/NotificationMarkAllToCheckedApiTest.java
사용자 ID와 미확인 상태를 조건으로 알림을 일괄 갱신합니다. 대상 사용자 알림만 변경되는지와 변경할 알림이 없어도 성공하는지를 검증합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant NotificationCommandController
  participant NotificationMarkService
  participant NotificationJpaRepository

  Client->>NotificationCommandController: POST /notifications/check-all
  NotificationCommandController->>NotificationMarkService: markAllToChecked(userId)
  NotificationMarkService->>NotificationJpaRepository: 미확인 알림 일괄 갱신
  NotificationJpaRepository-->>NotificationMarkService: 변경 행 수 반환
  NotificationMarkService-->>NotificationCommandController: 처리 완료
  NotificationCommandController-->>Client: 200 OK
Loading

Possibly related PRs

Poem

토끼가 알림밭을 한 바퀴 돌아
미확인 표식을 모두 지워요.
내 알림만 살며시 체크하고
빈 밭에도 성공을 남겨요.
깡충, 읽음 처리가 끝났어요!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 알림 전체 읽음 처리 API 추가라는 변경 사항의 핵심을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/notification-mark-all-read

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.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Test Results

500 tests   500 ✅  46s ⏱️
149 suites    0 💤
149 files      0 ❌

Results for commit b744eaf.

@hd0rable
hd0rable merged commit 78f7fd3 into develop Aug 7, 2026
4 checks passed
@hd0rable
hd0rable deleted the feat/notification-mark-all-read branch August 7, 2026 14:00
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.

1 participant