Skip to content

feat: 문자 발송 시 관심 지역 변수 치환 로직 추가#411

Merged
julia98percent merged 3 commits intodevfrom
feature/410
May 15, 2025
Merged

feat: 문자 발송 시 관심 지역 변수 치환 로직 추가#411
julia98percent merged 3 commits intodevfrom
feature/410

Conversation

@julia98percent
Copy link
Collaborator

#️⃣연관된 이슈

#410

📝작업 내용

이번 PR에서 작업한 내용을 간단하게 작성해주세요. 어떻게보다 무엇을 왜 수정했는지 설명해주세요. (이미지 첨부 가능)

📸 스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

@julia98percent julia98percent requested a review from Copilot May 15, 2025 08:10
@julia98percent julia98percent self-assigned this May 15, 2025
@julia98percent julia98percent added the ✨ Feat 새로운 기능 추가 label May 15, 2025
@julia98percent julia98percent changed the title fix: 문자 발송 시 관심 지역 변수 치환 로직 추가 feat: 문자 발송 시 관심 지역 변수 치환 로직 추가 May 15, 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 adds a new substitution logic in the message sending flow to replace template variables with corresponding region names. Key changes include:

  • Enhancements to SendMessageRequestDTO with additional constructors and a withText method.
  • New methods in MessageServiceImpl to process and replace template keys before sending messages.
  • An added repository query in RegionRepository to fetch region names based on a key.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apiserver/service/src/main/java/com/zipline/service/message/dto/request/SendMessageRequestDTO.java Added annotations and a withText method for text substitution.
apiserver/service/src/main/java/com/zipline/service/message/MessageServiceImpl.java Introduced template value replacement logic and integrated it into the sendMessage flow.
apiserver/infrastructure/src/main/java/com/zipline/repository/region/RegionRepository.java Added a new query for fetching the region name based on a provided key.

Comment on lines +73 to +76
if (regionRepository.findCortarNameByCortarNo(key) == null) {
return key;
}
return regionRepository.findCortarNameByCortarNo(key);
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

Consider storing the result of regionRepository.findCortarNameByCortarNo(key) in a variable to avoid performing the same database lookup twice.

Suggested change
if (regionRepository.findCortarNameByCortarNo(key) == null) {
return key;
}
return regionRepository.findCortarNameByCortarNo(key);
String cortarName = regionRepository.findCortarNameByCortarNo(key);
if (cortarName == null) {
return key;
}
return cortarName;

Copilot uses AI. Check for mistakes.
}

@Query("SELECT r.cortarName FROM Region r WHERE r.cortarNo = :cortarNo")
String findCortarNameByCortarNo(@Param("cortarNo") String cortarNoText);
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

[nitpick] Since the region's identifier is numeric in other parts of the repository, consider converting the key to a numeric type (e.g., Long) before querying, or ensure that this type mismatch is intentional.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@Dsys1129 Dsys1129 left a comment

Choose a reason for hiding this comment

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

확인했습니다.

if (regionRepository.findCortarNameByCortarNo(key) == null) {
	      return key;
	    }
	    return regionRepository.findCortarNameByCortarNo(key);

이 쿼리 두번나가는 로직만 수정하시면 될 것 같아요

@julia98percent julia98percent merged commit 4e80a03 into dev May 15, 2025
2 checks passed
@julia98percent julia98percent deleted the feature/410 branch May 15, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feat 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants