Skip to content

Conversation

@jsoonworld
Copy link
Member

📄 Work Description

  • Message.of(template, params) 방식으로 메시지 생성 책임을 내부로 이동함에 따라, 기존 테스트 코드 리팩토링
  • 메인 메시지도 향후 포맷팅 확장을 고려하여 params를 기반으로 전달하도록 변경
  • 실패 케이스 또한 Message.of() 내부에서 포맷 로직이 실행되며 예외가 발생하도록 변경

💬 To Reviewers

  • 메인 메시지에 현재는 파라미터가 없지만, 확장을 고려해 동일한 포맷 구조를 유지했습니다
  • 테스트에서 직접 포맷하지 않고 Message.of()를 통해 메시지를 생성하도록 일관성을 맞췄습니다

📷 Screenshot

스크린샷 2025-03-29 오후 4 06 05

⚙️ ISSUE

✅ PR check list

  • Reviewers
  • Assignees
  • Labels

- Message.of(template, params) 형태로 개선하여 외부에서 포맷된 메시지를 넘기던 방식 제거
- 메인/서브 메시지의 포맷 책임을 Message 내부로 위임하여 응집도 향상
- 메인 메시지도 확장성 고려해 파라미터 기반 포맷 구조로 통일
- Message.of(template, params) 사용 방식에 맞게 테스트 코드 전반 수정
- 메인 메시지도 파라미터 기반 포맷 구조를 사용하므로 null 대신 VALID_PARAMS 전달
- 실패 케이스에서도 Message 내부 포맷 로직을 테스트하도록 변경
@jsoonworld jsoonworld added ♻️ refactor 코드 리팩토링 ex) 형식변경 🦊장순🦊 labels Mar 29, 2025
@jsoonworld jsoonworld self-assigned this Mar 29, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the message formatting logic by moving it internally into Message.of to improve encapsulation and cohesion, and it introduces the FCM token update flow with corresponding service, controller, and test updates.

  • Refactored Message.of to accept a parameter map for consistent message creation.
  • Added FCM token update endpoints and logic in the domain and application layers.
  • Removed obsolete configuration files and updated FCM initialization in a new package.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/test/java/org/terning/user/application/fcmtoken/update/FcmTokenUpdateServiceImplTest.java New tests for FCM token update service.
src/test/java/org/terning/message/domain/MessageTest.java Updated message tests to use Message.of with params.
src/main/java/org/terning/user/dto/request/UpdateFcmTokenRequest.java New DTO record for FCM token update requests.
src/main/java/org/terning/user/domain/vo/FcmToken.java Added updateValue method for token updates.
src/main/java/org/terning/user/domain/User.java Updated to delegate token update to the new FCM token method.
src/main/java/org/terning/user/common/success/UserSuccessCode.java Added new success code for token update.
src/main/java/org/terning/user/application/fcmtoken/update/FcmTokenUpdateServiceImpl.java New service implementation for handling FCM token updates.
src/main/java/org/terning/user/api/UserController.java New endpoint to update FCM tokens.
src/main/java/org/terning/message/domain/Message.java Refactored to generate messages internally using formatting parameters.
src/main/java/org/terning/fcm/config/FcmConfig.java Moved FCM configuration to a new package with minor adjustments.
src/main/java/org/terning/TerningApplication.java Removed deprecated configuration for FCM properties.
Comments suppressed due to low confidence (1)

src/main/java/org/terning/fcm/config/FcmConfig.java:16

  • FcmProperties is being referenced in the annotation but is not imported, and its original file was removed. Please ensure that FcmProperties is available at the new location or update the reference and import statement accordingly.
@EnableConfigurationProperties(FcmProperties.class)

@jsoonworld jsoonworld changed the base branch from develop to feat/#47-after March 29, 2025 07:10
@pull-request-size pull-request-size bot added size/M and removed size/L labels Mar 29, 2025
Copy link
Contributor

@junggyo1020 junggyo1020 left a comment

Choose a reason for hiding this comment

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

코드리뷰 빠른 반영 좋아요!!! :)

@jsoonworld jsoonworld merged commit 7dfc459 into feat/#47-after Apr 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor 코드 리팩토링 ex) 형식변경 size/M 🦊장순🦊

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[♻️ refactor] 메시지 포맷 로직을 내부로 이동하여 생성 책임 명확화 및 응집도 개선

3 participants