From 3ccd5e99b0cb461d98b8c1b0741077235012ffb0 Mon Sep 17 00:00:00 2001 From: yulmam <70622601+yulmam@users.noreply.github.com> Date: Fri, 9 Aug 2024 10:12:57 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20report=20=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edufocus/report/repository/ReportRepository.java | 7 ++----- .../edufocus/report/repository/ReportSetRepository.java | 2 +- .../edufocus/report/service/ReportServiceImpl.java | 6 +++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportRepository.java b/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportRepository.java index 7665f28..7b1e1ac 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportRepository.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportRepository.java @@ -9,13 +9,10 @@ import java.util.UUID; @Repository public interface ReportRepository extends JpaRepository { - List findByUserId(long userId); - - List findByLectureId(long lectureId); Report findByReportSetIdAndUserId(UUID reportSetId, long userId); - List findByReportSetId(UUID reportSetId); + List findByReportSetIdDesc(UUID reportSetId); - List findByLectureIdAndUserId(long lectureId, long userId); + List findByLectureIdAndUserIdDesc(long lectureId, long userId); } diff --git a/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportSetRepository.java b/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportSetRepository.java index f1b484c..f4f37fb 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportSetRepository.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/repository/ReportSetRepository.java @@ -9,5 +9,5 @@ import java.util.UUID; @Repository public interface ReportSetRepository extends JpaRepository { - List findByLectureId(long userId); + List findByLectureIdDesc(long userId); } diff --git a/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java index 33d0a71..1b80593 100644 --- a/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/report/service/ReportServiceImpl.java @@ -125,7 +125,7 @@ public class ReportServiceImpl implements ReportService { @Override public List findReportSets(long lectureId) { - List reportSets = reportSetRepository.findByLectureId(lectureId); + List reportSets = reportSetRepository.findByLectureIdDesc(lectureId); return reportSets.stream() .map(ReportSet::makeReportSetResponse) @@ -134,7 +134,7 @@ public class ReportServiceImpl implements ReportService { @Override public List findReports(UUID reportSetId) { - List reports = reportRepository.findByReportSetId(reportSetId); + List reports = reportRepository.findByReportSetIdDesc(reportSetId); return reports.stream() .map(Report::makeReportResponse) @@ -143,7 +143,7 @@ public class ReportServiceImpl implements ReportService { @Override public List findReports(long lectureId, long userId) { - List reports = reportRepository.findByLectureIdAndUserId(lectureId, userId); + List reports = reportRepository.findByLectureIdAndUserIdDesc(lectureId, userId); return reports.stream() .map(Report::makeReportResponse)