-
Notifications
You must be signed in to change notification settings - Fork 1
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
프로젝트 댓글 저장/수정/삭제/조회(목록) api 컨트롤러 및 스웨거 설정 #82
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.
굳은 일 도맡아 해주셔서 넘 고맙습니다..🥺✨
|
||
@RestController | ||
@RequestMapping("/projects/{projectId}/comments") | ||
@Tag(name = "Project Comment", description = "Project Comment API") |
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.
제가 아직 Swagger에 익숙하지 않아서 그런데.. 혹시 @Tag
를 쓰신 이유가 있을까요?
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.
import sixgaezzang.sidepeek.common.annotation.Login; | ||
|
||
@RestController | ||
@RequestMapping("/projects/{projectId}/comments") |
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.
혹시 /projects/{projectId}
를 제거하는 것은 어떨까요?
예전에 Rest API 관련 글을 읽었을 때, /comments/{comment_id}
만 있어도 댓글 식별이 가능하기 때문에 project/.../comment
와 같은 계층 구조를 가지고 가지 않아도 된다는 이야기를 들은 적이 있어서용!
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.
오홍 감사합니다! 생각해보니Id만으로도 식별할 수 있으니 필요는 없겠네유!!
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.
저는 댓글이 Project에 종속되어 있다고 생각하기 때문에, /projects/{projectId}
를 하면 사용자가 특정 프로젝트의 모든 관련 댓글을 쉽게 찾을 수 있기 때문에 남겼으면 좋겠다는 생각이 또 드네요!
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.
우선 url은 그대로 놓고 나중에 이야기 해볼게유우~!!
@Login | ||
Long loginId, | ||
|
||
@Schema(description = "생성할 댓글의 프로젝트 식별자", example = "1") |
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.
만약 url에서 /projects/{projectId}
을 제거하게 된다면 요부분은 바디로 받아도 될 것 같습니당!
@GetMapping | ||
@Operation(summary = "댓글 목록 조회") | ||
@ApiResponse(responseCode = "204", description = "댓글 목록 조회 성공") |
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.
혹시 프로젝트 상세 조회 시 함께 댓글이 조회되는 것 외에 따로 댓글만 조회하는 API가 필요해서 추가해 주신 걸까용?
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만 중심으로 봐주시면 될 것 같습니다🧚♀️
@Schema(description = "댓글 작성자와 로그인 사용자 일치 여부") | ||
boolean isOwner, |
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.
여기서는 익명이라 작성자 Id를 보낼 수 없어서 서버단에서 처리가 필요했습니다! 알아봐주셔서 감사합니당!🥰
isAnonymous 응답에 반영하기 |
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.
/projects/{projectId}
필요 여부에 대해 조금 더 고민해볼 필요가 있겠네요..!
고생 많으셨습니다! ❤️🔥
import sixgaezzang.sidepeek.common.annotation.Login; | ||
|
||
@RestController | ||
@RequestMapping("/projects/{projectId}/comments") |
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.
저는 댓글이 Project에 종속되어 있다고 생각하기 때문에, /projects/{projectId}
를 하면 사용자가 특정 프로젝트의 모든 관련 댓글을 쉽게 찾을 수 있기 때문에 남겼으면 좋겠다는 생각이 또 드네요!
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.
에고..! Approve 한다는 것을 까먹었네요..!
📝 Jacoco Test Coverage
|
🎫 관련 이슈
Resolves #80
✅ 구현 내용
💬 코멘트