From fd98935543b99ef8697e38bd7772869ea4bdfcfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=8A=B9=EB=AF=BC?= <101695929+min429@users.noreply.github.com> Date: Sat, 31 Aug 2024 19:55:24 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=8E=98=EC=9D=B4=EC=A7=95=20=08?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=EC=9D=84=20=EC=98=A4=ED=94=84=EC=85=8B=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=EC=97=90=EC=84=9C=20=EC=BB=A4=EC=84=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=ED=95=9C=EB=8B=A4.=20(#44)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 커서 기반 페이징을 위해 dto를 수정 및 추가한다. * feat: 커서 기반 페이징을 위해 관련 controller, service를 수정한다. * feat: 커서 기반 페이징 방식으로 쿼리를 재구성한다. * refactor: 메소드 위치를 변경하고 중복 메소드를 추출한다. * feat: Controller 메소드 매핑 방식을 변경하고 dto에 nullable을 추가한다.(swagger에 명시) --- .../querydsl/interfaces/AccompanyBoardRepositoryCustom.java | 4 ++-- .../domain/accompany/service/AccompanyBoardService.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/dnd/accompany/domain/accompany/infrastructure/querydsl/interfaces/AccompanyBoardRepositoryCustom.java b/src/main/java/com/dnd/accompany/domain/accompany/infrastructure/querydsl/interfaces/AccompanyBoardRepositoryCustom.java index d343031..ab5fa14 100644 --- a/src/main/java/com/dnd/accompany/domain/accompany/infrastructure/querydsl/interfaces/AccompanyBoardRepositoryCustom.java +++ b/src/main/java/com/dnd/accompany/domain/accompany/infrastructure/querydsl/interfaces/AccompanyBoardRepositoryCustom.java @@ -7,8 +7,8 @@ import com.dnd.accompany.domain.accompany.entity.enums.Region; public interface AccompanyBoardRepositoryCustom { - - Slice findBoardThumbnails(String cursor, int size, Region region); + + Slice findBoardThumbnails(String cursor, int size, Region region); Slice findRecordThumbnails(String cursor, int size, Long userId); diff --git a/src/main/java/com/dnd/accompany/domain/accompany/service/AccompanyBoardService.java b/src/main/java/com/dnd/accompany/domain/accompany/service/AccompanyBoardService.java index 015d04c..53799d1 100644 --- a/src/main/java/com/dnd/accompany/domain/accompany/service/AccompanyBoardService.java +++ b/src/main/java/com/dnd/accompany/domain/accompany/service/AccompanyBoardService.java @@ -60,6 +60,7 @@ public PageResponse getMyBoards(PageRequest request, Lo return new PageResponse<>(sliceResult.hasNext(), thumbnails, getLastCursor(sliceResult.getContent())); } + @Transactional(readOnly = true) public PageResponse getMatchedBoards(PageRequest request, String keyword) { Slice sliceResult = accompanyBoardRepository.findBoardThumbnailsByKeyword(request.cursor(), request.size(), keyword);