Conversation
added 3 commits
October 3, 2023 01:00
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#과제 내용 : 벌점 api 수정 - 점수 누적 구현하기
학생 테이블에 'totalPanalty' 컬럼 추가
@Column(nullable = false) private Integer totalPenalty;not null 설정하면 에러 발생...그래서
private Integer totalPenalty;만 선언StudentInLectureService 클래스의 updatePenalty 메서드 수정
문제의 코드 :
previousPenalty = Penalty.valueOf(studentInLecture.getPenalty());발생한 에러 : Penalty Enum의 valueOf 메서드는 문자열을 인자로 받아 해당하는 Enum 상수를 반환하는데, studentInLecture.getPenalty()가 Integer 타입인 벌점 값이므로 인자 타입이 일치하지 않아 에러가 발생
해결 :
previousPenalty = Penalty.values()[studentInLecture.getPenalty()];StudentInLectureController의 handleUpdateStudentInLecture 메소드 수정