Merge remote-tracking branch 'origin/master'

This commit is contained in:
JSYOO 2021-07-23 16:23:51 +09:00
commit 7a057b80d7
3 changed files with 25 additions and 29 deletions

View File

@ -197,8 +197,13 @@ public interface DataApiInterface {
try { try {
codeInt = Integer.parseInt(code); codeInt = Integer.parseInt(code);
} catch(Exception e) { } catch(Exception e) {
log.error("회신 code 정보를 정수로 변환처리 중 오류가 발생하였습니다." + e.toString()); if(StringUtil.isNotEmpty(code) && code.startsWith("S")) {
codeInt = -1; codeInt = 0;
} else {
log.error("회신 code 정보를 정수로 변환처리 중 오류가 발생하였습니다." + e.toString());
codeInt = -1;
e.printStackTrace();
}
} }
if(codeInt != 0) { if(codeInt != 0) {

View File

@ -28,6 +28,9 @@ import java.util.Map;
*/ */
public class DataApiReqVO { public class DataApiReqVO {
public static final int DEFAULT_PAGE_SIZE = 10;
public static final int DEFAULT_PAGE_NO = 1;
/* 처리결과 */ /* 처리결과 */
private String authKey; /* 로그인키 */ private String authKey; /* 로그인키 */
@ -56,7 +59,7 @@ public class DataApiReqVO {
} }
public int getPageNo() { public int getPageNo() {
return pageNo; return (pageNo < 1 ? DEFAULT_PAGE_NO : pageNo);
} }
public void setPageNo(int pageNo) { public void setPageNo(int pageNo) {
@ -67,22 +70,21 @@ public class DataApiReqVO {
try { try {
this.pageNo = Integer.parseInt(pageNo); this.pageNo = Integer.parseInt(pageNo);
} catch(Exception e) { } catch(Exception e) {
this.pageNo = 1; this.pageNo = DEFAULT_PAGE_NO;
} }
} }
public int getPageRows() { public int getPageRows() {
return pageRows; return (pageRows < 1 ? DEFAULT_PAGE_SIZE : pageRows);
} }
public void setPageRows(String pageRows) { public void setPageRows(String pageRows) {
try { try {
this.pageRows = Integer.parseInt(pageRows); this.pageRows = Integer.parseInt(pageRows);
} catch(Exception e) { } catch(Exception e) {
this.pageRows = 10; this.pageRows = DEFAULT_PAGE_SIZE;
} }
} }
public void setPageRows(int pageRows) { public void setPageRows(int pageRows) {
@ -112,5 +114,4 @@ public class DataApiReqVO {
this.reqMethod = reqMethod; this.reqMethod = reqMethod;
} }
} }

View File

@ -56,15 +56,12 @@ public class DataApiResVO {
/* 페이징 정보 */ /* 페이징 정보 */
int pageNo = 0; /* 요청 페이지 번호 */ int pageNo = 0; /* 요청 페이지 번호 */
int pageTotCount = 0; /* 페이지총수 */ int pageTotCount = 0; /* 페이지총수 */
int pageRows = 0; /* 페이지별 표출할 레코드 수 */
/* 기본정보 */ /* 기본/추가 정보 */
HashMap<String, Object> info = null; HashMap<String, Object> info = null;
/* 목록정보 */ /* 목록정보 */
int recordCount = 0; /* 전송 실제 레코드수 */
int recordTotCount = 0; /* 총 레코드수 */ int recordTotCount = 0; /* 총 레코드수 */
List<Map<String, Object>> records = null; /* 결과목록 (다건인 경우) */
/** /**
* 응답 처리결과가 성공인지의 여부를 리턴한다. * 응답 처리결과가 성공인지의 여부를 리턴한다.
@ -103,34 +100,27 @@ public class DataApiResVO {
public void setPageTotCount(int pageTotCount) { public void setPageTotCount(int pageTotCount) {
this.pageTotCount = pageTotCount; this.pageTotCount = pageTotCount;
} }
public int getPageRows() {
return pageRows;
}
public void setPageRows(int pageRows) {
this.pageRows = pageRows;
}
public HashMap<String, Object> getInfo() { public HashMap<String, Object> getInfo() {
return info; return info;
} }
public void setInfo(HashMap<String, Object> info) { public void setInfo(HashMap<String, Object> info) {
this.info = info; this.info = info;
} }
public int getRecordCount() {
return recordCount;
}
public void setRecordCount(int recordCount) {
this.recordCount = recordCount;
}
public int getRecordTotCount() { public int getRecordTotCount() {
return recordTotCount; return recordTotCount;
} }
public void setRecordTotCount(int recordTotCount) { public void setRecordTotCount(int recordTotCount) {
this.recordTotCount = recordTotCount; this.recordTotCount = recordTotCount;
} }
public List<Map<String, Object>> getRecords() {
return records; /**
} * 반복되는 목록용 리스트 정보를 가져온다.
public void setRecords(List<Map<String, Object>> records) { * - RESTful API : "<results>"요소로 반복되는 요소를 반환한다.
this.records = records; *
* @return
*/
public List<HashMap<String, String>> getList() {
if(info == null) return null;
return (List<HashMap<String, String>>)info.get("results");
} }
} }