| | |
| | | } |
| | | |
| | | 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); |
| | |
| | | } |
| | | |
| | | 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) { |