From 3f070b4168dcef5281f9c2a4c4ae0d4ca6c462ba Mon Sep 17 00:00:00 2001 From: kho903 Date: Sun, 13 Feb 2022 22:58:36 +0900 Subject: [PATCH] refactor: change page size 10 to 5 [#335] --- .../bancow/bancowback/domain/main/faq/service/FaqService.java | 2 +- .../bancowback/domain/main/farmqna/service/FarmQnaService.java | 2 +- .../bancow/bancowback/domain/main/qna/service/QnaService.java | 2 +- .../bancowback/domain/manager/service/ManagerService.java | 2 +- .../bancow/bancowback/domain/sub/news/service/NewsService.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spring/src/main/java/com/bancow/bancowback/domain/main/faq/service/FaqService.java b/spring/src/main/java/com/bancow/bancowback/domain/main/faq/service/FaqService.java index 22dfd389..2f338190 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/main/faq/service/FaqService.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/main/faq/service/FaqService.java @@ -98,7 +98,7 @@ public ServiceResult updateFaq(String token, FaqUpdateDto faqUpdateDto) { public Page search(String word, int page) { Page pageFaq = faqRepository.findByTitleContainingWithPagination(word, - PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, "id"))); + PageRequest.of(page, 5, Sort.by(Sort.Direction.DESC, "id"))); return pageFaq.map(faqMapper::toSearchResultDto); } } diff --git a/spring/src/main/java/com/bancow/bancowback/domain/main/farmqna/service/FarmQnaService.java b/spring/src/main/java/com/bancow/bancowback/domain/main/farmqna/service/FarmQnaService.java index e3e262f3..d3c68e49 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/main/farmqna/service/FarmQnaService.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/main/farmqna/service/FarmQnaService.java @@ -57,7 +57,7 @@ public Page getFarmQnaPaging(int page, String token) { tokenService.validTokenAuthority(token); Page farmQnaPage = farmQnaRepository.findAll( - PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, "id")) + PageRequest.of(page, 5, Sort.by(Sort.Direction.DESC, "id")) ); return farmQnaPage.map(farmQnaMapper::toResponse); } diff --git a/spring/src/main/java/com/bancow/bancowback/domain/main/qna/service/QnaService.java b/spring/src/main/java/com/bancow/bancowback/domain/main/qna/service/QnaService.java index cfe4fbfb..5bb1b94f 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/main/qna/service/QnaService.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/main/qna/service/QnaService.java @@ -48,7 +48,7 @@ public Page getQnaPaging(int page, String token) { tokenService.validTokenAuthority(token); Page qnaList = qnaRepository.findAll( - PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, "id")) + PageRequest.of(page, 5, Sort.by(Sort.Direction.DESC, "id")) ); return qnaList.map(qnaMapper::toResponse); } diff --git a/spring/src/main/java/com/bancow/bancowback/domain/manager/service/ManagerService.java b/spring/src/main/java/com/bancow/bancowback/domain/manager/service/ManagerService.java index 2b1224c6..c51b4f62 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/manager/service/ManagerService.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/manager/service/ManagerService.java @@ -115,7 +115,7 @@ public Page findPagingManager(int page, String token) { tokenService.validTokenSuper(token); Page allManager = managerRepository.findAll( - PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, "id"))); + PageRequest.of(page, 5, Sort.by(Sort.Direction.DESC, "id"))); return allManager.map(managerMapper::toRequest); } diff --git a/spring/src/main/java/com/bancow/bancowback/domain/sub/news/service/NewsService.java b/spring/src/main/java/com/bancow/bancowback/domain/sub/news/service/NewsService.java index ede3aa3e..037a8d8c 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/sub/news/service/NewsService.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/sub/news/service/NewsService.java @@ -37,7 +37,7 @@ public ServiceResult addNews(String token, NewsRequestDto newsRequestDto) { } public Page getNewsPaging(int page) { - Page newsList = newsRepository.findAll(PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, "id"))); + Page newsList = newsRepository.findAll(PageRequest.of(page, 5, Sort.by(Sort.Direction.DESC, "id"))); return newsList.map(news -> newsMapper.toResponseDto(news)); }