diff --git a/src/main/java/cokr/xit/foundation/web/AbstractController.java b/src/main/java/cokr/xit/foundation/web/AbstractController.java index 731e265..86fa76b 100644 --- a/src/main/java/cokr/xit/foundation/web/AbstractController.java +++ b/src/main/java/cokr/xit/foundation/web/AbstractController.java @@ -173,24 +173,31 @@ public abstract class AbstractController extends AbstractBean { * @return ModelAndView */ protected ModelAndView setPagingInfo(ModelAndView mav, Collection collection, String prefix) { + Map map = null; if (collection instanceof BoundedList bounded) { - Map map = Map.of( + map = Map.of( "start", bounded.getStart(), + "dataSize", bounded.size(), "totalSize", bounded.getTotalSize(), - "fetchSize", bounded.getFetchSize() + "fetchSize", bounded.getFetchSize(), + "more", bounded.hasMore(), + "next", bounded.hasNext(), + "prev", bounded.hasPrevious() ); - mav.addObject(prefix + "List", bounded) - .addObject(prefix + "PagingInfo", map); } else { - Map map = Map.of( - "start", 0, - "totalSize", collection.size(), - "fetchSize", collection.size() - ); - mav.addObject(prefix + "List", collection) - .addObject(prefix + "PagingInfo", map); + map = Map.of( + "start", 0, + "dataSize", collection.size(), + "totalSize", collection.size(), + "fetchSize", collection.size(), + "more", false, + "next", false, + "prev", false + ); } - return mav; + return mav.addObject("prefix", prefix) + .addObject(prefix + "List", collection) + .addObject(prefix + "Paging", map); } /**한 번에 반환할 조회 결과의 수를 설정한다.