Skip to content

Commit

Permalink
Modify: 코어님 코드리뷰 반영하여 수정 #2
Browse files Browse the repository at this point in the history
  • Loading branch information
seun0123 committed Nov 3, 2024
1 parent ef1ff36 commit c4fbdba
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.example.seun.repository.LectureRegistrationRepository;
import com.example.seun.repository.LectureRepository;
import com.example.seun.repository.StudentRepository;
import jakarta.transaction.Transactional;
import org.springframework.transaction.annotation.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down Expand Up @@ -40,7 +40,7 @@ public void LectureRegistration(Long studentId, Long lectureId) {
lectureRegistrationRepository.save(lectureRegistration);
}

@Transactional
@Transactional(readOnly = true)
public LectureRegisteredStudentsResponseDto getStudentsByLecture(Long lectureId) {
List<LectureRegisteredStudentForLectureDto> students = lectureRegistrationRepository.findByLectureId(lectureId).stream()
.map(LectureRegistration::getStudent)
Expand All @@ -49,7 +49,7 @@ public LectureRegisteredStudentsResponseDto getStudentsByLecture(Long lectureId)
return new LectureRegisteredStudentsResponseDto(students);
}

@Transactional
@Transactional(readOnly = true)
public LectureRegisteredLecturesResponseDto getLecturesByStudent(Long studentId) {
List<LectureRegisteredLectureForStudentDto> lectures = lectureRegistrationRepository.findByStudent_Id(studentId).stream()
.map(LectureRegistration::getLecture)
Expand Down

0 comments on commit c4fbdba

Please sign in to comment.