feat : report 정렬 변경
This commit is contained in:
parent
e0438c7a7a
commit
fa9361ca2d
@ -9,13 +9,9 @@ import java.util.UUID;
|
||||
|
||||
@Repository
|
||||
public interface ReportRepository extends JpaRepository<Report, Long> {
|
||||
List<Report> findByUserId(long userId);
|
||||
|
||||
List<Report> findByLectureId(long lectureId);
|
||||
|
||||
Report findByReportSetIdAndUserId(UUID reportSetId, long userId);
|
||||
|
||||
List<Report> findByReportSetId(UUID reportSetId);
|
||||
List<Report> findByReportSetIdOrderById(UUID reportSetId);
|
||||
|
||||
List<Report> findByLectureIdAndUserId(long lectureId, long userId);
|
||||
List<Report> findByLectureIdAndUserIdOrderById(long lectureId, long userId);
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ import java.util.UUID;
|
||||
|
||||
@Repository
|
||||
public interface ReportSetRepository extends JpaRepository<ReportSet, UUID> {
|
||||
List<ReportSet> findByLectureId(long userId);
|
||||
List<ReportSet> findByLectureIdOrderById(long userId);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
@Override
|
||||
public List<ReportSetResponse> findReportSets(long lectureId) {
|
||||
List<ReportSet> reportSets = reportSetRepository.findByLectureId(lectureId);
|
||||
List<ReportSet> reportSets = reportSetRepository.findByLectureIdOrderById(lectureId);
|
||||
|
||||
return reportSets.stream()
|
||||
.map(ReportSet::makeReportSetResponse)
|
||||
@ -134,7 +134,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
@Override
|
||||
public List<ReportResponse> findReports(UUID reportSetId) {
|
||||
List<Report> reports = reportRepository.findByReportSetId(reportSetId);
|
||||
List<Report> reports = reportRepository.findByReportSetIdOrderById(reportSetId);
|
||||
|
||||
return reports.stream()
|
||||
.map(Report::makeReportResponse)
|
||||
@ -143,7 +143,7 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
@Override
|
||||
public List<ReportResponse> findReports(long lectureId, long userId) {
|
||||
List<Report> reports = reportRepository.findByLectureIdAndUserId(lectureId, userId);
|
||||
List<Report> reports = reportRepository.findByLectureIdAndUserIdOrderById(lectureId, userId);
|
||||
|
||||
return reports.stream()
|
||||
.map(Report::makeReportResponse)
|
||||
|
Loading…
Reference in New Issue
Block a user