Skip to content

feat(#327): 알림 설정 조회 및 수정 기능 추가#339

Merged
ParkJiYeoung8297 merged 5 commits intodevfrom
feat/#327-alarm-notification-setting
Feb 8, 2026
Merged

feat(#327): 알림 설정 조회 및 수정 기능 추가#339
ParkJiYeoung8297 merged 5 commits intodevfrom
feat/#327-alarm-notification-setting

Conversation

@ParkJiYeoung8297
Copy link
Copy Markdown
Contributor

@ParkJiYeoung8297 ParkJiYeoung8297 commented Feb 8, 2026

Summary

알림 설정 조회 및 수정 기능 추가

Changes

  • 알림 설정 조회
  • 알림 수정 기능 추가

Type of Change

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

Related Issues

참고 사항

# Conflicts:
#	src/main/java/com/example/RealMatch/user/domain/entity/NotificationSetting.java
#	src/main/java/com/example/RealMatch/user/domain/entity/enums/TermName.java
#	src/main/java/com/example/RealMatch/user/domain/repository/NotificationSettingRepository.java
@ParkJiYeoung8297 ParkJiYeoung8297 self-assigned this Feb 8, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ParkJiYeoung8297, 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은 사용자가 자신의 알림 설정을 조회하고 수정할 수 있는 기능을 도입합니다. 앱 푸시, 이메일, 마케팅 동의와 같은 알림 채널에 대한 사용자별 설정을 관리할 수 있도록 새로운 서비스 로직, API 엔드포인트, 관련 엔티티 및 저장소 변경 사항이 포함됩니다. 이는 사용자 경험을 개선하고 개인화된 알림 관리를 가능하게 합니다.

Highlights

  • 새로운 알림 설정 서비스: 사용자 알림 설정을 관리하는 NotificationSettingService가 추가되었습니다. 이 서비스는 알림 설정 조회 및 업데이트 로직을 포함합니다.
  • 알림 설정 API 엔드포인트 추가: 사용자 알림 설정을 조회하고 수정하기 위한 새로운 REST API 엔드포인트 (GET /api/v1/users/me/notification-settings, PUT /api/v1/users/me/notification-settings)가 추가되었습니다.
  • TermName 열거형 개선: TermName 열거형에 displayName 필드가 추가되어 각 약관에 대한 설명이 명확해졌습니다.
  • NotificationChannel 열거형 수정: NotificationChannel 열거형에서 SMS 채널이 제거되어 PUSHEMAIL만 남았습니다.
  • 새로운 오류 코드 추가: 알림 설정을 찾을 수 없을 때 발생하는 USER_NOTIFICATION_SETTING_NOT_FOUND와 유효하지 않은 약관에 대한 INVALID_TERM 오류 코드가 UserErrorCode에 추가되었습니다.
  • 알림 설정 DTO 정의: 알림 설정 업데이트 요청 (NotificationSettingUpdateRequest) 및 응답 (NotificationSettingResponse)을 위한 새로운 DTO가 정의되었습니다.
Changelog
  • src/main/java/com/example/RealMatch/user/application/service/NotificationSettingService.java
    • 사용자 알림 설정을 관리하는 새로운 서비스 클래스가 추가되었습니다. 이 서비스는 알림 설정 조회 및 업데이트 로직을 포함합니다.
  • src/main/java/com/example/RealMatch/user/domain/entity/enums/NotificationChannel.java
    • 알림 채널 열거형에서 SMS 옵션이 제거되어 PUSHEMAIL만 남았습니다.
  • src/main/java/com/example/RealMatch/user/domain/entity/enums/TermName.java
    • 약관 이름 열거형에 displayName 필드가 추가되었고, 각 약관에 대한 설명이 정의되었습니다.
  • src/main/java/com/example/RealMatch/user/domain/repository/NotificationSettingRepository.java
    • 특정 사용자 ID로 알림 설정을 조회하는 findOneByUserId 메서드가 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/domain/repository/TermRepository.java
    • 약관 이름으로 약관을 조회하는 findByName 메서드가 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/domain/repository/UserTermRepository.java
    • 사용자 ID와 약관 이름으로 사용자 약관을 조회하는 findByUserIdAndTermName 메서드가 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/presentation/code/UserErrorCode.java
    • 알림 설정을 찾을 수 없을 때 발생하는 USER_NOTIFICATION_SETTING_NOT_FOUND 오류 코드가 추가되었습니다.
    • 유효하지 않은 약관에 대한 INVALID_TERM 오류 코드가 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/presentation/controller/NotificationSettingController.java
    • 사용자 알림 설정을 조회하고 수정하는 REST API를 제공하는 새로운 컨트롤러가 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/presentation/dto/request/NotificationSettingUpdateRequest.java
    • 알림 설정 업데이트 요청을 위한 DTO가 추가되었습니다. 마케팅 동의, 앱 푸시, 이메일 활성화 여부를 포함합니다.
  • src/main/java/com/example/RealMatch/user/presentation/dto/response/NotificationSettingResponse.java
    • 알림 설정 조회 응답을 위한 DTO가 추가되었습니다. 마케팅 동의, 앱 푸시, 이메일 활성화 여부를 포함합니다.
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은 알림 설정 조회 및 수정 기능을 추가합니다. 보안 취약점이나 중대한 문제는 발견되지 않았습니다. 전반적으로 코드가 잘 작성되었지만, 가독성 향상과 중복 코드 제거를 위해 몇 가지 개선점을 제안합니다. NotificationSettingRepository에 중복된 메서드가 있으며, NotificationSettingService의 마케팅 동의 처리 로직을 더 명확하게 개선할 수 있습니다.

Comment on lines +76 to +99
boolean wantMarketingConsent = request.isMarketingConsent();

// Case 1: 동의 안 함 → 기존 row 있으면 삭제
if (!wantMarketingConsent) {
optionalUserTerm.ifPresent(userTermRepository::delete);
return;
}

// Case 2: 동의 함 → 기존 row 없으면 생성
if (optionalUserTerm.isEmpty()) {
Term marketingTerm = termRepository
.findByName(MARKETING_TERM_NAME)
.orElseThrow(() ->
new CustomException(UserErrorCode.INVALID_TERM)
);

UserTerm newUserTerm = UserTerm.builder()
.user(setting.getUser())
.term(marketingTerm)
.isAgreed(true)
.build();

userTermRepository.save(newUserTerm);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

마케팅 수신 동의 여부를 처리하는 로직이 return을 사용하여 두 부분으로 나뉘어 있어 흐름을 파악하기 다소 어렵습니다. if-else if 구조를 사용하여 동의/비동의 케이스를 명확하게 분리하면 가독성을 높일 수 있습니다.

        boolean wantMarketingConsent = request.isMarketingConsent();
        boolean hasMarketingConsent = optionalUserTerm.isPresent();

        // Case 1: 동의 함 → 기존 row 없으면 생성
        if (wantMarketingConsent && !hasMarketingConsent) {
            Term marketingTerm = termRepository
                    .findByName(MARKETING_TERM_NAME)
                    .orElseThrow(() ->
                            new CustomException(UserErrorCode.INVALID_TERM)
                    );

            UserTerm newUserTerm = UserTerm.builder()
                    .user(setting.getUser())
                    .term(marketingTerm)
                    .isAgreed(true)
                    .build();

            userTermRepository.save(newUserTerm);
        } else if (!wantMarketingConsent && hasMarketingConsent) { // Case 2: 동의 안 함 → 기존 row 있으면 삭제
            optionalUserTerm.ifPresent(userTermRepository::delete);
        }

public interface NotificationSettingRepository extends JpaRepository<NotificationSetting, Long> {

Optional<NotificationSetting> findByUserId(Long userId);
Optional<NotificationSetting> findOneByUserId(Long userId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

findOneByUserId 메서드는 이미 동일한 기능을 하는 findByUserId 메서드가 존재하므로 중복됩니다. user_id는 유니크 제약조건이 있으므로 findByUserIdOptional<NotificationSetting>을 반환하는 것은 올바른 시그니처입니다. 코드의 일관성을 유지하고 중복을 피하기 위해 새로 추가된 findOneByUserId 메서드를 삭제하고, 대신 findByUserId를 사용해주세요.

@ParkJiYeoung8297 ParkJiYeoung8297 merged commit c5a1abb into dev Feb 8, 2026
1 check passed
@ParkJiYeoung8297 ParkJiYeoung8297 deleted the feat/#327-alarm-notification-setting branch February 8, 2026 19:39
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