-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7주차 미션 / 서버 3조 김윤서 #12
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 리뷰가 늦어서 미안해요 😢 미션 수행하느라 고생 많으셨어요!
Object value = session.getAttribute(USER_SESSION_KEY); | ||
|
||
if (user != null && value != null) { | ||
if (user.isSameUser((User) value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isSameUser()에서 value를 User로 형변환하는 것보다는, value에 session의 값을 할당할 때 형변환하는게 다른 사람이 코드를 이해하는데 도움이 될 것 같아요!
Question question = questionRepository.findByQuestionId(questionId); | ||
question.increaseCountOfAnswer(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기에도 updateCountOfAnswer()가 있어야 하지 않나요?
User user = new User(userId, password, name, email); | ||
userRepository.insert(user); | ||
return "redirect:/"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
userId가 일치하는 회원이 존재하는지 확인하는 코드를 추가하면 좋을 것 같아요. 실제 서비스에서는 동일한 id를 갖는 회원이 존재하면 안되니까요.
log.info("updateQuestion"); | ||
Question question = questionRepository.findByQuestionId(questionId); | ||
question.updateTitleAndContents(title, contents); | ||
questionRepository.update(question); | ||
|
||
return "redirect:/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정 시에도 인가가 필요하지 않을까요?
No description provided.