addInfoItem 기능 추가
This commit is contained in:
parent
da6920107b
commit
96e122971f
@ -1,117 +1,139 @@
|
||||
package nlib.restful.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : DataApiReqVO.java
|
||||
*
|
||||
* @Description : RESTful API 요청 VO
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 6. 22. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 6. 22.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class DataApiReqVO {
|
||||
|
||||
public static final int DEFAULT_PAGE_SIZE = 10;
|
||||
public static final int DEFAULT_PAGE_NO = 1;
|
||||
|
||||
/* 처리결과 */
|
||||
private String authKey; /* 로그인키 */
|
||||
|
||||
/* 페이징 정보 */
|
||||
private int pageNo = 0; /* 요청 페이지 번호 */
|
||||
private int pageRows = 0; /* 페이지별 표출할 레코드 수 */
|
||||
|
||||
/* 기본정보 */
|
||||
private HashMap<String, Object> info = null;
|
||||
|
||||
public boolean hasInfo() {
|
||||
return (info != null && info.size() > 0);
|
||||
}
|
||||
|
||||
/* 요청업무ID 및 처리URI */
|
||||
int reqMethod; /* 요청메소드구분값 */
|
||||
String reqUrl; /* 요청업무ID에 대한 통합시스템의 응답 처리 프로그램 URI */
|
||||
|
||||
// GET/SET
|
||||
public String getAuthKey() {
|
||||
return authKey;
|
||||
}
|
||||
|
||||
public void setAuthKey(String authKey) {
|
||||
this.authKey = authKey;
|
||||
}
|
||||
|
||||
public int getPageNo() {
|
||||
return (pageNo < 1 ? DEFAULT_PAGE_NO : pageNo);
|
||||
}
|
||||
|
||||
public void setPageNo(int pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(String pageNo) {
|
||||
try {
|
||||
this.pageNo = Integer.parseInt(pageNo);
|
||||
} catch(Exception e) {
|
||||
this.pageNo = DEFAULT_PAGE_NO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getPageRows() {
|
||||
return (pageRows < 1 ? DEFAULT_PAGE_SIZE : pageRows);
|
||||
}
|
||||
|
||||
public void setPageRows(String pageRows) {
|
||||
try {
|
||||
this.pageRows = Integer.parseInt(pageRows);
|
||||
} catch(Exception e) {
|
||||
this.pageRows = DEFAULT_PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPageRows(int pageRows) {
|
||||
this.pageRows = pageRows;
|
||||
}
|
||||
|
||||
public HashMap<String, Object> getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setInfo(HashMap<String, Object> 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;
|
||||
}
|
||||
|
||||
}
|
||||
package nlib.restful.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : DataApiReqVO.java
|
||||
*
|
||||
* @Description : RESTful API 요청 VO
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 6. 22. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 6. 22.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class DataApiReqVO {
|
||||
|
||||
public static final int DEFAULT_PAGE_SIZE = 10;
|
||||
public static final int DEFAULT_PAGE_NO = 1;
|
||||
|
||||
/* 처리결과 */
|
||||
private String authKey; /* 로그인키 */
|
||||
|
||||
/* 페이징 정보 */
|
||||
private int pageNo = 0; /* 요청 페이지 번호 */
|
||||
private int pageRows = 0; /* 페이지별 표출할 레코드 수 */
|
||||
|
||||
/* 기본정보 */
|
||||
private HashMap<String, Object> info = null;
|
||||
|
||||
public boolean hasInfo() {
|
||||
return (info != null && info.size() > 0);
|
||||
}
|
||||
|
||||
/* 요청업무ID 및 처리URI */
|
||||
int reqMethod; /* 요청메소드구분값 */
|
||||
String reqUrl; /* 요청업무ID에 대한 통합시스템의 응답 처리 프로그램 URI */
|
||||
|
||||
// GET/SET
|
||||
public String getAuthKey() {
|
||||
return authKey;
|
||||
}
|
||||
|
||||
public void setAuthKey(String authKey) {
|
||||
this.authKey = authKey;
|
||||
}
|
||||
|
||||
public int getPageNo() {
|
||||
return (pageNo < 1 ? DEFAULT_PAGE_NO : pageNo);
|
||||
}
|
||||
|
||||
public void setPageNo(int pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(String pageNo) {
|
||||
try {
|
||||
this.pageNo = Integer.parseInt(pageNo);
|
||||
} catch(Exception e) {
|
||||
this.pageNo = DEFAULT_PAGE_NO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getPageRows() {
|
||||
return (pageRows < 1 ? DEFAULT_PAGE_SIZE : pageRows);
|
||||
}
|
||||
|
||||
public void setPageRows(String pageRows) {
|
||||
try {
|
||||
this.pageRows = Integer.parseInt(pageRows);
|
||||
} catch(Exception e) {
|
||||
this.pageRows = DEFAULT_PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPageRows(int pageRows) {
|
||||
this.pageRows = pageRows;
|
||||
}
|
||||
|
||||
public HashMap<String, Object> getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setInfo(HashMap<String, Object> 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;
|
||||
}
|
||||
|
||||
public void addInfoItem(String key, String value) {
|
||||
if(key == null) return;
|
||||
|
||||
if(info == null) info = new HashMap<String, Object>();
|
||||
|
||||
info.put(key, value);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,126 +1,134 @@
|
||||
package nlib.restful.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : DataApiResVO.java
|
||||
*
|
||||
* @Description : RESTful API 응답 VO
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 6. 22. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 6. 22.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class DataApiResVO {
|
||||
|
||||
/**
|
||||
* 생성자
|
||||
*/
|
||||
public DataApiResVO() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* 생성자
|
||||
*
|
||||
* @param resultCode
|
||||
* @param resultMessage
|
||||
*/
|
||||
public DataApiResVO(String resultCode, String resultMessage) {
|
||||
this.resultCode = resultCode;
|
||||
this.resultMessage = resultMessage;
|
||||
}
|
||||
|
||||
|
||||
/* 처리결과 */
|
||||
String resultCode; /* 결과코드 */
|
||||
String resultMessage; /* 결과내용(오류내용) */
|
||||
|
||||
/* 페이징 정보 */
|
||||
int pageNo = 0; /* 요청 페이지 번호 */
|
||||
int pageTotCount = 0; /* 페이지총수 */
|
||||
|
||||
/* 기본/추가 정보 */
|
||||
HashMap<String, Object> info = null;
|
||||
|
||||
/* 목록정보 */
|
||||
int recordTotCount = 0; /* 총 레코드수 */
|
||||
|
||||
/**
|
||||
* 응답 처리결과가 성공인지의 여부를 리턴한다.
|
||||
* 결과코드(resultCode)의 값이 "S"로 시작하는 경우 true 리턴한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isSuccess() {
|
||||
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 getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
public void setPageNo(int pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
public int getPageTotCount() {
|
||||
return pageTotCount;
|
||||
}
|
||||
public void setPageTotCount(int pageTotCount) {
|
||||
this.pageTotCount = pageTotCount;
|
||||
}
|
||||
public HashMap<String, Object> getInfo() {
|
||||
return info;
|
||||
}
|
||||
public void setInfo(HashMap<String, Object> info) {
|
||||
this.info = info;
|
||||
}
|
||||
public int getRecordTotCount() {
|
||||
return recordTotCount;
|
||||
}
|
||||
public void setRecordTotCount(int recordTotCount) {
|
||||
this.recordTotCount = recordTotCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 반복되는 목록용 리스트 정보를 가져온다.
|
||||
* - RESTful API : "<results>"요소로 반복되는 요소를 반환한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<HashMap<String, String>> getList() {
|
||||
if(info == null) return null;
|
||||
return (List<HashMap<String, String>>)info.get("results");
|
||||
}
|
||||
}
|
||||
package nlib.restful.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : DataApiResVO.java
|
||||
*
|
||||
* @Description : RESTful API 응답 VO
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 6. 22. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 6. 22.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class DataApiResVO {
|
||||
|
||||
/**
|
||||
* 생성자
|
||||
*/
|
||||
public DataApiResVO() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* 생성자
|
||||
*
|
||||
* @param resultCode
|
||||
* @param resultMessage
|
||||
*/
|
||||
public DataApiResVO(String resultCode, String resultMessage) {
|
||||
this.resultCode = resultCode;
|
||||
this.resultMessage = resultMessage;
|
||||
}
|
||||
|
||||
|
||||
/* 처리결과 */
|
||||
String resultCode; /* 결과코드 */
|
||||
String resultMessage; /* 결과내용(오류내용) */
|
||||
|
||||
/* 페이징 정보 */
|
||||
int pageNo = 0; /* 요청 페이지 번호 */
|
||||
int pageTotCount = 0; /* 페이지총수 */
|
||||
|
||||
/* 기본/추가 정보 */
|
||||
HashMap<String, Object> info = null;
|
||||
|
||||
/* 목록정보 */
|
||||
int recordTotCount = 0; /* 총 레코드수 */
|
||||
|
||||
/**
|
||||
* 응답 처리결과가 성공인지의 여부를 리턴한다.
|
||||
* 결과코드(resultCode)의 값이 "S"로 시작하는 경우 true 리턴한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isSuccess() {
|
||||
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 getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
public void setPageNo(int pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
public int getPageTotCount() {
|
||||
return pageTotCount;
|
||||
}
|
||||
public void setPageTotCount(int pageTotCount) {
|
||||
this.pageTotCount = pageTotCount;
|
||||
}
|
||||
public HashMap<String, Object> getInfo() {
|
||||
return info;
|
||||
}
|
||||
public void setInfo(HashMap<String, Object> info) {
|
||||
this.info = info;
|
||||
}
|
||||
public int getRecordTotCount() {
|
||||
return recordTotCount;
|
||||
}
|
||||
public void setRecordTotCount(int recordTotCount) {
|
||||
this.recordTotCount = recordTotCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 반복되는 목록용 리스트 정보를 가져온다.
|
||||
* - RESTful API : "<results>"요소로 반복되는 요소를 반환한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<HashMap<String, String>> getList() {
|
||||
if(info == null) return null;
|
||||
return (List<HashMap<String, String>>)info.get("results");
|
||||
}
|
||||
|
||||
|
||||
public String getInfoItem(String key) {
|
||||
if(key == null) return null;
|
||||
if(info == null) return null;
|
||||
|
||||
return (String)info.get(key);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user