Skip to content

[FEAT] 알림 도메인 및 알림 페이지 API#326

Merged
1000hyehyang merged 4 commits intodevfrom
feat/216-notification
Feb 8, 2026
Merged

[FEAT] 알림 도메인 및 알림 페이지 API#326
1000hyehyang merged 4 commits intodevfrom
feat/216-notification

Conversation

@1000hyehyang
Copy link
Copy Markdown
Member

Summary

Notification 도메인과 알림 페이지 REST API를 구현했습니다. 푸시·이메일 발송은 다루지 않고, 저장·조회·필터·읽음 처리만 담당합니다.

목표: 알림 레코드를 저장·조회·필터·읽음 처리할 수 있는 도메인과 API를 갖추고, 이후 서브 이슈(이벤트 발행·푸시·이메일)에서 이 API를 그대로 사용할 수 있도록 합니다.

Changes

도메인 계층

  • Notification 엔티티 (UUID PK, DeleteBaseEntity 상속)
  • NotificationKind enum (8종: PROPOSAL_RECEIVED, CAMPAIGN_MATCHED 등)
  • NotificationCategory enum (UI 필터용: PROPOSAL, MATCHING, SETTLEMENT, CHAT)
  • ReferenceType enum (CAMPAIGN_PROPOSAL, CAMPAIGN_APPLY, CAMPAIGN)
  • NotificationRepository (JPQL 벌크 업데이트 포함)
  • NotificationErrorCode (404, 403)

애플리케이션 계층

  • NotificationService (생성, 단건 읽음, 전체 읽기, 소프트 삭제)
  • NotificationQueryService (목록 조회, 미읽음 개수)
  • CreateNotificationCommand (Phase 2 이벤트 리스너용 내부 DTO)

프레젠테이션 계층

  • NotificationController (4개 REST 엔드포인트)
  • NotificationSwagger 인터페이스
  • ✅ Response DTO (record): NotificationResponse, NotificationListResponse, NotificationDateGroup, ReadAllResponse, UnreadCountResponse

API 엔드포인트

  1. GET /api/v1/notifications - 알림 목록 (filter, 페이징, 날짜 그룹)
  2. PATCH /api/v1/notifications/{id}/read - 단건 읽음 처리
  3. PATCH /api/v1/notifications/read-all - 전체 읽기 (벌크 UPDATE)
  4. GET /api/v1/notifications/unread-count - 미읽음 개수

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

Closes #216

참고 사항

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @1000hyehyang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 알림 도메인과 관련 REST API를 구현하여, 사용자가 알림을 저장, 조회, 필터링하고 읽음 처리할 수 있도록 합니다. 푸시 또는 이메일 발송 기능은 포함되지 않으며, 향후 이벤트 발행 등의 서브 이슈에서 이 API를 활용할 수 있도록 기반을 마련합니다.

Highlights

  • 알림 도메인 모델 정의: UUID를 기본 키로 사용하는 Notification 엔티티와 DeleteBaseEntity 상속을 통해 소프트 삭제 기능을 포함합니다.
  • 알림 종류 및 카테고리 분류: NotificationKind (8가지 세부 종류)와 UI 필터링을 위한 NotificationCategory (PROPOSAL, MATCHING, SETTLEMENT, CHAT)를 정의하여 알림을 체계적으로 관리합니다.
  • 알림 서비스 로직 구현: 알림 생성, 단건 읽음 처리, 전체 읽음 처리 (벌크 업데이트), 소프트 삭제 기능을 제공하는 NotificationService를 구현했습니다.
  • 알림 조회 및 필터링 기능: NotificationQueryService를 통해 사용자별 알림 목록 조회, 카테고리 필터링, 미읽음 알림 개수 조회 기능을 지원합니다.
  • REST API 엔드포인트 제공: 알림 목록 조회, 단건 읽음 처리, 전체 읽음 처리, 미읽음 개수 조회 등 4가지 주요 REST API 엔드포인트를 구현하여 프레젠테이션 계층을 완성했습니다.
  • 전용 DTO 및 에러 코드: 알림 생성 커맨드 DTO, 다양한 응답 DTO (목록, 날짜 그룹, 읽음 처리 결과, 미읽음 개수) 및 전용 에러 코드(NotificationErrorCode)를 추가하여 API의 견고성을 높였습니다.
