|
@@ -1,28 +1,65 @@
|
|
|
package com.lemon.lifecenter.common;
|
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
public class LifeCenterPaging {
|
|
|
- @Autowired
|
|
|
- private LifeCenterConfigVO config;
|
|
|
|
|
|
- private int pageSize; // 게시 글 수
|
|
|
- private int firstPageNo; // 첫 번째 페이지 번호
|
|
|
- private int prevPageNo; // 이전 페이지 번호
|
|
|
- private int startPageNo; // 시작 페이지 (페이징 네비 기준)
|
|
|
- private int pageNo; // 페이지 번호
|
|
|
- private int endPageNo; // 끝 페이지 (페이징 네비 기준)
|
|
|
- private int nextPageNo; // 다음 페이지 번호
|
|
|
- private int finalPageNo; // 마지막 페이지 번호
|
|
|
- private int totalCount; // 게시 글 전체 수
|
|
|
- private int groupCount; // 출력되는 페이징 그룹 숫자
|
|
|
- private String url;
|
|
|
- private String preFix;
|
|
|
- private String another;
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
+
|
|
|
+
|
|
|
+ private static LifeCenterConfigVO config;
|
|
|
+
|
|
|
+ private int pageSize = 0; // 게시 글 수
|
|
|
+ private int firstPageNo = 0; // 첫 번째 페이지 번호
|
|
|
+ private int prevPageNo = 0; // 이전 페이지 번호
|
|
|
+ private int startPageNo = 0; // 시작 페이지 (페이징 네비 기준)
|
|
|
+ private int pageNo = 0; // 페이지 번호
|
|
|
+ private int endPageNo = 0; // 끝 페이지 (페이징 네비 기준)
|
|
|
+ private int nextPageNo = 0; // 다음 페이지 번호
|
|
|
+ private int finalPageNo = 0; // 마지막 페이지 번호
|
|
|
+ private int totalCount = 0; // 게시 글 전체 수
|
|
|
+ private int groupCount = 0; // 출력되는 페이징 그룹 숫자
|
|
|
+ private String url = "";
|
|
|
+ private String preFix = "";
|
|
|
+ private String another = "";
|
|
|
+ private static LifeCenterPaging instance;
|
|
|
+
|
|
|
+ public static LifeCenterPaging getInstance() {
|
|
|
+ if (instance == null) {
|
|
|
+ config = new LifeCenterConfigVO();
|
|
|
+ instance = new LifeCenterPaging();
|
|
|
+ } else {
|
|
|
+ return instance;
|
|
|
+ }
|
|
|
+ return instance;
|
|
|
+ }
|
|
|
|
|
|
public LifeCenterPaging() {}
|
|
|
|
|
|
- public LifeCenterPaging( int total, int page, String param ) {
|
|
|
+// public LifeCenterPaging( int total, int page, String param ) {
|
|
|
+// System.out.println( "3s page : " + page );
|
|
|
+// System.out.println( "3s total : " + total );
|
|
|
+// System.out.println( "param : " + param );
|
|
|
+//
|
|
|
+//// System.out.println( "config.pagePrefix : " + config.pagePrefix );
|
|
|
+//// System.out.println( "config.pageDataSize : " + config.pageDataSize );
|
|
|
+//// System.out.println( "config.pageGroupSize : " + config.pageGroupSize );
|
|
|
+//
|
|
|
+// logger.error("config.pagePrefix -- > " + config);
|
|
|
+//
|
|
|
+// this.setPreFix( config.pagePrefix );
|
|
|
+// this.setPageSize( config.pageDataSize );
|
|
|
+// this.setGroupCount( config.pageGroupSize );
|
|
|
+// this.setTotalCount( total );
|
|
|
+// this.setPageNo( page );
|
|
|
+// this.setUrl( param );
|
|
|
+//
|
|
|
+// this.makePaging();
|
|
|
+// }
|
|
|
+
|
|
|
+ public void paging(int total, int page, String param) {
|
|
|
System.out.println( "3s page : " + page );
|
|
|
System.out.println( "3s total : " + total );
|
|
|
System.out.println( "param : " + param );
|
|
@@ -31,6 +68,8 @@ public class LifeCenterPaging {
|
|
|
// System.out.println( "config.pageDataSize : " + config.pageDataSize );
|
|
|
// System.out.println( "config.pageGroupSize : " + config.pageGroupSize );
|
|
|
|
|
|
+ logger.error("config.pagePrefix -- > " + config);
|
|
|
+
|
|
|
this.setPreFix( config.pagePrefix );
|
|
|
this.setPageSize( config.pageDataSize );
|
|
|
this.setGroupCount( config.pageGroupSize );
|
|
@@ -189,7 +228,7 @@ public class LifeCenterPaging {
|
|
|
*/
|
|
|
public void setTotalCount(int totalCount) {
|
|
|
this.totalCount = totalCount;
|
|
|
- this.makePaging();
|
|
|
+// this.makePaging();
|
|
|
}
|
|
|
|
|
|
public int getGroupCount() {
|