-
Notifications
You must be signed in to change notification settings - Fork 29
Feature/#1357 로드맵 답변 수정 기능 #1364
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
Conversation
SonarCloud Quality Gate failed.
|
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.
안녕하세요 연어~
간단하게 리뷰 달았는데 확인 부탁드립니다! 😊
essayAnswerService.deleteEssayAnswer(essayAnswerId, member.getId()); | ||
return ResponseEntity.noContent().build(); | ||
} | ||
|
||
@GetMapping("/quizzes/{quizId}") | ||
public ResponseEntity<QuizResponse> findQuizById(@PathVariable Long quizId) { | ||
public ResponseEntity<QuizResponse> findEssayAnswerById(@PathVariable Long quizId) { |
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.
quizService
에서 정보를 받아와서 QuizResponse
를 반환하고 있는데 메서드명을 findEssayAnswerById()
로 하신 이유가 있나요?_?
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 ResponseEntity<Void> updateById(@PathVariable Long essayAnswerId, | ||
@AuthMemberPrincipal LoginMember member, | ||
@RequestBody EssayAnswerUpdateRequest request) { | ||
essayAnswerService.updateEssayAnswer(essayAnswerId, request.getAnswer(), member.getId()); |
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.
저는 개인적으로 객체 자체를 service로 넘기는 것을 더 선호하는 편인데요! (EssayAnswerUpdateRequest
에 대해 변경사항이 발생했을 때 Controller까지 영향을 받는 것을 막기 위함)
단일 인자여도 객체 자체를 넘기는 것이 더 좋지 않을까요?
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.
DTO가 변경됐을 때
컨트롤러가 변경되는 것 VS 서비스가 변경되는 것
위 둘의 차이일 것 같아요!
사실 저도 DTO를 그대로 넘기는 것을 선호하는데, 기존에 만들어둔 서비스의 메서드를 사용하기 위해 저렇게 했습니다.
서비스 메서드도 수정하는 것이 나을 것 같네요!
@Then("답변(들)이 조회된다") | ||
public void 답변이조회된다() { | ||
int statusCode = context.response.statusCode(); | ||
assertThat(statusCode).isEqualTo(HttpStatus.OK.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.
조회의 경우 상태 코드 말고 어떤 응답값이 내려왔는지도 함께 검증해야 하지 않을까요?
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.
|
||
@When("{long}번 퀴즈에 대한 답변들을 조회하면") | ||
public void 퀴즈에대한답변을들조회하면(final long quizId) { | ||
context.invokeHttpGet("/quizzes/" + quizId + "/essay-answers"); |
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.
여기도 마찬가지로 조회이기 때문에 응답 값 정도는 함께 검증해야 될 것 같습니다!
#️⃣연관된 이슈
📝작업 내용