Changelog
  • src/main/java/com/example/RealMatch/notification/application/dto/CreateNotificationCommand.java
    • 알림 생성을 위한 내부 DTO를 추가했습니다.
  • src/main/java/com/example/RealMatch/notification/application/service/NotificationQueryService.java
    • 알림 목록 조회, 필터링, 미읽음 개수 조회 기능을 제공하는 서비스 로직을 구현했습니다.
  • src/main/java/com/example/RealMatch/notification/application/service/NotificationService.java
    • 알림 생성, 읽음 처리, 전체 읽음 처리, 소프트 삭제 기능을 담당하는 서비스 로직을 구현했습니다.
  • src/main/java/com/example/RealMatch/notification/domain/entity/Notification.java
    • 알림 엔티티를 정의했습니다. UUID PK, DeleteBaseEntity 상속, isRead 필드 등을 포함합니다.
  • src/main/java/com/example/RealMatch/notification/domain/entity/enums/NotificationCategory.java
    • 알림을 UI에서 필터링하기 위한 카테고리 Enum을 정의했습니다.
  • src/main/java/com/example/RealMatch/notification/domain/entity/enums/NotificationKind.java
    • 알림의 세부 종류를 정의하고 각 종류를 NotificationCategory에 매핑했습니다.
  • src/main/java/com/example/RealMatch/notification/domain/entity/enums/ReferenceType.java
    • 알림이 참조하는 객체의 타입을 정의하는 Enum을 추가했습니다.
  • src/main/java/com/example/RealMatch/notification/domain/repository/NotificationRepository.java
    • Notification 엔티티를 위한 JPA Repository를 정의하고, 미읽음 개수 조회 및 벌크 읽음 처리 쿼리를 추가했습니다.
  • src/main/java/com/example/RealMatch/notification/exception/NotificationErrorCode.java
    • 알림 관련 예외 처리를 위한 전용 에러 코드를 정의했습니다.
  • src/main/java/com/example/RealMatch/notification/presentation/controller/NotificationController.java
    • 알림 관련 REST API 엔드포인트를 처리하는 컨트롤러를 구현했습니다.
  • src/main/java/com/example/RealMatch/notification/presentation/dto/response/NotificationDateGroup.java
    • 알림을 날짜별로 그룹화하여 응답하기 위한 레코드를 추가했습니다.
  • src/main/java/com/example/RealMatch/notification/presentation/dto/response/NotificationListResponse.java
    • 알림 목록 조회 API의 응답 DTO를 정의했습니다.
  • src/main/java/com/example/RealMatch/notification/presentation/dto/response/NotificationResponse.java
    • 단일 알림 정보를 담는 응답 DTO를 정의했습니다.
  • src/main/java/com/example/RealMatch/notification/presentation/dto/response/ReadAllResponse.java
    • 전체 알림 읽음 처리 API의 응답 DTO를 정의했습니다.
  • src/main/java/com/example/RealMatch/notification/presentation/dto/response/UnreadCountResponse.java
    • 미읽음 알림 개수 조회 API의 응답 DTO를 정의했습니다.
  • src/main/java/com/example/RealMatch/notification/presentation/swagger/NotificationSwagger.java
    • 알림 API의 Swagger 문서화를 위한 인터페이스를 정의했습니다.
Activity
  • 이 PR에는 아직 리뷰어 활동이나 추가적인 코멘트가 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 알림 도메인과 관련 API를 구현한 것으로, 전반적으로 구조가 잘 잡혀있고 기능 구현이 명확합니다. 특히 도메인, 애플리케이션, 프레젠테이션 계층의 분리가 잘 되어 있으며, Swagger를 통한 API 문서화도 훌륭합니다. 코드의 유지보수성과 안정성을 더욱 높이기 위해 유효하지 않은 입력값에 대한 오류 처리 방식 개선, 중복 코드 제거를 위한 리팩토링, 그리고 Enum 관련 로직의 성능 최적화에 대한 의견을 포함했습니다. 전반적으로 훌륭한 작업입니다.

@1000hyehyang 1000hyehyang merged commit c25708c into dev Feb 8, 2026
1 check passed
@1000hyehyang 1000hyehyang deleted the feat/216-notification branch February 8, 2026 12:46
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.

[FEAT] 알림 도메인 및 알림 페이지 API

1 participant