Revert "Merge branch 'Be/Report' into 'backend'"

This reverts merge request !126
This commit is contained in:
김한얼 2024-08-09 10:17:36 +09:00
parent da975b2e3b
commit aeb2d7f932
3 changed files with 9 additions and 6 deletions

View File

@ -9,10 +9,13 @@ import java.util.UUID;
@Repository @Repository
public interface ReportRepository extends JpaRepository<Report, Long> { public interface ReportRepository extends JpaRepository<Report, Long> {
List<Report> findByUserId(long userId);
List<Report> findByLectureId(long lectureId);
Report findByReportSetIdAndUserId(UUID reportSetId, long userId); Report findByReportSetIdAndUserId(UUID reportSetId, long userId);
List<Report> findByReportSetIdDesc(UUID reportSetId); List<Report> findByReportSetId(UUID reportSetId);
List<Report> findByLectureIdAndUserIdDesc(long lectureId, long userId); List<Report> findByLectureIdAndUserId(long lectureId, long userId);
} }

View File

@ -9,5 +9,5 @@ import java.util.UUID;
@Repository @Repository
public interface ReportSetRepository extends JpaRepository<ReportSet, UUID> { public interface ReportSetRepository extends JpaRepository<ReportSet, UUID> {
List<ReportSet> findByLectureIdDesc(long userId); List<ReportSet> findByLectureId(long userId);
} }

View File

@ -125,7 +125,7 @@ public class ReportServiceImpl implements ReportService {
@Override @Override
public List<ReportSetResponse> findReportSets(long lectureId) { public List<ReportSetResponse> findReportSets(long lectureId) {
List<ReportSet> reportSets = reportSetRepository.findByLectureIdDesc(lectureId); List<ReportSet> reportSets = reportSetRepository.findByLectureId(lectureId);
return reportSets.stream() return reportSets.stream()
.map(ReportSet::makeReportSetResponse) .map(ReportSet::makeReportSetResponse)
@ -134,7 +134,7 @@ public class ReportServiceImpl implements ReportService {
@Override @Override
public List<ReportResponse> findReports(UUID reportSetId) { public List<ReportResponse> findReports(UUID reportSetId) {
List<Report> reports = reportRepository.findByReportSetIdDesc(reportSetId); List<Report> reports = reportRepository.findByReportSetId(reportSetId);
return reports.stream() return reports.stream()
.map(Report::makeReportResponse) .map(Report::makeReportResponse)
@ -143,7 +143,7 @@ public class ReportServiceImpl implements ReportService {
@Override @Override
public List<ReportResponse> findReports(long lectureId, long userId) { public List<ReportResponse> findReports(long lectureId, long userId) {
List<Report> reports = reportRepository.findByLectureIdAndUserIdDesc(lectureId, userId); List<Report> reports = reportRepository.findByLectureIdAndUserId(lectureId, userId);
return reports.stream() return reports.stream()
.map(Report::makeReportResponse) .map(Report::makeReportResponse)