diff --git a/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java b/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java index dbc8c5b..7fafb44 100644 --- a/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java +++ b/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java @@ -146,9 +146,9 @@ public class QnaController { @GetMapping("/all/{id}") public ResponseEntity> getAllQna( @PathVariable Long id, - @RequestParam(defaultValue = "0") int page) { + @RequestParam(defaultValue = "0") int pageNo) { try { - List qnaList = qnaService.getAllQnasByLecture(id, page, PAGE_SIZE); + List qnaList = qnaService.getAllQnasByLecture(id, pageNo, PAGE_SIZE); return new ResponseEntity<>(qnaList, HttpStatus.ACCEPTED); } catch (SQLException e) { return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); diff --git a/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaService.java b/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaService.java index c8468aa..6308a95 100644 --- a/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaService.java +++ b/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaService.java @@ -22,7 +22,7 @@ public interface QnaService { QnaResponseDto getQna(Long id, Long userId) throws SQLException; - List getAllQnasByLecture(Long lectureId, int page, int pageNumber) throws SQLException; + List getAllQnasByLecture(Long lectureId, int pageNo, int pageNumber) throws SQLException; QnaResponseDto createAnswer(Long id, QnaRequestDto qnaRequestDto) throws SQLException; diff --git a/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java index b2b346a..a60b3d9 100644 --- a/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java @@ -120,8 +120,8 @@ public class QnaServiceImpl implements QnaService { } @Override - public List getAllQnasByLecture(Long lectureId, int page, int pageSize) { - Pageable pageable = PageRequest.of(page, pageSize); + public List getAllQnasByLecture(Long lectureId, int pageNo, int pageSize) { + Pageable pageable = PageRequest.of(pageNo, pageSize); Page qnaPage = qnaRepository.findByLectureId(lectureId, pageable); return qnaPage.getContent().stream()