-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] Service 계층 책임 분리 및 Validator 구현 (#162)
- 각 서비스(ExamService, ExamStatusService, ExamResultService, ExamSubmissionService)의 책임을 명확히 분리하고, 관련된 로직을 전담하도록 수정 - GradingService에서 점수 계산 로직을 ScoreCalculator로 위임, 관련 메서드(calculateAverageScore, calculateScoreStatistics)를 ScoreCalculator에서 처리하도록 변경 - ExamStatistics 클래스에 생성자를 추가하여 발생한 오류 해결 - 중복된 엔드포인트 및 불필요한 로직 제거 (ExamSubmissionController, GradingController) - 서비스 간 순환 참조 문제 해결을 위해 findExpiredExams 메서드를 ExamStatusService로 이동 - 각 서비스의 역할을 명확히 분리 (ExamService: CRUD, ExamQuestionService: 문제 관련, ExamResultService: 결과 조회 및 통계, ExamStatusService: 상태 변경, ExamSubmissionService: 제출 처리) - GradingService를 ExamGradingService로 이름 변경하여 채점 기능을 명확히 표현하고, AutoGradingScheduler를 ExamScheduler로 이름 변경하여 시험 스케줄링 의도를 직관적으로 표현 - 유효성 검사 로직을 기능별 Validator로 분리 (ExamBaseValidator, ExamQuestionValidator, ExamGradingValidator, ExamStatusValidator, ExamSubmissionValidator, ExamTimeValidator) - 권한 검증을 checkInstructorAccess에서 isInstructor로 변경 - 중복된 ErrorCode를 정리하고, 코드 일관성을 유지하며 재분류 - CourseAccessValidator 내 검증 로직 최적화 및 ExamSubmissionController의 검증 로직을 Validator 클래스를 통해 개선
- Loading branch information
Showing
42 changed files
with
1,262 additions
and
877 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.