setPagingInfo(..) 수정

master
mjkhan21 3 months ago
parent be6f8ea0b2
commit f7ed5c6b1e

@ -173,24 +173,31 @@ public abstract class AbstractController extends AbstractBean {
* @return ModelAndView
*/
protected ModelAndView setPagingInfo(ModelAndView mav, Collection<?> collection, String prefix) {
Map<String, Object> map = null;
if (collection instanceof BoundedList<?> bounded) {
Map<String, Object> 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<String, Object> map = Map.of(
map = Map.of(
"start", 0,
"dataSize", collection.size(),
"totalSize", collection.size(),
"fetchSize", collection.size()
"fetchSize", collection.size(),
"more", false,
"next", false,
"prev", false
);
mav.addObject(prefix + "List", collection)
.addObject(prefix + "PagingInfo", map);
}
return mav;
return mav.addObject("prefix", prefix)
.addObject(prefix + "List", collection)
.addObject(prefix + "Paging", map);
}
/** .<br />

Loading…
Cancel
Save