diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/ApiConstants.java b/src/main/java/cokr/xit/ens/modules/kkotalk/ApiConstants.java index b770edf..e169ce7 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/ApiConstants.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/ApiConstants.java @@ -22,31 +22,6 @@ import lombok.*; */ public class ApiConstants { - /** - * profile - */ - public static final String PROFILE = System.getProperty("spring.profiles.active"); - /** - * profile : local 여부 - */ - public static final boolean IS_PROFILE_LOCAL = PROFILE.matches("local.*"); - - /** - * profile : 춘천 시스템 여부 - */ - public static final boolean IS_CCN = PROFILE.matches(".*-ccn"); - public static final String FFNLN_CODE = "11"; - - /** - * 구분자 없는 date-time 포맷 - */ - public static final String FMT_DT_EMPTY_DLT = "yyyyMMddHHmmss"; - - /** - * date-time 표준 포맷 - */ - public static final String FMT_DT_STD = "yyyy-MM-dd HH:mm:ss"; - /** *
      * 문서 조회 버튼의 명칭을 구분하기 위한 값
diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkApiService.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkApiService.java
index b4d46d0..008cbbd 100644
--- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkApiService.java
+++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkApiService.java
@@ -42,13 +42,8 @@ import lombok.extern.slf4j.*;
 @Component
 public class KkoTalkApiService {
 
-    private static final String PROFILE = System.getProperty("spring.profiles.active");
-    /**
-     * profile : local 여부
-     */
-    private static final boolean IS_PROFILE_LOCAL = PROFILE.matches("local.*");
-    private static final String PRODUCT_CD = IS_PROFILE_LOCAL ? "D10_1T" : "D10_2";
-
+    @Value("${spring.profiles.active}")
+    private String PROFILE;
 
     @Value("${contract.kakao.talk.host}")
     private String HOST;
@@ -83,7 +78,7 @@ public class KkoTalkApiService {
      * @return KkotalkDTO.SendResponse
      */
     public ResponseEntity requestSend(final OrgMng orgMng, final KkotalkDTO.SendRequest reqDTO) {
-        reqDTO.setProductCode(PRODUCT_CD);
+        reqDTO.setProductCode(getProductCd());
 
         List errors = new ArrayList<>();
         errors = validate(reqDTO.getEnvelope(), errors);
@@ -183,7 +178,7 @@ public class KkoTalkApiService {
      */
     public ResponseEntity requestSendBulk(final OrgMng orgMng, final KkotalkDTO.BulkSendRequest reqDTO) {
         ResponseEntity resEntity = null;
-        reqDTO.setProductCode(PRODUCT_CD);
+        reqDTO.setProductCode(getProductCd());
 
         List errors = new ArrayList<>();
 
@@ -374,9 +369,14 @@ public class KkoTalkApiService {
         headers.setContentType(new MediaType(MediaType.APPLICATION_JSON, Charset.forName("utf-8")));
         headers.set(HttpHeaders.AUTHORIZATION, String.format("KakaoAK %s", orgMng.getKakaoDealerRestApiKey()));
         headers.set("Target-Authorization", String.format("KakaoAK %s", orgMng.getKakaoPartnerRestApiKey()));
-        headers.set("settle-Id", IS_PROFILE_LOCAL ? orgMng.getKakaoDevSettleId() : orgMng.getKakaoProdSettleId());
+        headers.set("settle-Id", PROFILE.matches("local.*") ? orgMng.getKakaoDevSettleId() : orgMng.getKakaoProdSettleId());
 
         return headers;
     }
 
+    private String getProductCd() {
+        final boolean IS_PROFILE_LOCAL = PROFILE.matches("local.*");
+        return IS_PROFILE_LOCAL ? "D10_1T" : "D10_2";
+    }
+
 }
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 95ffd1d..6ca66df 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,4 +1,5 @@
 server:
+  port: 18090
   shutdown: graceful
   servlet:
     context-path:
@@ -14,10 +15,16 @@ server:
 
 spring:
   profiles:
-    active: '@spring.profiles.active@'
+    active: @spring.profiles.active@
 
   config:
-    import: classpath:config/conf-app.yml, classpath:config/conf-contract.yml, classpath:config/conf-log.yml, classpath:config/conf-mybatis.yml, classpath:config/conf-policy.yml, classpath:config/conf-slack.yml
+    import:
+      - classpath:config/conf-app.yml
+      - classpath:config/conf-contract.yml
+      - classpath:config/conf-log.yml
+      - classpath:config/conf-mybatis.yml
+      - classpath:config/conf-policy.yml
+      - classpath:config/conf-slack.yml
   #  main:
   #    allow-bean-definition-overriding: true