API
This commit is contained in:
parent
b775148d1a
commit
1aa11bbfe5
@ -197,8 +197,13 @@ public interface DataApiInterface {
|
||||
try {
|
||||
codeInt = Integer.parseInt(code);
|
||||
} catch(Exception e) {
|
||||
log.error("회신 code 정보를 정수로 변환처리 중 오류가 발생하였습니다." + e.toString());
|
||||
codeInt = -1;
|
||||
if(StringUtil.isNotEmpty(code) && code.startsWith("S")) {
|
||||
codeInt = 0;
|
||||
} else {
|
||||
log.error("회신 code 정보를 정수로 변환처리 중 오류가 발생하였습니다." + e.toString());
|
||||
codeInt = -1;
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if(codeInt != 0) {
|
||||
|
||||
@ -28,6 +28,9 @@ import java.util.Map;
|
||||
*/
|
||||
public class DataApiReqVO {
|
||||
|
||||
public static final int DEFAULT_PAGE_SIZE = 10;
|
||||
public static final int DEFAULT_PAGE_NO = 1;
|
||||
|
||||
/* 처리결과 */
|
||||
private String authKey; /* 로그인키 */
|
||||
|
||||
@ -56,7 +59,7 @@ public class DataApiReqVO {
|
||||
}
|
||||
|
||||
public int getPageNo() {
|
||||
return pageNo;
|
||||
return (pageNo < 1 ? DEFAULT_PAGE_NO : pageNo);
|
||||
}
|
||||
|
||||
public void setPageNo(int pageNo) {
|
||||
@ -67,22 +70,21 @@ public class DataApiReqVO {
|
||||
try {
|
||||
this.pageNo = Integer.parseInt(pageNo);
|
||||
} catch(Exception e) {
|
||||
this.pageNo = 1;
|
||||
this.pageNo = DEFAULT_PAGE_NO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getPageRows() {
|
||||
return pageRows;
|
||||
return (pageRows < 1 ? DEFAULT_PAGE_SIZE : pageRows);
|
||||
}
|
||||
|
||||
public void setPageRows(String pageRows) {
|
||||
try {
|
||||
this.pageRows = Integer.parseInt(pageRows);
|
||||
} catch(Exception e) {
|
||||
this.pageRows = 10;
|
||||
this.pageRows = DEFAULT_PAGE_SIZE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setPageRows(int pageRows) {
|
||||
@ -112,5 +114,4 @@ public class DataApiReqVO {
|
||||
this.reqMethod = reqMethod;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -56,15 +56,12 @@ public class DataApiResVO {
|
||||
/* 페이징 정보 */
|
||||
int pageNo = 0; /* 요청 페이지 번호 */
|
||||
int pageTotCount = 0; /* 페이지총수 */
|
||||
int pageRows = 0; /* 페이지별 표출할 레코드 수 */
|
||||
|
||||
/* 기본정보 */
|
||||
/* 기본/추가 정보 */
|
||||
HashMap<String, Object> info = null;
|
||||
|
||||
/* 목록정보 */
|
||||
int recordCount = 0; /* 전송 실제 레코드수 */
|
||||
int recordTotCount = 0; /* 총 레코드수 */
|
||||
List<Map<String, Object>> records = null; /* 결과목록 (다건인 경우) */
|
||||
|
||||
/**
|
||||
* 응답 처리결과가 성공인지의 여부를 리턴한다.
|
||||
@ -103,34 +100,27 @@ public class DataApiResVO {
|
||||
public void setPageTotCount(int pageTotCount) {
|
||||
this.pageTotCount = pageTotCount;
|
||||
}
|
||||
public int getPageRows() {
|
||||
return pageRows;
|
||||
}
|
||||
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 int getRecordCount() {
|
||||
return recordCount;
|
||||
}
|
||||
public void setRecordCount(int recordCount) {
|
||||
this.recordCount = recordCount;
|
||||
}
|
||||
public int getRecordTotCount() {
|
||||
return recordTotCount;
|
||||
}
|
||||
public void setRecordTotCount(int recordTotCount) {
|
||||
this.recordTotCount = recordTotCount;
|
||||
}
|
||||
public List<Map<String, Object>> getRecords() {
|
||||
return records;
|
||||
}
|
||||
public void setRecords(List<Map<String, Object>> records) {
|
||||
this.records = records;
|
||||
|
||||
/**
|
||||
* 반복되는 목록용 리스트 정보를 가져온다.
|
||||
* - RESTful API : "<results>"요소로 반복되는 요소를 반환한다.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<HashMap<String, String>> getList() {
|
||||
if(info == null) return null;
|
||||
return (List<HashMap<String, String>>)info.get("results");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user