feat: 관리자 - 컨텐츠관리 - 팝업관리 paging 처리 건

thkim
thkim 2024-01-24 10:40:55 +09:00
parent 1ed8437fb3
commit 8f45a131bf
2 changed files with 7 additions and 7 deletions

View File

@ -8,5 +8,4 @@ import java.util.List;
public interface TnPopupMngRepositoryWithoutPopupContents extends JpaRepository<TnPopupMngWithoutPopupContents, Long> {
}

View File

@ -42,13 +42,8 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
"\n--------------------------------------------------------------\n"
);
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(pageable.getPageNumber());
paginationInfo.setRecordCountPerPage(pageable.getPageSize());
paginationInfo.setPageSize(5);//hard coded
paginationInfo.setTotalRecordCount(123);//hard coded
Long totalRecordCount = tnPopupMngRepositoryWithoutPopupContents.count();
//List<Map<String, Object>> listPopup = tnPopupMngRepositoryWithoutPopupContents.findAll(Sort.by(Sort.Direction.DESC, "popupSeq"))
List<Map<String, Object>> listPopup = tnPopupMngRepositoryWithoutPopupContents.findAll(pageable)
.stream()
@ -70,6 +65,12 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
})
.collect(Collectors.toList());
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(pageable.getPageNumber()+1);
paginationInfo.setRecordCountPerPage(pageable.getPageSize());
paginationInfo.setPageSize(5);//hard coded
paginationInfo.setTotalRecordCount(totalRecordCount.intValue());//hard coded
Map<String, Object> dto = new HashMap<String, Object>();
dto.put("listPopup", listPopup);
dto.put("paginationInfo", paginationInfo);