Merge branch 'revert-da975b2e' into 'backend'
Revert "Merge branch 'Be/Report' into 'backend'" See merge request s11-webmobile1-sub2/S11P12A701!127
This commit is contained in:
commit
935331e7e9
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user