From 25484b2b447fee949c4726efd5b83042b9ace2c9 Mon Sep 17 00:00:00 2001 From: RyuKwanKon Date: Wed, 3 Jan 2024 21:26:09 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20#17=20=EA=B8=B0=EB=B3=B8=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20api=20controller=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/post/controller/PostController.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gachon/checkmate/domain/post/controller/PostController.java b/src/main/java/org/gachon/checkmate/domain/post/controller/PostController.java index 6247135..f64fdfd 100644 --- a/src/main/java/org/gachon/checkmate/domain/post/controller/PostController.java +++ b/src/main/java/org/gachon/checkmate/domain/post/controller/PostController.java @@ -15,11 +15,11 @@ public class PostController { private final PostService postService; - @GetMapping("/search") - public ResponseEntity> searchTextPost(@UserId final Long userId, - @RequestParam final String text, - final Pageable pageable) { - final PostSearchResponseDto responseDto = postService.searchTextPost(userId, text, pageable); + @GetMapping + public ResponseEntity> getAllPosts(@UserId final Long userId, + @RequestParam final String type, + final Pageable pageable){ + final PostSearchResponseDto responseDto = postService.getAllPosts(userId, type, pageable); return SuccessResponse.ok(responseDto); } @@ -31,4 +31,12 @@ public ResponseEntity> searchKeyWordPost(@UserId final Long u final PostSearchResponseDto responseDto = postService.searchKeyWordPost(userId, key, type, pageable); return SuccessResponse.ok(responseDto); } + + @GetMapping("/search") + public ResponseEntity> searchTextPost(@UserId final Long userId, + @RequestParam final String text, + final Pageable pageable) { + final PostSearchResponseDto responseDto = postService.searchTextPost(userId, text, pageable); + return SuccessResponse.ok(responseDto); + } }