fix: jeus 서버를 위한 반영

- System.property 이용 제거
dev
Jonguk. Lim 3 weeks ago
parent f910907d0d
commit a87442a95b

@ -22,31 +22,6 @@ import lombok.*;
*/ */
public class ApiConstants { 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";
/** /**
* <pre> * <pre>
* *

@ -42,13 +42,8 @@ import lombok.extern.slf4j.*;
@Component @Component
public class KkoTalkApiService { public class KkoTalkApiService {
private static final String PROFILE = System.getProperty("spring.profiles.active"); @Value("${spring.profiles.active}")
/** private String PROFILE;
* 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("${contract.kakao.talk.host}") @Value("${contract.kakao.talk.host}")
private String HOST; private String HOST;
@ -83,7 +78,7 @@ public class KkoTalkApiService {
* @return KkotalkDTO.SendResponse * @return KkotalkDTO.SendResponse
*/ */
public ResponseEntity<String> requestSend(final OrgMng orgMng, final KkotalkDTO.SendRequest reqDTO) { public ResponseEntity<String> requestSend(final OrgMng orgMng, final KkotalkDTO.SendRequest reqDTO) {
reqDTO.setProductCode(PRODUCT_CD); reqDTO.setProductCode(getProductCd());
List<String> errors = new ArrayList<>(); List<String> errors = new ArrayList<>();
errors = validate(reqDTO.getEnvelope(), errors); errors = validate(reqDTO.getEnvelope(), errors);
@ -183,7 +178,7 @@ public class KkoTalkApiService {
*/ */
public ResponseEntity<String> requestSendBulk(final OrgMng orgMng, final KkotalkDTO.BulkSendRequest reqDTO) { public ResponseEntity<String> requestSendBulk(final OrgMng orgMng, final KkotalkDTO.BulkSendRequest reqDTO) {
ResponseEntity<String> resEntity = null; ResponseEntity<String> resEntity = null;
reqDTO.setProductCode(PRODUCT_CD); reqDTO.setProductCode(getProductCd());
List<String> errors = new ArrayList<>(); List<String> errors = new ArrayList<>();
@ -374,9 +369,14 @@ public class KkoTalkApiService {
headers.setContentType(new MediaType(MediaType.APPLICATION_JSON, Charset.forName("utf-8"))); headers.setContentType(new MediaType(MediaType.APPLICATION_JSON, Charset.forName("utf-8")));
headers.set(HttpHeaders.AUTHORIZATION, String.format("KakaoAK %s", orgMng.getKakaoDealerRestApiKey())); headers.set(HttpHeaders.AUTHORIZATION, String.format("KakaoAK %s", orgMng.getKakaoDealerRestApiKey()));
headers.set("Target-Authorization", String.format("KakaoAK %s", orgMng.getKakaoPartnerRestApiKey())); 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; return headers;
} }
private String getProductCd() {
final boolean IS_PROFILE_LOCAL = PROFILE.matches("local.*");
return IS_PROFILE_LOCAL ? "D10_1T" : "D10_2";
}
} }

@ -1,4 +1,5 @@
server: server:
port: 18090
shutdown: graceful shutdown: graceful
servlet: servlet:
context-path: context-path:
@ -14,10 +15,16 @@ server:
spring: spring:
profiles: profiles:
active: '@spring.profiles.active@' active: @spring.profiles.active@
config: 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: # main:
# allow-bean-definition-overriding: true # allow-bean-definition-overriding: true

Loading…
Cancel
Save