diff --git a/src/main/java/com/project/mock/controller/MockController.java b/src/main/java/com/project/mock/controller/MockController.java index 04580e0..22d5c1b 100644 --- a/src/main/java/com/project/mock/controller/MockController.java +++ b/src/main/java/com/project/mock/controller/MockController.java @@ -7,6 +7,7 @@ import java.util.UUID; import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.DeleteMapping; @@ -30,6 +31,9 @@ public class MockController { private final MockMessageRepository repository; + @Value("${mock.filter.target-sub-ids}") + private List targetSubIds; + // ========================================== // [API] External System Inbound (From api-message) // ========================================== @@ -56,6 +60,11 @@ private void saveMessage(String type, String defaultSender, Map // sub_id 파싱 (없으면 0으로 처리하여 에러 방지) Long subId = parseLong(request.get("sub_id")); + if (!targetSubIds.contains(subId)) { + log.debug("🚫 Ignored message for non-target subId: {}", subId); + return; + } + // [수정된 부분] 타입에 따라 '수신자(receiver)' 필드에 넣을 값을 결정 String receiver = "Unknown"; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 48c5de3..1d97f10 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -40,3 +40,7 @@ logging: root: INFO org.springframework.web: INFO org.hibernate.SQL: WARN + +mock: + filter: + target-sub-ids: ${MOCK_TARGET_SUB_IDS:1001,1002} \ No newline at end of file diff --git a/src/main/resources/templates/email.html b/src/main/resources/templates/email.html index 26ac025..57ba26a 100644 --- a/src/main/resources/templates/email.html +++ b/src/main/resources/templates/email.html @@ -40,7 +40,7 @@

휴대폰 요금 청구서

청구 번호
-
INV-2023-11-001
+
INV-2023-11-001
@@ -50,17 +50,17 @@

휴대폰 요금 청구서

고객 정보

-

고객명: 홍길동

-

연락처: 010-0000-0000

-

이메일: email@test.com

-

요금제: 요금제명

+

고객명: 홍길동

+

연락처: 010-0000-0000

+

이메일: email@test.com

+

요금제: 요금제명

청구 정보

-

청구 날짜: 2023년 11월 15일

-

납기일: 2023년 11월 30일

+

청구 날짜: 2023년 11월 15일

+

납기일: 2023년 11월 30일

@@ -74,7 +74,7 @@

청구 요약

총 청구 금액 -
89,500원
+
89,500원
@@ -105,7 +105,6 @@

요금 상세 내역

3,300원 @@ -121,29 +120,25 @@

요금 상세 내역

청구 상태
- 결제 완료 - 미납 (납부 필요)
-
- 결제 예정일 -
2023년 11월 25일
-

추가 정보

-
+

유의사항