From ea41d7aa40940aaa1f8c73f2d76d11fb0e0c49ff Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 17 Nov 2023 13:38:56 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=9C=EB=B3=84,=20=ED=8A=B9=ED=99=94=20?= =?UTF-8?q?=EB=8F=99=EC=8B=9C=20=EC=A7=80=EC=9B=90=EC=9D=84=20=EC=9C=84?= =?UTF-8?q?=ED=95=9C=20=EC=84=A4=EC=A0=95/=EC=86=8C=EC=8A=A4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/interfaces/lntris/BasicInterface.java | 13 +++++++++++++ .../xit/interfaces/lntris/InterfaceConfig.java | 16 +++++++++------- .../xit/interfaces/lntris/InterfaceInfo.java | 10 ++++++++++ .../cokr/xit/interfaces/lntris/Requestor.java | 2 +- .../xit/interfaces/lntris/SpecialInterface.java | 13 +++++++++++++ src/main/resources/intf-conf/lntris.conf | 12 +++++++++--- .../interfaces/lntris/InterfaceConfigTest.java | 3 ++- 7 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 src/main/java/cokr/xit/interfaces/lntris/BasicInterface.java create mode 100644 src/main/java/cokr/xit/interfaces/lntris/SpecialInterface.java diff --git a/src/main/java/cokr/xit/interfaces/lntris/BasicInterface.java b/src/main/java/cokr/xit/interfaces/lntris/BasicInterface.java new file mode 100644 index 0000000..cbeaa0c --- /dev/null +++ b/src/main/java/cokr/xit/interfaces/lntris/BasicInterface.java @@ -0,0 +1,13 @@ +package cokr.xit.interfaces.lntris; + +/**세외수입 개별시스템 연계 정보 + * @param 출발지 메시지 유형 + * @param 도착지 메시지 유형 + * @author mjkhan + */ +public abstract class BasicInterface extends InterfaceInfo { + @Override + public String type() { + return "basic"; + } +} \ No newline at end of file diff --git a/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java b/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java index 582fb75..bc8eeb6 100644 --- a/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java +++ b/src/main/java/cokr/xit/interfaces/lntris/InterfaceConfig.java @@ -1,6 +1,7 @@ package cokr.xit.interfaces.lntris; import java.util.List; +import java.util.Map; import java.util.function.Supplier; import org.springframework.core.io.ClassPathResource; @@ -142,7 +143,7 @@ public class InterfaceConfig extends AbstractComponent { public static class EndPoint { private String organization; private List systems; - private String url; + private Map urls; /**단체/기관의 첫번째 시스템 코드를 반환한다. * @return 단체/기관의 첫번째 시스템 코드 @@ -166,14 +167,15 @@ public class InterfaceConfig extends AbstractComponent { return !orgSys.isEmpty() ? orgSys.get(0) : ""; } - /**단체/기관의 시스템 url이 로컬 시스템에 대한 것인지 반환한다. - * @return 단체/기관의 시스템 url의 로컬 시스템 여부 - *
  • 단체/기관의 시스템 url이 로컬 시스템에 대한 것이면 true
  • - *
  • 그렇지 않으면 false
  • + /**지정한 대상의 url을 반환한다. + * @param target 대상 구분 + *
    • basic - 개별
    • + *
    • special - 특화
    • *
    + * @return 지정한 대상의 url */ - public boolean isLocal() { - return ifEmpty(url, "").contains("localhost"); + public String getUrl(String target) { + return urls.get(target); } } } \ No newline at end of file diff --git a/src/main/java/cokr/xit/interfaces/lntris/InterfaceInfo.java b/src/main/java/cokr/xit/interfaces/lntris/InterfaceInfo.java index 1d28c80..c60312c 100644 --- a/src/main/java/cokr/xit/interfaces/lntris/InterfaceInfo.java +++ b/src/main/java/cokr/xit/interfaces/lntris/InterfaceInfo.java @@ -28,6 +28,16 @@ public abstract class InterfaceInfo targetMessage; private JSON json; + /**세외수입 연계 시스템 구분을 반환한다. + * @return 세외수입 연계 시스템 구분 + *
    • basic - 개별시스템
    • + *
    • special - 특화시스템
    • + *
    + */ + public String type() { + return ""; + } + /**업무(시스템) 코드를 반환한다. * @return 업무(시스템) 코드 */ diff --git a/src/main/java/cokr/xit/interfaces/lntris/Requestor.java b/src/main/java/cokr/xit/interfaces/lntris/Requestor.java index bcfb2dc..33dd7f3 100644 --- a/src/main/java/cokr/xit/interfaces/lntris/Requestor.java +++ b/src/main/java/cokr/xit/interfaces/lntris/Requestor.java @@ -64,7 +64,7 @@ public class Requestor { String src = intfInfo.getSourceMessage().getHeader().getSource(); HttpResponse hresp = webClient.post(req -> req - .uri(InterfaceConfig.remote().getUrl()) + .uri(InterfaceConfig.remote().getUrl(intfInfo.type())) .json(json) .header("Accept-Charset", "UTF-8") diff --git a/src/main/java/cokr/xit/interfaces/lntris/SpecialInterface.java b/src/main/java/cokr/xit/interfaces/lntris/SpecialInterface.java new file mode 100644 index 0000000..ff7821f --- /dev/null +++ b/src/main/java/cokr/xit/interfaces/lntris/SpecialInterface.java @@ -0,0 +1,13 @@ +package cokr.xit.interfaces.lntris; + +/**세외수입 특화시스템 연계 정보 + * @param 출발지 메시지 유형 + * @param 도착지 메시지 유형 + * @author mjkhan + */ +public abstract class SpecialInterface extends InterfaceInfo { + @Override + public String type() { + return "special"; + } +} \ No newline at end of file diff --git a/src/main/resources/intf-conf/lntris.conf b/src/main/resources/intf-conf/lntris.conf index b24c8ce..b5a116f 100644 --- a/src/main/resources/intf-conf/lntris.conf +++ b/src/main/resources/intf-conf/lntris.conf @@ -1,4 +1,6 @@ { + "useDatabase": false, + "locals": [ {"organization": "4060000",/* 지역 자치단체 코드(7자리) */ /* 지역 시스템 코드(3자리) */ @@ -8,8 +10,12 @@ "remote": { "organization": "1741000", /* 지방세외수입 기관 코드(7자리) */ - "systems": ["NIS"], /* 지방세외수입 시스템 코드(3자리) */ - /*"url": "https://10.60.75.57:22411/mediate/ltis" /* 연계 운영 url */ - "url": "https://10.60.75.138:22411/mediate/ltis" /* 연계 검증 url */ + "systems": ["NIS"], /* 지방세외수입 시스템 코드(3자리) */ + "urls": { + "basic": "https://10.60.75.57:22411/mediate/ltis", /* 연계(개별) 운영 url */ + /*"basic": "https://10.60.75.138:22411/mediate/ltis", /* 연계(개별) 검증 url */ + + "special": "https://10.60.75.57:32411/mediate/ltis" /* 연계(특화) 운영 url */ + } } } \ No newline at end of file diff --git a/src/test/java/cokr/xit/interfaces/lntris/InterfaceConfigTest.java b/src/test/java/cokr/xit/interfaces/lntris/InterfaceConfigTest.java index 10fa718..01e8040 100644 --- a/src/test/java/cokr/xit/interfaces/lntris/InterfaceConfigTest.java +++ b/src/test/java/cokr/xit/interfaces/lntris/InterfaceConfigTest.java @@ -15,7 +15,8 @@ public class InterfaceConfigTest extends TestSupport { System.out.println("organization: " + remote.getOrganization()); System.out.println("systems: " + remote.getSystems().stream().collect(Collectors.joining(", "))); System.out.println("organizationSystem: " + remote.getOrganizationSystem()); - System.out.println("url: " + remote.getUrl()); + System.out.println("basic url: " + remote.getUrl("basic")); + System.out.println("special url: " + remote.getUrl("special")); System.out.println("========== locals =========="); InterfaceConfig.locals().forEach(local -> {