Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yskim6772
Copy link
Member

No description provided.

Copy link

@JangIkhwan JangIkhwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 리뷰가 늦어서 미안해요 😢 미션 수행하느라 고생 많으셨어요!

Comment on lines +79 to +82
Object value = session.getAttribute(USER_SESSION_KEY);

if (user != null && value != null) {
if (user.isSameUser((User) value)) {

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의 값을 할당할 때 형변환하는게 다른 사람이 코드를 이해하는데 도움이 될 것 같아요!

Comment on lines +84 to +86
Question question = questionRepository.findByQuestionId(questionId);
question.increaseCountOfAnswer();

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:/";
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

userId가 일치하는 회원이 존재하는지 확인하는 코드를 추가하면 좋을 것 같아요. 실제 서비스에서는 동일한 id를 갖는 회원이 존재하면 안되니까요.

Comment on lines +116 to +121
log.info("updateQuestion");
Question question = questionRepository.findByQuestionId(questionId);
question.updateTitleAndContents(title, contents);
questionRepository.update(question);

return "redirect:/";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정 시에도 인가가 필요하지 않을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants