OWL ITS + 탐지시스템(인터넷 진흥원)
wyu
2022-01-06 0dca48e62f053d2fa725649ee2842412a9b4f476
src/main/java/kr/wisestone/owl/util/PageUtil.java
@@ -28,17 +28,31 @@
        }
        if (pageVo.getPage() == null || pageVo.getPage() < 0) {
            throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.PAGE_NEGATIVE_OR_NULL));
            if (pageVo.getRelPage() == null || pageVo.getRelPage() < 0
                    || pageVo.getDownPage() == null || pageVo.getDownPage() < 0) {
                throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.PAGE_NEGATIVE_OR_NULL));
            }
        }
        if (pageVo.getPageSize() == null || pageVo.getPageSize() < 0) {
            throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.PAGE_SIZE_NEGATIVE_OR_NULL));
            if (pageVo.getRelPageSize() == null || pageVo.getRelPageSize() < 0
                    || pageVo.getDownPageSize() == null || pageVo.getDownPageSize() < 0) {
                throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.PAGE_SIZE_NEGATIVE_OR_NULL));
            }
        }
    }
   public Pageable convertPageable(PageVo pageVo) {
        return PageRequest.of(pageVo.getPage(), pageVo.getPageSize());
   }
    public Pageable convertRelPageable(PageVo pageVo) {
        return PageRequest.of(pageVo.getRelPage(), pageVo.getRelPageSize());
    }
    public Pageable convertDownPageable(PageVo pageVo) {
        return PageRequest.of(pageVo.getDownPage(), pageVo.getDownPageSize());
    }
   public Pageable getDefaultPageable() {
      return PageRequest.of(0, 300);
@@ -49,7 +63,7 @@
   }
   public PageVo getDefaultPageVo() {
      return new PageVo(0, 300);
      return new PageVo(0, 300,0, 300, 0, 300);
   }
   public static Pageable applySort(Pageable page, String field, Sort.Direction direction) {