We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
6.3 블로그 글 작성을 위한 API 구현하기 부분 중 Controller 부분을 보면 응답시 Entity(article)로 반환한걸로 보입니다.
@PostMapping("/api/articles") public ResponseEntity<Article> addArticle(@RequestBody AddArticleRequest request) { Article savedArticle = blogService.save(request); return ResponseEntity.status(HttpStatus.CREATED).body(savedArticle); }
entity로 반환하기 보단, DTO로 반환하는게 더욱 적절하지 않나요?
<예시>
@PostMapping("/api/articles") public ResponseEntity<ArticleResponse> addArticle(@RequestBody AddArticleRequest request) { Article savedArticle = blogService.save(request); return ResponseEntity.status(HttpStatus.CREATED).body(new ArticleResponse(savedArticle)); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
6.3 블로그 글 작성을 위한 API 구현하기 부분 중 Controller 부분을 보면 응답시 Entity(article)로 반환한걸로 보입니다.
entity로 반환하기 보단, DTO로 반환하는게 더욱 적절하지 않나요?
<예시>
The text was updated successfully, but these errors were encountered: