>();
+ list.add((HashMap)obj);
+ resVO.setList(DataApiVO.XML_EL_NAME_RECORD, list);
+ } else if(obj instanceof List) {
+ resVO.setList(DataApiVO.XML_EL_NAME_RECORD, (List)obj);
+ } else {
+ resVO.setResultCode("ERR_RES_XML_FORMAT_RECORD");
+ resVO.setResultMessage(DataApiVO.XML_EL_NAME_RECORD + " 요소가 알수 없는 형식으로 객체화되었습니다. 확인바랍니다. : " + obj.toString());
+ log.error("convertXmlToResVO > " + resVO.getResultMessage());
+ return resVO;
+ }
+ } else resVO.putInfoItem(key, (String)map.get(key));
}
return resVO;
diff --git a/src/main/java/nlib/restful/service/DataApiReqVO.java b/src/main/java/nlib/restful/service/DataApiReqVO.java
index 84bc69df..17be6c81 100644
--- a/src/main/java/nlib/restful/service/DataApiReqVO.java
+++ b/src/main/java/nlib/restful/service/DataApiReqVO.java
@@ -1,8 +1,7 @@
package nlib.restful.service;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import org.springframework.http.HttpMethod;
+import nlib.cmm.crypto.AriaCrypto;
/**
*
@@ -26,104 +25,52 @@ import java.util.Map;
* @version 1.0
*
*/
-public class DataApiReqVO {
+public class DataApiReqVO extends DataApiVO {
- public static final int DEFAULT_PAGE_SIZE = 10;
- public static final int DEFAULT_PAGE_INDEX = 1;
+ /**
+ * 메소드를 GET으로 기본설정하여 객체 생성하는 생성자
+ */
+ public DataApiReqVO() {
+ this(null, HttpMethod.GET);
+ }
- /* 페이징 정보 */
- private int pageIndex = 0; /* 요청 페이지 번호 */
- private int pageSize = 0; /* 페이지별 표출할 레코드 수 */
+ /**
+ * 요청 URL을 받아 객체 생성하는 생성자
+ * 메소드는 GET으로 설정된다.
+ *
+ * @param reqUrl
+ */
+ public DataApiReqVO(String reqUrl) {
+ this(reqUrl, HttpMethod.GET);
+ }
- /* 기본정보 */
- private HashMap info = null;
-
- public boolean hasInfo() {
- return (info != null && info.size() > 0);
+ /**
+ * 요청 URL과 메소드를 받아 객체 생성하는 생성자
+ *
+ * @param reqUrl
+ * @param reqMethod
+ */
+ public DataApiReqVO(String reqUrl, HttpMethod reqMethod) {
+ this.reqUrl = reqUrl;
+ this.reqMethod = reqMethod;
}
- /* 요청업무ID 및 처리URI */
- int reqMethod; /* 요청메소드구분값 */
- String reqUrl; /* 요청업무ID에 대한 통합시스템의 응답 처리 프로그램 URI */
-
- // GET/SET
-
- public int getPageIndex() {
- return (pageIndex < 1 ? DEFAULT_PAGE_INDEX : pageIndex);
- }
-
- public void setPageIndex(int pageIndex) {
- this.pageIndex = pageIndex;
- }
-
- public void setPageIndex(String pageIndex) {
- try {
- this.pageIndex = Integer.parseInt(pageIndex);
- } catch(Exception e) {
- this.pageIndex = DEFAULT_PAGE_INDEX;
- }
-
- }
-
- public int getPageSize() {
- return (pageSize < 1 ? DEFAULT_PAGE_SIZE : pageSize);
- }
-
- public void setPageSize(String pageSize) {
- try {
- this.pageSize = Integer.parseInt(pageSize);
- } catch(Exception e) {
- this.pageSize = DEFAULT_PAGE_SIZE;
- }
- }
-
- public void setPageSize(int pageSize) {
- this.pageSize = pageSize;
- }
-
- public HashMap getInfo() {
- return info;
- }
-
- public void setInfo(HashMap info) {
- this.info = info;
- }
-
- public String getReqUrl() {
- return reqUrl;
- }
- public void setReqUrl(String reqUrl) {
- this.reqUrl = reqUrl;
- }
-
- public int getReqMethod() {
- return reqMethod;
- }
-
- public void setReqMethod(int reqMethod) {
- this.reqMethod = reqMethod;
+ /**
+ * 사용자ID 값을 디코딩하여 리턴한다.
+ *
+ * @return
+ */
+ public String getMbInfoIdWithDec() {
+ return AriaCrypto.decode(getMbInfoId());
}
- public void addInfoItem(String key, String value) {
- if(key == null) return;
-
- if(info == null) info = new HashMap();
-
- info.put(key, value);
+ /**
+ * 사용자ID를 인코딩하여 설정한다.
+ *
+ * @param mbInfoId
+ */
+ public void setMbInfoIdWithEnc(String mbInfoId) {
+ setMbInfoId(mbInfoId);
}
- public String getInfoItem(String key) {
- if(key == null) return null;
- if(info == null) return null;
-
- return (String)info.get(key);
- }
-
- public void removeInfoItem(String key) {
- if(key == null) return;
- if(info == null) return;
-
- info.remove(key);
- }
-
}
diff --git a/src/main/java/nlib/restful/service/DataApiResVO.java b/src/main/java/nlib/restful/service/DataApiResVO.java
index f6e0b36d..779066dd 100644
--- a/src/main/java/nlib/restful/service/DataApiResVO.java
+++ b/src/main/java/nlib/restful/service/DataApiResVO.java
@@ -1,9 +1,5 @@
package nlib.restful.service;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import nlib.util.StringUtil;
/**
@@ -28,17 +24,21 @@ import nlib.util.StringUtil;
* @version 1.0
*
*/
-public class DataApiResVO {
+public class DataApiResVO extends DataApiVO {
/**
* 생성자
+ *
+ * @param resultCode
+ * @param resultMessage
*/
public DataApiResVO() {
- super();
+ this.resultCode = null;
+ this.resultMessage = null;
}
-
+
/**
- * 생성자
+ * 처리결과 코드와 메시지를 입력받아 객체를 생성하는 생성자
*
* @param resultCode
* @param resultMessage
@@ -48,24 +48,9 @@ public class DataApiResVO {
this.resultMessage = resultMessage;
}
-
- /* 처리결과 */
- String resultCode; /* 결과코드 */
- String resultMessage; /* 결과내용(오류내용) */
-
- /* 페이징 정보 */
- int pageIndex = 0; /* 요청 페이지 번호 (page) */
- int pageLastIndex = 0; /* 마지막페이지번호 (totPages) */
-
- /* 기본/추가 정보 */
- HashMap info = null;
-
- /* 목록정보 */
- int recordTotCount = 0; /* 총 레코드수 (records) */
-
/**
* 응답 처리결과가 성공인지의 여부를 리턴한다.
- * 결과코드(resultCode)의 값이 "S"로 시작하는 경우 true 리턴한다.
+ * 결과코드(resultCode)의 값이 "S"로 시작하는 경우 true 리턴한다. 이외 false 리턴한다.
*
* @return
*/
@@ -73,62 +58,5 @@ public class DataApiResVO {
if(StringUtil.isEmpty(resultCode)) return false;
return (resultCode.trim().charAt(0) == 'S');
}
-
- // GET/SET
-
- public String getResultCode() {
- return resultCode;
- }
- public void setResultCode(String resultCode) {
- this.resultCode = resultCode;
- }
- public String getResultMessage() {
- return resultMessage;
- }
- public void setResultMessage(String resultMessage) {
- this.resultMessage = resultMessage;
- }
- public int getPageIndex() {
- return pageIndex;
- }
- public void setPageIndex(int pageIndex) {
- this.pageIndex = pageIndex;
- }
- public int getPageLastIndex() {
- return pageLastIndex;
- }
- public void setPageLastIndex(int pageLastIndex) {
- this.pageLastIndex = pageLastIndex;
- }
- public HashMap getInfo() {
- return info;
- }
- public void setInfo(HashMap info) {
- this.info = info;
- }
- public int getRecordTotCount() {
- return recordTotCount;
- }
- public void setRecordTotCount(int recordTotCount) {
- this.recordTotCount = recordTotCount;
- }
-
- /**
- * 반복되는 목록용 리스트 정보를 가져온다.
- * - RESTful API : ""요소로 반복되는 요소를 반환한다.
- *
- * @return
- */
- public List> getList() {
- if(info == null) return null;
- return (List>)info.get("results");
- }
-
- public String getInfoItem(String key) {
- if(key == null) return null;
- if(info == null) return null;
-
- return (String)info.get(key);
- }
}
diff --git a/src/main/java/nlib/restful/service/DataApiVO.java b/src/main/java/nlib/restful/service/DataApiVO.java
new file mode 100644
index 00000000..061d8236
--- /dev/null
+++ b/src/main/java/nlib/restful/service/DataApiVO.java
@@ -0,0 +1,288 @@
+package nlib.restful.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpMethod;
+
+import nlib.cmm.crypto.AriaCrypto;
+import nlib.cmm.service.NlibProperty;
+import nlib.util.StringUtil;
+
+/**
+ *
+ * @Class Name : DataApiReqVO.java
+ *
+ * @Description : RESTful API 요청 VO
+ *
+ *
+ * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
+ *
+ *
+ *
+ * @ ------------ -------- ---------------------------
+ * @ 수정일 수정자 수정내용
+ * @ ------------ -------- ---------------------------
+ * @ 2021. 6. 22. KNKIM 최초 생성
+ *
+ *
+ * @author 이씨플라자 * DIGITALSHIP KNKIM
+ * @since 2021. 6. 22.
+ * @version 1.0
+ *
+ */
+public class DataApiVO {
+
+ private static final Logger log = LoggerFactory.getLogger(DataApiVO.class);
+
+ /* 입출력 정보 중 공통 및 특정 항목들에 대한 처리를 위한 API 요소명 */
+ public static final String XML_EL_NAME_ROOT_NAME = "results"; // 결과값 최상위 요소명
+ public static final String XML_EL_NAME_PAGE_SIZE = "rows"; // 페이지크기 : 한페이지에 보여줄 레코드수
+ public static final String XML_EL_NAME_PAGE_INDEX = "page"; // 페이지번호
+ public static final String XML_EL_NAME_PAGE_LAST_INDEX = "totPages"; // 총페이지수
+ public static final String XML_EL_NAME_RECORD_TOT_COUNT = "records"; // 총레코드수
+ public static final String XML_EL_NAME_MB_INFO_ID = "mbInfoId"; // 시스템 내부 사용자ID
+ public static final String XML_EL_NAME_RECORD = "record"; // 다건 목록 자료인 레코드 요소명
+ public static final String XML_EL_NAME_RESULT_CODE = "resultCode"; // 처리결과 코드
+ public static final String XML_EL_NAME_RESULT_MESSAGE = "resultMessage"; // 처리결과 메시지
+
+ /* 페이지 처리 기본값 */
+ public static final int DEFAULT_PAGE_SIZE = NlibProperty.getInt("list.paging.page.size", 10);
+ public static final int DEFAULT_PAGE_INDEX = 1;
+
+ String reqUrl = null; /* 요청업무ID에 대한 통합시스템의 응답 처리 프로그램 URI */
+ HttpMethod reqMethod = HttpMethod.GET; /* 요청메소드구분값 */
+
+ String resultCode; /* 결과코드 */
+ String resultMessage; /* 결과내용(오류내용) */
+
+ HashMap info = null; /* 입출력 정보 맵 */
+ HashMap>> listMap = null; /* 다건 레코드 리스트를 관리하는 맵 */
+
+ public DataApiVO() {
+ super();
+ }
+
+ //--------------------------------------------------------------
+ // 정보 항목 관련 IN/OUT 함수
+ //--------------------------------------------------------------
+ public void putInfoItem(String key, String value) {
+ if(StringUtil.isEmpty(key)) return;
+ if(info == null) info = new HashMap();
+
+ info.put(key, value);
+ }
+ public String getInfoItem(String key) {
+ return getInfoItem(key, null);
+ }
+ public String getInfoItem(String key, String defValue) {
+ if(StringUtil.isEmpty(key)) return defValue;
+ if(info == null) return defValue;
+
+ String value = info.get(key);
+
+ return StringUtil.isEmpty(value) ? defValue : value;
+ }
+ public void removeInfoItem(String key) {
+ if(StringUtil.isEmpty(key)) return;
+ if(info == null) return;
+ info.remove(key);
+ }
+ public boolean hasInfo() {
+ return (info != null && info.size() > 0);
+ }
+
+ public boolean hasList() {
+ return (listMap != null && listMap.size() > 0);
+ }
+
+ public boolean hasList(String listName) {
+ List list = getList(listName);
+ return (list != null && list.size() > 0);
+ }
+
+ //--------------------------------------------------------------
+ // 다건 레코드관련 함수
+ //--------------------------------------------------------------
+ public void addListItem(String listName, HashMap map) {
+ if(StringUtil.isEmpty(listName)) return;
+ List> list = getList(listName);
+
+ if(list == null) list = new ArrayList>();
+ list.add(map);
+ setList(listName, list);
+ return;
+ }
+
+ public void removeListItem(String listName, int idx) {
+ if(StringUtil.isEmpty(listName)) return;
+ if(idx < 0) return;
+
+ List> list = getList(listName);
+ if(list != null && list.size() > idx) list.remove(idx);
+ return;
+ }
+
+ public void clearList(String listName) {
+ if(StringUtil.isEmpty(listName)) return;
+
+ List> list = getList(listName);
+ if(list != null) list.clear();
+ return;
+ }
+
+ public List> getList(String listName) {
+ if(StringUtil.isEmpty(listName)) return null;
+ if(listMap == null && listMap.size() < 1) return null;
+
+ return listMap.get(listName);
+ }
+
+ public void setList(String listName, List> list) {
+ if(StringUtil.isEmpty(listName)) return;
+ if(listMap == null) initList();
+
+ List> listOld = getList(listName);
+ if(listOld != null) listOld.clear();
+
+ listMap.put(listName, list);
+ return;
+ }
+
+ private void initList() {
+ if(listMap == null) listMap = new HashMap>>();
+ return;
+ }
+
+ //--------------------------------------------------------------
+ // 페이징 처리 관련
+ //--------------------------------------------------------------
+ public int getPageIndex() {
+ int pageIndex = 0;
+ try {
+ pageIndex = Integer.parseInt(getInfoItem(XML_EL_NAME_PAGE_INDEX, "0"));
+ } catch(Exception e) {
+ log.error("getPageIndex > " + e.toString());
+ return 0;
+ }
+ return pageIndex;
+ }
+ public void setPageIndex(int pageIndex) {
+ setPageIndex("" + pageIndex);
+ }
+ public void setPageIndex(String pageIndex) {
+ putInfoItem("XML_EL_NAME_PAGE_INDEX", pageIndex);
+ }
+ public int getPageLastIndex() {
+ int pageLastIndex = 0;
+ try {
+ pageLastIndex = Integer.parseInt(getInfoItem(XML_EL_NAME_PAGE_LAST_INDEX, "0"));
+ } catch(Exception e) {
+ log.error("getPageLastIndex > " + e.toString());
+ return 0;
+ }
+ return pageLastIndex;
+ }
+ public void setPageLastIndex(int pageLastIndex) {
+ setPageLastIndex("" + pageLastIndex);
+ }
+ public void setPageLastIndex(String pageLastIndex) {
+ putInfoItem("XML_EL_NAME_PAGE_LAST_INDEX", pageLastIndex);
+ }
+ public int getPageSize() {
+ int pageSize = 0;
+ try {
+ pageSize = Integer.parseInt(getInfoItem(XML_EL_NAME_PAGE_SIZE, "0"));
+ } catch(Exception e) {
+ log.error("getPageSize > " + e.toString());
+ return 0;
+ }
+ return pageSize;
+ }
+ public void setPageSize(int pageSize) {
+ setPageSize("" + pageSize);
+ }
+ public void setPageSize(String pageSize) {
+ putInfoItem("XML_EL_NAME_PAGE_SIZE", pageSize);
+ }
+ public int getRecordTotCount() {
+ int recordTotCount = 0;
+ try {
+ recordTotCount = Integer.parseInt(getInfoItem(XML_EL_NAME_RECORD_TOT_COUNT, "0"));
+ } catch(Exception e) {
+ log.error("getRecordTotCount > " + e.toString());
+ return 0;
+ }
+ return recordTotCount;
+ }
+ public void setRecordTotCount(int recordTotCount) {
+ setRecordTotCount("" + recordTotCount);
+ }
+ public void setRecordTotCount(String recordTotCount) {
+ putInfoItem(XML_EL_NAME_RECORD_TOT_COUNT, recordTotCount);
+ }
+
+ //--------------------------------------------------------------
+ // 사용자ID 처리 관련
+ //--------------------------------------------------------------
+ public String getMbInfoId() {
+ return getInfoItem("XML_EL_NAME_MB_INFO_ID");
+ }
+ public String getEncMbInfoId() {
+ return AriaCrypto.encode(getInfoItem("XML_EL_NAME_MB_INFO_ID"));
+ }
+ public void setMbInfoId(String mbInfoId) {
+ putInfoItem("XML_EL_NAME_MB_INFO_ID", mbInfoId);
+ }
+
+ //--------------------------------------------------------------
+ // GET & SET
+ //--------------------------------------------------------------
+ public String getReqUrl() {
+ return reqUrl;
+ }
+
+ public void setReqUrl(String reqUrl) {
+ this.reqUrl = reqUrl;
+ }
+
+ public HttpMethod getReqMethod() {
+ return reqMethod;
+ }
+
+ public void setReqMethod(HttpMethod reqMethod) {
+ this.reqMethod = reqMethod;
+ }
+
+ public String getResultCode() {
+ return resultCode;
+ }
+
+ public void setResultCode(String resultCode) {
+ this.resultCode = resultCode;
+ }
+
+ public String getResultMessage() {
+ return resultMessage;
+ }
+
+ public void setResultMessage(String resultMessage) {
+ this.resultMessage = resultMessage;
+ }
+
+ public HashMap getInfo() {
+ return info;
+ }
+
+ public void setInfo(HashMap info) {
+ this.info = info;
+ }
+
+ public HashMap>> getListMap() {
+ return listMap;
+ }
+
+}
diff --git a/src/main/java/nlib/restful/service/XmlConverter.java b/src/main/java/nlib/restful/service/XmlConverter.java
index 66580e5c..ae9125d6 100644
--- a/src/main/java/nlib/restful/service/XmlConverter.java
+++ b/src/main/java/nlib/restful/service/XmlConverter.java
@@ -24,7 +24,7 @@ public class XmlConverter {
private static final Logger log = LoggerFactory.getLogger(XmlConverter.class);
- public static HashMap convert(String xmlStr) throws Exception {
+ public static HashMap convert(String xmlStr, String rootEleName) throws Exception {
if(xmlStr == null) return null;
@@ -35,7 +35,7 @@ public class XmlConverter {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLEventReader eventReader = inputFactory.createXMLEventReader(bIn);
- resMap = getElementValue("result", eventReader, null);
+ resMap = getElementValue(rootEleName, eventReader, null);
//log.debug("Converting XML to HashMap : Done >> " + resMap);
} catch (XMLStreamException e) {
e.printStackTrace();
diff --git a/src/main/java/nlib/restful/service/impl/DataApiRESTful.java b/src/main/java/nlib/restful/service/impl/DataApiRESTful.java
index 8723c6f4..74b1921e 100644
--- a/src/main/java/nlib/restful/service/impl/DataApiRESTful.java
+++ b/src/main/java/nlib/restful/service/impl/DataApiRESTful.java
@@ -1,5 +1,7 @@
package nlib.restful.service.impl;
+import java.nio.charset.StandardCharsets;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -9,12 +11,13 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
+import nlib.restful.service.DataApiInterface;
import nlib.restful.service.DataApiReqVO;
import nlib.restful.service.DataApiResVO;
-import nlib.restful.service.DataApiInterface;
import nlib.util.StringUtil;
/**
@@ -53,48 +56,6 @@ public class DataApiRESTful implements DataApiInterface {
@Value("#{properties['dataapi.server.protocol']}")
private String DAPI_SERVER_PROTOCOL;
-
- /**
- * 조회
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO get(DataApiReqVO reqVO) {
-
- return send(reqVO, HttpMethod.GET);
- }
-
- /**
- * 등록
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO put(DataApiReqVO reqVO) {
- return send(reqVO, HttpMethod.PUT);
- }
-
- /**
- * 수정
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO post(DataApiReqVO reqVO) {
- return send(reqVO, HttpMethod.POST);
- }
-
- /**
- * 삭제
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO delete (DataApiReqVO reqVO) {
- return send(reqVO, HttpMethod.DELETE);
- }
-
/**
* 실제 RESTful API 서버로 요청을 전송하고, 응답받은 자료를 응답VO에 담아서 리턴한다.
*
@@ -102,42 +63,79 @@ public class DataApiRESTful implements DataApiInterface {
* @param method
* @return
*/
- public DataApiResVO send(DataApiReqVO reqVO, HttpMethod method) {
+ public DataApiResVO request(DataApiReqVO reqVO) {
+
+ log.debug("request > " + reqVO.getReqMethod());
DataApiResVO resVO = null;
try {
+
//-----------------------------------
// 입력값 검증작업
//-----------------------------------
resVO = DataApiInterface.checkReqCommonParams(reqVO);
if(resVO != null) return resVO;
- if(method == null) return new DataApiResVO("ERR_NO_METHOD", "HTTP 요청 Method가 유효하지 않습니다.");
+ HttpMethod method = reqVO.getReqMethod();
//-----------------------------------
- // 폼 파라메터 생성 작업
+ // 폼 파라메터 생성 작업 및 요청 처리
//-----------------------------------
+ String url = DAPI_SERVER_PROTOCOL + "://" + DAPI_SERVER_IP + ("80".equals(DAPI_SERVER_PORT) ? "" : ":" + DAPI_SERVER_PORT) + reqVO.getReqUrl();
+ log.debug("REQ URL : " + url);
+
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
- MultiValueMap parameters = DataApiInterface.makeParamMap(reqVO);
- HttpEntity> requestEntity = new HttpEntity(parameters, headers);
+
+ ResponseEntity responseEntity = null;
+ RestTemplate restTemplate = new RestTemplate();
+ restTemplate.getMessageConverters()
+ .add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8));
+
+ if(method == HttpMethod.GET) {
+ HttpEntity requestEntity = new HttpEntity(headers);
+ responseEntity = restTemplate.exchange (DataApiInterface.makeRequestParamUrl(url, reqVO), method, requestEntity, String.class);
+ } else if(method == HttpMethod.POST) {
+ MultiValueMap parameters = DataApiInterface.makeRequestParamMultiValueMap(reqVO);
+ parameters.forEach((k, v) -> log.debug("params > " + k + " : " + v));
+ HttpEntity> requestEntity = new HttpEntity(parameters, headers);
+ responseEntity = restTemplate.postForEntity(url, requestEntity , String.class);
+ } else {
+ String message = "RESTFul API Http Method 설정 오류입니다. : POST, GET 방식만 허용됩니다.";
+ log.error("request > " + message);
+ return DataApiInterface.makeErrorRes("E_ERR_METHOD", message);
+ }
//-----------------------------------
// 요청 처리
//-----------------------------------
- RestTemplate restTemplate = new RestTemplate();
- String url = DAPI_SERVER_PROTOCOL + "://" + DAPI_SERVER_IP + ("80".equals(DAPI_SERVER_PORT) ? "" : ":" + DAPI_SERVER_PORT) + reqVO.getReqUrl();
- log.debug("REQ URL : " + reqVO.getReqUrl());
+// RestTemplate restTemplate = new RestTemplate();
+ //restTemplate.setMessageConverters(msgConverters);
+
+ //ResponseEntity responseEntity = restTemplate.exchange(url, method, requestEntity, String.class);
+// ResponseEntity responseEntity = restTemplate.exchange (url, method, requestEntity, String.class);
+ //ResponseEntity responseEntity = restTemplate.exchange (url, HttpMethod.GET, requestEntity, String.class, parameters);
+ //ResponseEntity responseEntity = restTemplate.postForEntity( url, requestEntity , String.class ); // working well
+ //ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class, parameters); // not working
+
+ /*
+ // GET // OK
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url)
+ .queryParam("mngOrgCd", "SU01")
+ .queryParam("masterId", "UR-408A9832D25C42289D9B1FC81FDA8360")
+ .queryParam("typeDivCd", "IT_MUSE");
+ HttpEntity> entity = new HttpEntity<>(headers);
+ RestTemplate restTemplate = new RestTemplate();
+ ResponseEntity responseEntity = restTemplate.exchange (builder.toUriString(), method, entity, String.class);
+ */
- ResponseEntity responseEntity = restTemplate.exchange(url, method, requestEntity, String.class);
//-----------------------------------
// 응답 처리
//-----------------------------------
HttpStatus statusCode = responseEntity.getStatusCode();
log.debug("RES StatusCode : " + statusCode);
- String resultXML = "";
- resultXML = responseEntity.getBody();
+ String resultXML = responseEntity.getBody();
log.debug("RES resultXML : " + resultXML);
// 응답 자료 객체화
@@ -145,19 +143,22 @@ public class DataApiRESTful implements DataApiInterface {
// 처리결과 코드 확인
if(StringUtil.isEmpty(resVO.getResultCode())) {
+ String resultMessage = resVO.getResultMessage();
if (statusCode == HttpStatus.OK) {
resVO.setResultCode("S_HTTP_STATUS_OK");
- resVO.setResultMessage("정상처리되었습니다.");
+ resVO.setResultMessage(StringUtil.isEmpty(resultMessage) ? "정상처리되었습니다." : resultMessage);
} else {
resVO.setResultCode("E_STATUS_CODE_FAIL");
- resVO.setResultMessage(String.format("처리에 실패하였습니다. (HTTP상태코드 : %s)", statusCode.toString()));
+ resVO.setResultMessage(StringUtil.isEmpty(resultMessage) ? String.format("처리에 실패하였습니다. (HTTP상태코드 : %s)", statusCode.toString()) : resultMessage);
}
}
- //log.debug("RES resVO : " + resVO);
+ log.debug("RES resVO : resultCode = " + resVO.getResultCode());
+ log.debug("RES resVO : resultMessage = " + resVO.getResultMessage());
} catch(Exception e) {
e.printStackTrace();
+ log.error("request > Exception 발생 : " + e.toString());
return DataApiInterface.makeErrorRes("E_REQ_EXCEPTION", e.toString());
}
diff --git a/src/main/java/nlib/restful/service/impl/DataApiTempXml.java b/src/main/java/nlib/restful/service/impl/DataApiTempXml.java
index 7c085675..0720fa8e 100644
--- a/src/main/java/nlib/restful/service/impl/DataApiTempXml.java
+++ b/src/main/java/nlib/restful/service/impl/DataApiTempXml.java
@@ -10,7 +10,6 @@ import java.nio.charset.StandardCharsets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
@@ -19,10 +18,11 @@ import org.springframework.util.MultiValueMap;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import nlib.restful.service.DataApiInterface;
import nlib.restful.service.DataApiReqVO;
import nlib.restful.service.DataApiResVO;
import nlib.restful.service.DataApiServerResponseVO;
-import nlib.restful.service.DataApiInterface;
+import nlib.restful.service.DataApiVO;
import nlib.util.StringUtil;
/**
@@ -55,47 +55,6 @@ public class DataApiTempXml implements DataApiInterface {
@Value("#{properties['dataapi.temp.xml.path']}")
private String DAPI_TEMP_XML_PATH;
-
- /**
- * 조회
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO get(DataApiReqVO reqVO) {
-
- return send(reqVO, HttpMethod.GET);
- }
-
- /**
- * 등록
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO put(DataApiReqVO reqVO) {
- return send(reqVO, HttpMethod.PUT);
- }
-
- /**
- * 수정
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO post(DataApiReqVO reqVO) {
- return send(reqVO, HttpMethod.POST);
- }
-
- /**
- * 삭제
- *
- * @param reqVO
- * @return
- */
- public DataApiResVO delete (DataApiReqVO reqVO) {
- return send(reqVO, HttpMethod.DELETE);
- }
/**
* 실제 RESTful API 서버로 요청을 전송하고, 응답받은 자료를 응답VO에 담아서 리턴한다.
@@ -104,8 +63,10 @@ public class DataApiTempXml implements DataApiInterface {
* @param method
* @return
*/
- public DataApiResVO send(DataApiReqVO reqVO, HttpMethod method) {
-
+ public DataApiResVO request(DataApiReqVO reqVO) {
+
+ log.debug("request > " + reqVO.getReqMethod());
+
DataApiResVO resVO = null;
try {
@@ -114,21 +75,20 @@ public class DataApiTempXml implements DataApiInterface {
//-----------------------------------
resVO = DataApiInterface.checkReqCommonParams(reqVO);
if(resVO != null) return resVO;
- if(method == null) return new DataApiResVO("ERR_NO_METHOD", "HTTP 요청 Method가 유효하지 않습니다.");
-
+ HttpMethod method = reqVO.getReqMethod();
+
//-----------------------------------
- // 폼 파라메터 생성 작업
+ // 폼 파라메터 생성 작업 (요청데이터 확인용)
//-----------------------------------
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
- MultiValueMap parameters = DataApiInterface.makeParamMap(reqVO);
- HttpEntity> requestEntity = new HttpEntity(parameters, headers);
+ MultiValueMap parameters = DataApiInterface.makeRequestParamMultiValueMap(reqVO);
//-----------------------------------
// 응답 처리
//-----------------------------------
HttpStatus statusCode = HttpStatus.OK;
- String resultXML = getTempDataFromXmlFile(reqVO, method);
+ String resultXML = getTempDataFromXmlFile(reqVO);
//log.debug("RES resultXML : " + resultXML);
// 응답 자료 객체화
@@ -136,16 +96,18 @@ public class DataApiTempXml implements DataApiInterface {
// 처리결과 코드 확인
if(StringUtil.isEmpty(resVO.getResultCode())) {
+ String resultMessage = resVO.getResultMessage();
if (statusCode == HttpStatus.OK) {
resVO.setResultCode("S_HTTP_STATUS_OK");
- resVO.setResultMessage("정상처리되었습니다.");
+ resVO.setResultMessage(StringUtil.isEmpty(resultMessage) ? "정상처리되었습니다." : resultMessage);
} else {
resVO.setResultCode("E_STATUS_CODE_FAIL");
- resVO.setResultMessage(String.format("처리에 실패하였습니다. (HTTP상태코드 : %s)", statusCode.toString()));
+ resVO.setResultMessage(StringUtil.isEmpty(resultMessage) ? String.format("처리에 실패하였습니다. (HTTP상태코드 : %s)", statusCode.toString()) : resultMessage);
}
}
- //log.debug("RES resVO : " + resVO);
+ log.debug("RES resVO : resultCode = " + resVO.getResultCode());
+ log.debug("RES resVO : resultMessage = " + resVO.getResultMessage());
} catch(Exception e) {
e.printStackTrace();
@@ -163,54 +125,55 @@ public class DataApiTempXml implements DataApiInterface {
* @return
* @throws Exception
*/
- private String getTempDataFromXmlFile(DataApiReqVO reqVO, HttpMethod method) throws Exception {
-
- String fileName = reqVO.getReqUrl().substring(1).replaceAll("/", ".");
- String xmlPath = DAPI_TEMP_XML_PATH + "/" + fileName + "_" + method.toString().toUpperCase() + ".xml";
- String returnXmlStr = null;
+ private String getTempDataFromXmlFile(DataApiReqVO reqVO) throws Exception {
+
+ HttpMethod method = reqVO.getReqMethod();
+ String fileName = reqVO.getReqUrl().substring(1).replaceAll("/", ".");
+ String xmlPath = DAPI_TEMP_XML_PATH + "/" + fileName + "_" + method.toString().toUpperCase() + ".xml";
+ String returnXmlStr = null;
+
+ log.info("XML FILE PATH : " + xmlPath);
+
+
+ DataApiServerResponseVO resVO = null;
+
+ File xmlFile = new File(xmlPath);
+ if(!xmlFile.exists()) {
+ resVO = new DataApiServerResponseVO("-20", String.format("%s 파일을 찾을 수 없습니다.",xmlPath));
+ XmlMapper mapper = new XmlMapper();
+ returnXmlStr = mapper.writer().withRootName("result").writeValueAsString(resVO);
+ }
+
+ if(resVO == null && !xmlFile.isFile()) {
+ resVO = new DataApiServerResponseVO("-21", String.format("%s는 파일이어야 합니다.",xmlPath));
+ XmlMapper mapper = new XmlMapper();
+ returnXmlStr = mapper.writer().withRootName(DataApiVO.XML_EL_NAME_ROOT_NAME).writeValueAsString(resVO);
+ }
+
+ if(resVO == null) {
+ StringBuilder strBd = new StringBuilder();
- log.info("XML FILE PATH : " + xmlPath);
-
-
- DataApiServerResponseVO resVO = null;
-
- File xmlFile = new File(xmlPath);
- if(!xmlFile.exists()) {
- resVO = new DataApiServerResponseVO("-20", String.format("%s 파일을 찾을 수 없습니다.",xmlPath));
- XmlMapper mapper = new XmlMapper();
- returnXmlStr = mapper.writer().withRootName("result").writeValueAsString(resVO);
- }
-
- if(resVO == null && !xmlFile.isFile()) {
- resVO = new DataApiServerResponseVO("-21", String.format("%s는 파일이어야 합니다.",xmlPath));
- XmlMapper mapper = new XmlMapper();
- returnXmlStr = mapper.writer().withRootName("result").writeValueAsString(resVO);
- }
-
- if(resVO == null) {
- StringBuilder strBd = new StringBuilder();
+ try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(xmlPath),StandardCharsets.UTF_8))) {
- try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(xmlPath),StandardCharsets.UTF_8))) {
-
- String line;
- int i = 0;
- while ((line = br.readLine()) != null) {
- strBd.append(line + "\n");
- }
- returnXmlStr = strBd.toString();
- } catch (IOException e) {
- log.error("XML 파일 읽는 중 오류 발생 : " + e.toString());
- e.printStackTrace();
-
- resVO = new DataApiServerResponseVO("-22", String.format("%s 파일을 읽는 중 오류가 발생하였습니다(%s). ",xmlPath, e.toString()));
- XmlMapper mapper = new XmlMapper();
- returnXmlStr = mapper.writer().withRootName("result").writeValueAsString(resVO);
- }
+ String line;
+ int i = 0;
+ while ((line = br.readLine()) != null) {
+ strBd.append(line + "\n");
+ }
+ returnXmlStr = strBd.toString();
+ } catch (IOException e) {
+ log.error("XML 파일 읽는 중 오류 발생 : " + e.toString());
+ e.printStackTrace();
+ resVO = new DataApiServerResponseVO("-22", String.format("%s 파일을 읽는 중 오류가 발생하였습니다(%s). ",xmlPath, e.toString()));
+ XmlMapper mapper = new XmlMapper();
+ returnXmlStr = mapper.writer().withRootName(DataApiVO.XML_EL_NAME_ROOT_NAME).writeValueAsString(resVO);
}
- //log.info("RESUTN XML STR : " + returnXmlStr);
- return returnXmlStr;
+ }
+
+ //log.info("RESUTN XML STR : " + returnXmlStr);
+ return returnXmlStr;
}
}
diff --git a/src/main/java/nlib/sample/service/SampleDataApiService.java b/src/main/java/nlib/sample/service/SampleDataApiService.java
index 6be6c327..4cca94d2 100644
--- a/src/main/java/nlib/sample/service/SampleDataApiService.java
+++ b/src/main/java/nlib/sample/service/SampleDataApiService.java
@@ -29,4 +29,5 @@ public interface SampleDataApiService {
public DataApiResVO getSampleInfo(DataApiReqVO reqVO) throws Exception;
+ public DataApiResVO getItemInfo(DataApiReqVO reqVO) throws Exception;
}
diff --git a/src/main/java/nlib/sample/service/impl/SampleDataApiDAO.java b/src/main/java/nlib/sample/service/impl/SampleDataApiDAO.java
deleted file mode 100644
index d3f48a58..00000000
--- a/src/main/java/nlib/sample/service/impl/SampleDataApiDAO.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package nlib.sample.service.impl;
-
-import org.springframework.stereotype.Repository;
-
-import nlib.restful.DataApi;
-import nlib.restful.service.DataApiReqVO;
-import nlib.restful.service.DataApiResVO;
-
-/**
- *
- * @Class Name : SampleDataApiDAO.java
- *
- * @Description : RESTful API 호출 샘플
- *
- *
- * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
- *
- *
- *
- * @ ------------ -------- ---------------------------
- * @ 수정일 수정자 수정내용
- * @ ------------ -------- ---------------------------
- * @ 2021. 6. 22. KNKIM 최초 생성
- *
- *
- * @author 이씨플라자 * DIGITALSHIP KNKIM
- * @since 2021. 6. 22.
- * @version 1.0
- *
- */
-@Repository("sampleDataApiDAO")
-public class SampleDataApiDAO extends DataApi {
-
- /**
- * 주 자원의 URI
- */
- public static final String RESOURCE_URI = "/uac/service/exports";
-
- public DataApiResVO getSampleInfo(DataApiReqVO reqVO) throws Exception {
-
- // URI가 다른 경우, 해당 URI 설정
- reqVO.setReqUrl(RESOURCE_URI);
-
- return get(reqVO);
- }
-
-}
diff --git a/src/main/java/nlib/sample/service/impl/SampleDataApiServiceImpl.java b/src/main/java/nlib/sample/service/impl/SampleDataApiServiceImpl.java
index 10d87081..25cb9642 100644
--- a/src/main/java/nlib/sample/service/impl/SampleDataApiServiceImpl.java
+++ b/src/main/java/nlib/sample/service/impl/SampleDataApiServiceImpl.java
@@ -4,6 +4,7 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Service;
+import nlib.restful.DataApi;
import nlib.restful.service.DataApiReqVO;
import nlib.restful.service.DataApiResVO;
import nlib.sample.service.SampleDataApiService;
@@ -33,12 +34,15 @@ import nlib.sample.service.SampleDataApiService;
@Service("sampleDataApiService")
public class SampleDataApiServiceImpl implements SampleDataApiService {
- /** SampleDataApiDAO */
- @Resource(name = "sampleDataApiDAO")
- private SampleDataApiDAO sampleDataApiDAO;
+ /** RESTFul API 송수신 모듈 */
+ @Resource(name = "dataApi")
+ private DataApi dataApi;
public DataApiResVO getSampleInfo(DataApiReqVO reqVO) throws Exception {
- return sampleDataApiDAO.getSampleInfo(reqVO);
+ return dataApi.request(reqVO);
}
+ public DataApiResVO getItemInfo(DataApiReqVO reqVO) throws Exception {
+ return dataApi.request(reqVO);
+ }
}
diff --git a/src/main/java/nlib/sample/web/SampleDataApiController.java b/src/main/java/nlib/sample/web/SampleDataApiController.java
index 0a5c55f8..c3c0b38f 100644
--- a/src/main/java/nlib/sample/web/SampleDataApiController.java
+++ b/src/main/java/nlib/sample/web/SampleDataApiController.java
@@ -3,16 +3,22 @@ package nlib.sample.web;
import java.util.Map;
import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
+import nlib.cmm.NlibCommonController;
import nlib.restful.service.DataApiReqVO;
import nlib.restful.service.DataApiResVO;
+import nlib.restful.service.DataApiVO;
import nlib.sample.service.SampleDataApiService;
+import nlib.user.service.NlibLoginVO;
+import nlib.util.StringUtil;
/**
*
@@ -37,7 +43,7 @@ import nlib.sample.service.SampleDataApiService;
*
*/
@Controller
-public class SampleDataApiController {
+public class SampleDataApiController extends NlibCommonController {
/** SampleDataApiService */
@Resource(name = "sampleDataApiService")
@@ -80,4 +86,91 @@ public class SampleDataApiController {
return "nlib/sample/getSampleInfo";
}
+ @RequestMapping("/sample/getItemInfo.do")
+ public String getItemInfo(HttpServletRequest request, @RequestParam Map commandMap, ModelMap model) throws Exception {
+
+ String message = null;
+
+ DataApiReqVO reqVO = new DataApiReqVO("/uac/service/nlib/col/getItemInfo", HttpMethod.GET);
+
+ String mngOrgCd = commandMap.get("mngOrgCd");
+ String masterId = commandMap.get("masterId");
+ String typeDivCd = commandMap.get("typeDivCd");
+
+ if(StringUtil.isEmpty(mngOrgCd) || StringUtil.isEmpty(masterId) || StringUtil.isEmpty(typeDivCd)) {
+ message = "필수정보값이 입력되지 않았습니다.";
+ model.addAttribute("message", message);
+ return "nlib/sample/getItemInfo";
+ }
+
+ // 변수 설정
+ reqVO.putInfoItem("mngOrgCd", mngOrgCd);
+ reqVO.putInfoItem("masterId", masterId);
+ reqVO.putInfoItem("typeDivCd", typeDivCd);
+
+ // 사용자ID 설정
+ NlibLoginVO nlibLoginVO = getNlibLoginVO(request);
+ if(nlibLoginVO != null && !StringUtil.isEmpty(nlibLoginVO.getMbInfoId())) {
+ reqVO.setMbInfoId(nlibLoginVO.getMbInfoId());
+ }
+
+ // API 호출
+ DataApiResVO resVO = sampleDataApiService.getItemInfo(reqVO);
+
+ // 결과값 전달
+ model.addAttribute("resultCode", resVO.getResultCode());
+ model.addAttribute("resultMessage", resVO.getResultMessage());
+ model.addAttribute("info", resVO.getInfo());
+
+ // 참고 정보 : API 접속 서버 정보
+ model.addAttribute("serverProtocol", dataapiServerIp);
+ model.addAttribute("serverIp", dataapiServerPort);
+ model.addAttribute("serverPort", dataapiServerProtocol);
+
+ return "nlib/sample/getItemInfo";
+ }
+
+ @RequestMapping("/sample/listRentItem.do")
+ public String listRentItem(HttpServletRequest request, @RequestParam Map commandMap, ModelMap model) throws Exception {
+
+ String message = null;
+
+ DataApiReqVO reqVO = new DataApiReqVO("/uac/service/nlib/rent/listRentItem", HttpMethod.GET);
+
+ // 변수 설정
+ reqVO.putInfoItem("rows", getParamStr(commandMap, "rows", "10"));
+ reqVO.putInfoItem("page", getParamStr(commandMap, "rows", "1"));
+ reqVO.putInfoItem("mngOrgCd", getParamStr(commandMap, "mngOrgCd", "KCCF"));
+ reqVO.putInfoItem("mbInfoId", getParamStr(commandMap, "mbInfoId", "BDCCAF34CF8AA365C660ADB121CE6741"));
+
+ // 사용자ID 설정
+// NlibLoginVO nlibLoginVO = getNlibLoginVO(request);
+// if(nlibLoginVO != null && !StringUtil.isEmpty(nlibLoginVO.getMbInfoId())) {
+// reqVO.setMbInfoId(nlibLoginVO.getMbInfoId());
+// }
+
+ // API 호출
+ DataApiResVO resVO = sampleDataApiService.getItemInfo(reqVO);
+
+ // 입력 매개변수 전달
+ model.addAttribute("rows", resVO.getRecordTotCount());
+ model.addAttribute("page", resVO.getPageIndex());
+ model.addAttribute("mngOrgCd", resVO.getInfoItem("mngOrgCd"));
+ model.addAttribute("mbInfoId", resVO.getInfoItem("mbInfoId"));
+
+ // 결과값 전달
+ model.addAttribute("resultCode", resVO.getResultCode());
+ model.addAttribute("resultMessage", resVO.getResultMessage());
+ model.addAttribute("info", resVO.getInfo());
+ model.addAttribute("list", resVO.getList(DataApiVO.XML_EL_NAME_RECORD));
+
+ // 참고 정보 : API 접속 서버 정보
+ model.addAttribute("serverProtocol", dataapiServerIp);
+ model.addAttribute("serverIp", dataapiServerPort);
+ model.addAttribute("serverPort", dataapiServerProtocol);
+
+ return "nlib/sample/listRentItem";
+ }
+
+
}
diff --git a/src/main/java/nlib/security/SpringSecurityConfig.java b/src/main/java/nlib/security/SpringSecurityConfig.java
index 7859a0ed..61ea8099 100644
--- a/src/main/java/nlib/security/SpringSecurityConfig.java
+++ b/src/main/java/nlib/security/SpringSecurityConfig.java
@@ -77,10 +77,12 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/rent/*.do").permitAll()
.antMatchers("/collection/*.do").permitAll()
.antMatchers("/sample/password/getSampleEncoder.do").permitAll()
+ .antMatchers("/sample/*.do").permitAll()
.antMatchers("/*/*Ajax.do").permitAll()
.antMatchers("/fileupload/**").permitAll()
.antMatchers("/board/**").permitAll()
.antMatchers("/inform/**").permitAll()
+ .antMatchers("/test/**").permitAll()
.antMatchers("/alert/**").permitAll()
.antMatchers("/code/**").permitAll()
.antMatchers("/homes/**").permitAll()
diff --git a/src/main/resources/egovframework/mapper/nlib/user/LoginDAO_SQL.xml b/src/main/resources/egovframework/mapper/nlib/user/LoginDAO_SQL.xml
index 2e5b4cc7..a4a2a191 100644
--- a/src/main/resources/egovframework/mapper/nlib/user/LoginDAO_SQL.xml
+++ b/src/main/resources/egovframework/mapper/nlib/user/LoginDAO_SQL.xml
@@ -69,13 +69,14 @@
INSERT INTO SM_ACC_LOG /* 접속로그 */
- ( USER_ID
- ,USER_NM
- ,DEPT_SEQ
- ,DEPT_NM
- ,ACC_IP
- ,LOGIN_SUCS_YN
- ,ACC_DATE
+ ( USER_ID
+ , USER_NM
+ , DEPT_SEQ
+ , DEPT_NM
+ , ACC_IP
+ , LOGIN_SUCS_YN
+ , ACC_DATE
+ , SYS_DIV
) VALUES (
#{mbInfoId}
,#{name}
@@ -84,6 +85,7 @@
,#{ip}
,'Y'
,NOW()
+ ,'02' /* 2021.10.05 추가 (소장자료관) */
)
diff --git a/src/main/resources/nlib/nlib.properties b/src/main/resources/nlib/nlib.properties
index 601796ba..5bcc4653 100644
--- a/src/main/resources/nlib/nlib.properties
+++ b/src/main/resources/nlib/nlib.properties
@@ -54,11 +54,16 @@ nlib.council.dns.host = nlib
#dataapi.server.port = 80
#dataapi.server.protocol = http
-# \ub85c\uceec \uc11c\ubc84
-dataapi.server.ip = localhost
-dataapi.server.port = 8088
+# \uc784\uc2dc PC \uac1c\ubc1c \uc11c\ubc84
+dataapi.server.ip = 192.168.25.87
+dataapi.server.port = 8080
dataapi.server.protocol = http
+# \ub85c\uceec \uc11c\ubc84
+#dataapi.server.ip = localhost
+#dataapi.server.port = 8088
+#dataapi.server.protocol = http
+
# \ub85c\uceec \uac1c\ubc1c\uc6a9 XML \ud30c\uc77c \uc704\uce58
dataapi.temp.xml.path = C:/iams/workspace/nlib/data/dataxml
diff --git a/src/main/webapp/WEB-INF/jsp/nlib/sample/getItemInfo.jsp b/src/main/webapp/WEB-INF/jsp/nlib/sample/getItemInfo.jsp
new file mode 100644
index 00000000..ec05c220
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/nlib/sample/getItemInfo.jsp
@@ -0,0 +1,86 @@
+<%
+/**
+ *
+ * @Class Name : getSampleInfo.jsp
+ *
+ * @Description : RESTful API 호출 샘플
+ *
+ *
+ * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
+ *
+ *
+ *
+ * @ ------------ -------- ---------------------------
+ * @ 수정일 수정자 수정내용
+ * @ ------------ -------- ---------------------------
+ * @ 2021. 6. 15. KNKIM 최초 생성
+ *
+ *
+ * @author 이씨플라자 * DIGITALSHIP KNKIM
+ * @since 2021. 6. 15.
+ * @version 1.0
+ *
+ */
+ %>
+<%@ page language="java" contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
+ - 결과
+
+
+
+
+${pageTitle}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/jsp/nlib/sample/listRentItem.jsp b/src/main/webapp/WEB-INF/jsp/nlib/sample/listRentItem.jsp
new file mode 100644
index 00000000..729a95f6
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/nlib/sample/listRentItem.jsp
@@ -0,0 +1,98 @@
+<%
+/**
+ *
+ * @Class Name : getSampleInfo.jsp
+ *
+ * @Description : RESTful API 호출 샘플
+ *
+ *
+ * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
+ *
+ *
+ *
+ * @ ------------ -------- ---------------------------
+ * @ 수정일 수정자 수정내용
+ * @ ------------ -------- ---------------------------
+ * @ 2021. 6. 15. KNKIM 최초 생성
+ *
+ *
+ * @author 이씨플라자 * DIGITALSHIP KNKIM
+ * @since 2021. 6. 15.
+ * @version 1.0
+ *
+ */
+ %>
+<%@ page language="java" contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
+대출목록
+
+
+
+
+${pageTitle}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/tiles/inc/menu.jsp b/src/main/webapp/WEB-INF/tiles/inc/menu.jsp
index 7073e3a3..b19a97fa 100644
--- a/src/main/webapp/WEB-INF/tiles/inc/menu.jsp
+++ b/src/main/webapp/WEB-INF/tiles/inc/menu.jsp
@@ -31,6 +31,8 @@
암호화
프로퍼티갱신
코드조회
+ 자료상세조회:API샘플
+ 목록조회:API샘플
diff --git a/src/main/webapp/test/testRest.html b/src/main/webapp/test/testRest.html
new file mode 100644
index 00000000..4f779f1d
--- /dev/null
+++ b/src/main/webapp/test/testRest.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file