-
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
[Feature] Task API 작성 (#33) #34
Conversation
) : BaseEntity() | ||
) : BaseEntity() { | ||
|
||
companion object { |
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.
Java에서는 protected 또는 public 생성자가 필요한 걸로 알고 있는데
일단 합치고 추후에 같이 확인해봐요!
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.
아 엔티티에 필요한 생성자를 고려하지 못했군요.. 문제가 생길 수 있는지 확인해봐야겠습니다.
return ResponseEntity.ok().build() | ||
} | ||
|
||
@PatchMapping("/{taskId}/isDone") |
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.
이 부분도 결국 취향이라 생각해서 조심스러운데요..ㅎㅎ
Restful 원칙에서 소문자를 쓰라고 가이드한다는 점과 dash를 사용하라고 가이드하는 점이 봤을 때 /{taskId}/is-done도 한번 고려해봐도 좋을 것 같습니다!
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.
진호님 고생하셨습니다~!
1. 구현 내용
일단은 평범한 CUD입니다. Task를 생성하고, description과 isDone을 수정하고, 삭제하는 4가지 API를 구현했습니다.
"/{taskId}/description"
"/{taskId}/isDone"
코드가 너무 지저분한데, 더 나은 방법이 있는지 고민됩니다...
처음엔 새로운 객체를 내놓으려 했는데, CreateAt이 변경될 것이 걱정되어 일단 이렇게 구현했습니다.
더 나은 방법이 있는지 고민됩니다.. 실제로 CreateAt에 직접 값을 대입할 수 있게 만들 수 있다면, 새로운 객체를 반환해도 될 것 같은데, 한번 고민해보겠습니다.