Skip to content

Commit

Permalink
refactor: change page size 10 to 5 [#335]
Browse files Browse the repository at this point in the history
  • Loading branch information
kho903 committed Feb 13, 2022
1 parent a4b6f2f commit 3f070b4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public ServiceResult updateFaq(String token, FaqUpdateDto faqUpdateDto) {

public Page<FaqSearchResultDto> search(String word, int page) {
Page<Faq> 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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Page<FarmQnaResponseDto> getFarmQnaPaging(int page, String token) {
tokenService.validTokenAuthority(token);

Page<FarmQna> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Page<QnaResponseDto> getQnaPaging(int page, String token) {
tokenService.validTokenAuthority(token);

Page<Qna> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public Page<ManagerRequestDto> findPagingManager(int page, String token) {

tokenService.validTokenSuper(token);
Page<Manager> 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ServiceResult addNews(String token, NewsRequestDto newsRequestDto) {
}

public Page<NewsResponseDto> getNewsPaging(int page) {
Page<News> newsList = newsRepository.findAll(PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, "id")));
Page<News> newsList = newsRepository.findAll(PageRequest.of(page, 5, Sort.by(Sort.Direction.DESC, "id")));
return newsList.map(news -> newsMapper.toResponseDto(news));
}

Expand Down

0 comments on commit 3f070b4

Please sign in to comment.