Skip to content

Commit

Permalink
[feat] #17 기본 게시글 조회 api controller 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
RyuKwanKon committed Jan 3, 2024
1 parent 024485d commit 25484b2
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
public class PostController {
private final PostService postService;

@GetMapping("/search")
public ResponseEntity<SuccessResponse<?>> searchTextPost(@UserId final Long userId,
@RequestParam final String text,
final Pageable pageable) {
final PostSearchResponseDto responseDto = postService.searchTextPost(userId, text, pageable);
@GetMapping
public ResponseEntity<SuccessResponse<?>> getAllPosts(@UserId final Long userId,
@RequestParam final String type,
final Pageable pageable){
final PostSearchResponseDto responseDto = postService.getAllPosts(userId, type, pageable);
return SuccessResponse.ok(responseDto);
}

Expand All @@ -31,4 +31,12 @@ public ResponseEntity<SuccessResponse<?>> searchKeyWordPost(@UserId final Long u
final PostSearchResponseDto responseDto = postService.searchKeyWordPost(userId, key, type, pageable);
return SuccessResponse.ok(responseDto);
}

@GetMapping("/search")
public ResponseEntity<SuccessResponse<?>> searchTextPost(@UserId final Long userId,
@RequestParam final String text,
final Pageable pageable) {
final PostSearchResponseDto responseDto = postService.searchTextPost(userId, text, pageable);
return SuccessResponse.ok(responseDto);
}
}

0 comments on commit 25484b2

Please sign in to comment.