Skip to content

Commit

Permalink
fix: Pageable 파라미터에 @ParameterObject 어노테이션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
chaechaen committed Sep 17, 2024
1 parent 8ac3bd2 commit cd22ad2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -41,7 +42,7 @@ public ResponseEntity<Page<CompanyPostResponseDTO>> getFilteredCompanyPosts(
@RequestParam(required = false) LocalDate endDate,
@RequestParam(required = false) Gender gender,
@RequestParam(required = false) String country,
Pageable pageable) {
@ParameterObject Pageable pageable) {

Page<CompanyPostResponseDTO> filteredPosts = companyPostService.getFilteredCompanyPosts(startDate, endDate, gender, country, pageable);
return ResponseEntity.ok(filteredPosts);
Expand All @@ -51,7 +52,7 @@ public ResponseEntity<Page<CompanyPostResponseDTO>> getFilteredCompanyPosts(
@Operation(summary = "모든 동행구하기 게시글 조회")
@PreAuthorize("@securityService.isNotTemporaryUser()")
@GetMapping
public ResponseEntity<Page<CompanyPostResponseDTO>> getAllCompanyPosts(Pageable pageable) {
public ResponseEntity<Page<CompanyPostResponseDTO>> getAllCompanyPosts(@ParameterObject Pageable pageable) {
Page<CompanyPostResponseDTO> posts = companyPostService.getAllCompanyPosts(pageable);
return ResponseEntity.ok(posts);
}
Expand Down Expand Up @@ -85,7 +86,7 @@ public ResponseEntity<CompanyPostResponseDTO> createCompanyPost(
@PreAuthorize("@securityService.isNotTemporaryUser()")
@GetMapping("/user")
public ResponseEntity<Page<CompanyPostResponseDTO>> getCompanyPostsByUser(@AuthenticationPrincipal UserDetails userDetails,
Pageable pageable) {
@ParameterObject Pageable pageable) {
User user = securityService.getUserByUserDetails(userDetails);

Page<CompanyPostResponseDTO> posts = companyPostService.getCompanyPostsByUser(user, pageable);
Expand Down

0 comments on commit cd22ad2

Please sign in to comment.