[UPLUS-151] 특정 회선 필터링#2
Conversation
Summary of ChangesHello @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 컨트롤러에 Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
이 PR은 특정 subId를 가진 메시지만 저장하도록 필터링 기능을 추가하는 변경 사항을 담고 있습니다. application.yml에 필터링할 ID 목록을 설정하고, MockController에서 이 값을 주입받아 메시지 저장 전에 확인하는 로직이 추가되었습니다. 전반적으로 PR의 목적에 맞게 코드가 잘 작성되었습니다.
몇 가지 개선점을 제안합니다.
targetSubIds필드의 자료구조를List대신Set으로 변경하여contains연산의 성능을 향상시키는 것을 권장합니다.if문의 일관된 스타일을 위해 중괄호를 사용하는 것이 좋겠습니다.
이 외에 email.html 템플릿에서 변수명을 snake_case에서 camelCase로 변경하여 일관성을 높인 점은 좋은 리팩토링입니다.
| @Value("${mock.filter.target-sub-ids}") | ||
| private List<Long> targetSubIds; |
There was a problem hiding this comment.
targetSubIds 필드를 List로 선언하셨습니다. List.contains() 메소드는 시간 복잡도가 O(n)이므로, 필터링할 ID의 개수가 많아지면 성능에 영향을 줄 수 있습니다. contains 연산의 평균 시간 복잡도가 O(1)인 Set을 사용하는 것이 더 효율적입니다. Spring은 application.yml의 콤마로 구분된 문자열을 Set으로 자동 변환해줍니다.
| @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; |
SonarQube Quality Summary (Community)✅ Quality Gate PASSED Branch: Issues
Measures
🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=api-mock&branch=feat/UPLUS-151 Generated automatically by GitHub Actions. |
🍀 이슈 번호
UPLUS-151
✅ 작업 사항
📋 체크리스트
⌨ 기타
api-mock 환경변수 MOCK_TARGET_SUB_IDS , ${MOCK_TARGET_SUB_IDS:1001,1002}