Skip to content

[UPLUS-151] 특정 회선 필터링#2

Merged
k0081915 merged 2 commits into
developfrom
feat/UPLUS-151
Jan 26, 2026
Merged

[UPLUS-151] 특정 회선 필터링#2
k0081915 merged 2 commits into
developfrom
feat/UPLUS-151

Conversation

@k0081915
Copy link
Copy Markdown
Member

🍀 이슈 번호

  • #이슈번호
    UPLUS-151

✅ 작업 사항

  • 특정 회선이 아닌 경우 메모리 DB에 저장 안함

📋 체크리스트

  • 코드가 정상적으로 빌드됩니다.
  • 관련 테스트 코드를 작성했습니다.
  • 기존 테스트가 모두 통과합니다.
  • 코드 스타일(Spotless, Checkstyle)을 준수합니다.

⌨ 기타

api-mock 환경변수 MOCK_TARGET_SUB_IDS , ${MOCK_TARGET_SUB_IDS:1001,1002}

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @k0081915, 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 컨트롤러에 sub_id 기반 메시지 필터링 기능을 도입하여, 지정된 sub_id의 메시지만 처리하고 저장하도록 합니다. 또한, email.html 템플릿의 변수명 일관성을 개선하고 불필요한 요소를 정리하여 전반적인 코드 품질을 향상시켰습니다.

Highlights

  • 특정 회선 필터링 기능 추가: MockController에 특정 sub_id를 가진 메시지만 메모리 DB에 저장하도록 필터링 로직을 추가했습니다. 이는 mock.filter.target-sub-ids 설정으로 제어됩니다.
  • 설정 주입 및 YAML 업데이트: Spring의 @Value 어노테이션을 사용하여 application.yml에 정의된 target-sub-ids 목록을 컨트롤러에 주입하도록 설정했습니다. application.yml에는 해당 속성이 추가되었으며, 환경 변수로 오버라이드할 수 있습니다.
  • HTML 템플릿 변수명 일관성 개선: email.html 템플릿 내의 변수명들을 스네이크 케이스(예: invoice_number)에서 카멜 케이스(예: invoiceNumber)로 변경하여 코드의 일관성과 가독성을 높였습니다.
  • HTML 템플릿 정리: email.html에서 불필요한 th:classappend 속성과 '결제 예정일' 섹션을 제거하고, '추가 정보' 섹션의 레이아웃을 간소화했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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

@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은 특정 subId를 가진 메시지만 저장하도록 필터링 기능을 추가하는 변경 사항을 담고 있습니다. application.yml에 필터링할 ID 목록을 설정하고, MockController에서 이 값을 주입받아 메시지 저장 전에 확인하는 로직이 추가되었습니다. 전반적으로 PR의 목적에 맞게 코드가 잘 작성되었습니다.

몇 가지 개선점을 제안합니다.

  1. targetSubIds 필드의 자료구조를 List 대신 Set으로 변경하여 contains 연산의 성능을 향상시키는 것을 권장합니다.
  2. if 문의 일관된 스타일을 위해 중괄호를 사용하는 것이 좋겠습니다.

이 외에 email.html 템플릿에서 변수명을 snake_case에서 camelCase로 변경하여 일관성을 높인 점은 좋은 리팩토링입니다.

Comment on lines +34 to +35
@Value("${mock.filter.target-sub-ids}")
private List<Long> targetSubIds;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

targetSubIds 필드를 List로 선언하셨습니다. List.contains() 메소드는 시간 복잡도가 O(n)이므로, 필터링할 ID의 개수가 많아지면 성능에 영향을 줄 수 있습니다. contains 연산의 평균 시간 복잡도가 O(1)인 Set을 사용하는 것이 더 효율적입니다. Spring은 application.yml의 콤마로 구분된 문자열을 Set으로 자동 변환해줍니다.

Suggested change
@Value("${mock.filter.target-sub-ids}")
private List<Long> targetSubIds;
@Value("${mock.filter.target-sub-ids}")
private java.util.Set<Long> targetSubIds;

if (value == null) {
return 0L;
}
if (value == null) return 0L;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

if 문을 중괄호 {} 없이 한 줄로 수정하셨습니다. 문법적으로는 유효하지만, 일반적으로는 한 줄 짜리 if 문이라도 항상 중괄호를 사용하는 것이 권장됩니다. 이는 코드 가독성을 높이고, 추후에 if 블록에 코드를 추가할 때 발생할 수 있는 실수를 방지해줍니다. 많은 자바 스타일 가이드에서 이를 규칙으로 정하고 있습니다.

        if (value == null) {
            return 0L;
        }

@github-actions github-actions Bot added feat 새로운 기능 size/S PR size: S labels Jan 26, 2026
Copy link
Copy Markdown
Contributor

@swthewhite swthewhite left a comment

Choose a reason for hiding this comment

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

고생하셨습니다

@github-actions github-actions Bot added the style 코드 스타일 변경 label Jan 26, 2026
@github-actions
Copy link
Copy Markdown

SonarQube Quality Summary (Community)

Quality Gate PASSED

Branch: feat/UPLUS-151
Compared to: default branch

Issues

  • 🐞 Bugs: 0
  • 🔐 Vulnerabilities: 2
  • 📎 Code Smells: 50

Measures

  • Coverage: 0%
  • Duplication: 0%

🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=api-mock&branch=feat/UPLUS-151

Generated automatically by GitHub Actions.

Copy link
Copy Markdown

@starboxxxx starboxxxx left a comment

Choose a reason for hiding this comment

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

고생하셨습니다

@k0081915 k0081915 merged commit 4e35778 into develop Jan 26, 2026
9 checks passed
@k0081915 k0081915 deleted the feat/UPLUS-151 branch January 26, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 새로운 기능 size/S PR size: S style 코드 스타일 변경

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants