From 4a9a0a86f64fe1e22f08e768ecbb5c703ca78f39 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 5 Jan 2024 14:07:48 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=B8=EC=99=B8=EC=88=98=EC=9E=85=20?= =?UTF-8?q?=EC=97=B0=EA=B3=84=20=EC=9A=94=EC=B2=AD=EC=97=AC=EB=B6=80=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/interfaces/lntris/InterfaceConfig.java | 18 +++++++++++++++++- .../cokr/xit/interfaces/lntris/Requestor.java | 6 ++---- src/main/resources/intf-conf/lntris.conf | 3 ++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java b/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java index cd356d9..bd1d8b2 100644 --- a/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java +++ b/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java @@ -38,7 +38,9 @@ public class InterfaceConfig extends AbstractComponent { } } - private boolean useDatabase = true; + private boolean + useDatabase = true, + sendRequest = true; /**데이터베이스 사용여부를 설정한다. * @param useDatabase 데이터베이스 사용여부 @@ -47,6 +49,20 @@ public class InterfaceConfig extends AbstractComponent { this.useDatabase = !"false".equals(useDatabase); } + /**세외수입 연계 요청의 전송여부를 반환한다. + * @return 세외수입 연계 요청의 전송여부 + */ + public static boolean sendRequest() { + return conf.sendRequest; + } + + /**세외수입 연계 요청의 전송여부를 설정한다. + * @param sendRequest 세외수입 연계 요청의 전송여부 + */ + public void setSendRequest(String sendRequest) { + this.sendRequest = !"false".equals(sendRequest); + } + /** 지자체 시스템 설정 */ private List locals; /** 지방세외수입 시스템 설정 */ diff --git a/src/main/java/cokr/xit/interfaces/lntris/Requestor.java b/src/main/java/cokr/xit/interfaces/lntris/Requestor.java index dd2f63d..81151b7 100644 --- a/src/main/java/cokr/xit/interfaces/lntris/Requestor.java +++ b/src/main/java/cokr/xit/interfaces/lntris/Requestor.java @@ -59,6 +59,7 @@ public class Requestor { * @param intfInfo 세외수입 연계정보 */ public void request(InterfaceInfo intfInfo) { + if (!InterfaceConfig.sendRequest()) return; try { init(); @@ -80,10 +81,7 @@ public class Requestor { ); String body = hresp.body(); Log.get(Requestor.class).debug("targetMessage:\n{}", body); -/* - if (WebClient.Request.SUCCESS != hresp.statusCode()) - throw new RuntimeException(intfInfo.interfaceID() + ": " + hresp.statusCode()); -*/ + intfInfo .json(json) .parseTargetMessage(body); diff --git a/src/main/resources/intf-conf/lntris.conf b/src/main/resources/intf-conf/lntris.conf index b5a116f..07de191 100644 --- a/src/main/resources/intf-conf/lntris.conf +++ b/src/main/resources/intf-conf/lntris.conf @@ -1,5 +1,6 @@ { - "useDatabase": false, + "useDatabase": true, + "sendRequest": false, "locals": [ {"organization": "4060000",/* 지역 자치단체 코드(7자리) */