-
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
fix: 댓글 생성, 조회 수정 #52
Conversation
@GetMapping("/all") | ||
public ResponseEntity<List<CommentDetail>> getAllComments() { | ||
List<CommentDetail> comments = commentService.getAllComments(); | ||
public ResponseEntity<List<CommentDetail>> getAllComments(@RequestParam Long advertiseId) { |
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.
path variable을 사용하는게 좀 더 깔끔할것같아 url도 /api/advertises/comments/{advertiseId} 이런느낌으로 자원을 명시해주는게 좀 더 좋을것같아
return comments.stream() | ||
.map(comment -> new CommentDetail(comment.getCommentId(), comment.getContent(), comment.getCommenterId())) | ||
.map(comment -> new CommentDetail(comment.getCommentId(), comment.getContent())) |
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.
와이어프레임에 댓글 작성자 이름도 있어서 email이라도 간단하게 적어주면 좋을 것 같아
public ResponseEntity<List<CommentDetail>> getAllComments() { | ||
List<CommentDetail> comments = commentService.getAllComments(); | ||
@Operation(summary = "댓글 조회") | ||
@GetMapping("comments/{advertiseId}") |
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.
/comments 부분이 반복되서 지워주라
댓글 생성
userId 요청 제거
댓글 조회
요청변수로 advertiseId