From cf1f1fec3c65995f71532a7354dd93c69dd29544 Mon Sep 17 00:00:00 2001 From: dongkyunKim Date: Sat, 24 Feb 2024 17:12:22 +0900 Subject: [PATCH] =?UTF-8?q?fix()=20:=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EB=B6=84=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matchingBoard/controller/MatchingBoardController.java | 3 +-- .../service/matchingBoard/MatchingBoardService.java | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/controller/MatchingBoardController.java b/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/controller/MatchingBoardController.java index 3748253..65d4a9e 100644 --- a/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/controller/MatchingBoardController.java +++ b/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/controller/MatchingBoardController.java @@ -1,6 +1,5 @@ package com.example.titto_backend.matchingBoard.controller; -import com.example.titto_backend.matchingBoard.domain.matchingBoard.Category; import com.example.titto_backend.matchingBoard.dto.request.MatchingPostRequest.MatchingPostPagingRequestDto; import com.example.titto_backend.matchingBoard.dto.response.matchingPostResponse.MatchingPostPagingResponseDto; import com.example.titto_backend.matchingBoard.service.matchingBoard.MatchingBoardService; @@ -64,7 +63,7 @@ public MatchingPostPagingResponseDto searchByKeyWord(@RequestParam("page") int p @ApiResponse(responseCode = "500", description = "관리자 문의") }) public MatchingPostPagingResponseDto findByCategory(@RequestParam("page") int page, - @RequestParam Category category) { + @RequestParam String category) { MatchingPostPagingRequestDto requestDto = new MatchingPostPagingRequestDto(); requestDto.setPage(page + 1); return matchingBoardService.findByCategory(requestDto, category); diff --git a/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/service/matchingBoard/MatchingBoardService.java b/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/service/matchingBoard/MatchingBoardService.java index 4cff7df..a08969f 100644 --- a/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/service/matchingBoard/MatchingBoardService.java +++ b/Titto_Backend/src/main/java/com/example/titto_backend/matchingBoard/service/matchingBoard/MatchingBoardService.java @@ -38,12 +38,13 @@ public MatchingPostPagingResponseDto searchByKeyWord(MatchingPostPagingRequestDt return MatchingPostPagingResponseDto.from(matchingPosts); } - public MatchingPostPagingResponseDto findByCategory(MatchingPostPagingRequestDto matchingPostPagingRequestDto, Category category) { + public MatchingPostPagingResponseDto findByCategory(MatchingPostPagingRequestDto matchingPostPagingRequestDto, + String category) { int page = matchingPostPagingRequestDto.getPage() - 1; Sort sort = Sort.by(Sort.Direction.DESC, "matchingPostId"); Pageable pageable = PageRequest.of(page, 10, sort); - Page matchingPosts = matchingPostRepository.findByCategory(category, pageable); + Page matchingPosts = matchingPostRepository.findByCategory(Category.valueOf(category), pageable); return MatchingPostPagingResponseDto.from(matchingPosts); } }