-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feat] Answer, Question CRUD 로직 구현 #19
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.
수고하셨습니다! 잘 참고할게요..._〆(。。)
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.
확인 부탁드립니다. 혹시 컨트롤러 쪽은 이후 이슈로 하시는걸까요?
public String create(AnswerCreateDto answerCreateDto, Question question, Profile profile){ | ||
Answer answer = Answer.create(answerCreateDto, question, profile); | ||
answerRepository.save(answer); | ||
return answer.getId().toString(); | ||
} |
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.
create 안에 return answerRepository.save(answer)
만 남기는건 어떤가요? 저희가 Service를 CRUD로 나누려고 했던 것은 Repository와 Service에서 순환 참조가 일어나지 않도록 핵심 기능을 분리한느것이였기 때문에 안에는 Repository의 기본 메소드만 남아있는 것이 맞을 것 같습니다.
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.
좋은 지적이네요! 수정하는 게 좋을것같아요 수정하겠습니다
public String create(String content, Profile profile){ | ||
Question question = Question.create(content, profile); | ||
questionRepository.save(question); | ||
return question.getId().toString(); | ||
} |
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.
앞선 리뷰와 마찬가지입니다
네 컨트롤러랑 서비스레이어쪽은 추후에 다른 헬퍼들이 만들어졌을때 하는 게 좋을 것 같아서 따로 구현했습니다. |
Related issue 🛠
Work Description ✏️
Uncompleted Tasks 😅
To Reviewers 📢