Skip to content

Commit

Permalink
add :: 유효하지 않은 학년에 대해 예외를 throw
Browse files Browse the repository at this point in the history
  • Loading branch information
ani2689 committed Jul 15, 2024
1 parent bb3f736 commit 6bb7997
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import team.msg.domain.lecture.enums.CompleteStatus
import team.msg.domain.lecture.enums.Semester
import team.msg.domain.lecture.model.LectureLocation
import team.msg.domain.lecture.repository.LectureLocationRepository
import team.msg.domain.student.exception.InvalidStudentGradeException

@Service
class LectureServiceImpl(
Expand Down Expand Up @@ -556,7 +557,8 @@ class LectureServiceImpl(
val completeStatus = when(student.grade) {
1 -> CompleteStatus.COMPLETED_IN_1RD
2 -> CompleteStatus.COMPLETED_IN_2RD
else -> CompleteStatus.COMPLETED_IN_3RD
3 -> CompleteStatus.COMPLETED_IN_3RD
else -> throw InvalidStudentGradeException("유효하지 않은 학년입니다. info : [ grade = ${student.grade} ]")
}

RegisteredLecture(
Expand Down

0 comments on commit 6bb7997

Please sign in to comment.