From 88f10aaad44547c9b2c5931db4eaed188908cf4c Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 1 Sep 2023 10:30:30 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=A5=EC=95=A0=EC=9D=B8=20=ED=91=9C?= =?UTF-8?q?=EC=A7=80=20=EB=AA=A8=EC=9D=98=20=EC=A1=B0=ED=9A=8C(=EA=B0=9C?= =?UTF-8?q?=EB=B0=9C=EC=9A=A9)=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/bean/DisabledParkingBean.java | 15 ++++++++++++++- .../resources/intf-conf/disabled-parking.conf | 1 + src/main/resources/intf-conf/gpki.conf | 3 ++- .../service/DisabledParkingServiceTest.java | 10 ++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/DisabledParkingBean.java b/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/DisabledParkingBean.java index 41e647e..8cbf6d4 100644 --- a/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/DisabledParkingBean.java +++ b/src/main/java/cokr/xit/interfaces/disabledparking/service/bean/DisabledParkingBean.java @@ -61,6 +61,9 @@ public class DisabledParkingBean extends AbstractComponent { * @return 지정한 차량번호의 장애인 표지 여부 */ public DataObject getParkingInfo(String vehicleNo) { + if (conf.isLocal()) + return getLocalParkingInfo(vehicleNo); + String xml = template .replace("{carsNo}", vehicleNo) .replace("{transactionID}", getTransactionID()); @@ -81,6 +84,13 @@ public class DisabledParkingBean extends AbstractComponent { return toMap(hresp); } + private DataObject getLocalParkingInfo(String vehicleNo) { + return new DataObject() + .set("CARS_NO", vehicleNo) + .set("PARKING_PSBL_YN", "N") + .set("BOHUN_PARKING_PSBL_YN", "N"); + } + /**지정한 차량번호들의 장애인 표지 여부를 조회한다. * @param vehicleNos 차량번호 * @return 지정한 차량번호의 장애인 표지 여부 @@ -101,7 +111,6 @@ public class DisabledParkingBean extends AbstractComponent { .contentType(WebClient.Request.ContentType.XML) .header("Connection", "close") .bodyData(xml) - ); return hresp.body(); } @@ -227,6 +236,10 @@ public class DisabledParkingBean extends AbstractComponent { return serviceUrl; } + private boolean isLocal() { + return serviceUrl.contains("localhost"); + } + /**장애인 표지 조회 서비스 url을 설정한다. * @param serviceUrl 장애인 표지 조회 서비스 url */ diff --git a/src/main/resources/intf-conf/disabled-parking.conf b/src/main/resources/intf-conf/disabled-parking.conf index 362c9a7..bbf5cc4 100644 --- a/src/main/resources/intf-conf/disabled-parking.conf +++ b/src/main/resources/intf-conf/disabled-parking.conf @@ -2,6 +2,7 @@ "template": "template/disabled-parking-request.xml", /* 장애인 표지 조회를 위한 요청 xml 템플릿의 클래스패스 상의 경로 */ "serviceUrl": "http://hub.share.go.kr/rid/ynservice/swsdn/DisabledParkingYnService", /* 장애인 표지 조회 서비스 url */ + /*"serviceUrl": "http://localhost/rid/ynservice/swsdn/DisabledParkingYnService", 장애인 표지 조회 모의 서비스 url */ "targetServer": "SVR1311000030", /* 장애인 표지 조회 서버인증서 아이디 */ "request": { /* 요청 xml의 파라미터 시작과 끝 태그 */ diff --git a/src/main/resources/intf-conf/gpki.conf b/src/main/resources/intf-conf/gpki.conf index 96e26f3..0d27005 100644 --- a/src/main/resources/intf-conf/gpki.conf +++ b/src/main/resources/intf-conf/gpki.conf @@ -8,7 +8,8 @@ "targets": "SVR1311000030" /* 대상기관 서버인증서 아이디, 여러 개일 경우 컴마(,)로 구분 */ }, - "ldapUrl": "ldap://152.99.57.127:389/cn=", /* 대상기관 인증서 다운로드를 위한 LDAP URL */ + "ldapUrl": "ldap://10.1.7.118:389/cn=", /* 대상기관 인증서 다운로드를 위한 행정망 LDAP URL */ + /*"ldapUrl": "ldap://152.99.57.127:389/cn=", 대상기관 인증서 다운로드를 위한 인터넷망 LDAP URL */ "certDir": "C:\\GPKI\\Certificate\\class1", /* 서버 인증서, 키 저장 디렉토리 */ "env": { /* 이용기관 서버 인증서 */ diff --git a/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java b/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java index 586bc11..f0de34e 100644 --- a/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java +++ b/src/test/java/cokr/xit/interfaces/disabledparking/service/DisabledParkingServiceTest.java @@ -1,5 +1,6 @@ package cokr.xit.interfaces.disabledparking.service; +import java.util.List; import java.util.Map; import javax.annotation.Resource; @@ -56,4 +57,13 @@ public class DisabledParkingServiceTest extends TestSupport { Assertions.assertEquals(v, result.get("PARKING_PSBL_YN")); }); } + + @Test //disabled-parking.conf serviceUrl에 localhost 포함시킬 것 + void getLocalParkingYn() { + List.of("xx가xxxx", "47너7721", "56저2472") + .forEach(k -> { + Map result = bean.getParkingInfo(k); + Assertions.assertEquals("N", result.get("PARKING_PSBL_YN")); + }); + } } \ No newline at end of file