-
Notifications
You must be signed in to change notification settings - Fork 0
Draft > Application: Draft 제목, 시리즈, URL을 임시저장 합니다. #440
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
base: develop
Are you sure you want to change the base?
Conversation
…e, path, and series article
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 하지 않아야 할 것 같지만, 수정하시면 다시 리뷰하겠습니다!
public class DraftCommandService implements | ||
DraftCreateUseCase, | ||
DraftUpdateUseCase, | ||
DraftDeleteUseCase, | ||
DraftImageCreateUseCase, | ||
DraftPatchUseCase |
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.
🎨 라인이 끝나지 않을 때 줄바꿈 시, 들여쓰기는 2탭입니다!
(중괄호, 세미콜론이 등장하기 전 줄바꿈)
@@ -72,4 +82,34 @@ private void validateOwnership(String userId, String draftId) { | |||
throw DRAFT_FORBIDDEN.exception(); | |||
} | |||
} | |||
|
|||
@Override | |||
public Draft patchTitle(String userId, String draftId, String title) { |
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.
🎨 이 순서로 배치하는 게 유지보수하기에 좋습니다!
계속 추가하다 보면 자주 실수할 수 있는 영역이네요.
class {
fields
public methods
private methods
}
public SeriesArticle patchSeriesArticle(String userId, String draftId, String seriesId, String articleId) { | ||
var seriesArticle = draftCommandPort.findSeriesArticleById(draftId) | ||
.orElseThrow(SERIES_ARTICLE_NOT_FOUND::exception); | ||
|
||
validateOwnership(userId, draftId); | ||
|
||
return draftCommandPort.updateSeriesArticle(seriesArticle.getDraftId(), seriesId, articleId); | ||
} |
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.
❗️ 시리즈 아티클을 등록하는 것이 본작업입니다.
지금 코드는 약간 오해를 담고 있는 것 같아요. 👀
구현할 기능
- 시리즈 아티클 등록
: 지금 구조와 반대로 '이미 등록되어 있습니다.' 등으로 필터
(같은 드래프트, 같은 시리즈에 대한 연결일 때) - 드래프트에 연결된 시리즈 정보 수정 (비정규화 시)
사전 조건(Preconditions)
- 요청한 사용자가 시리즈 및 드래프트에 대한 수정 권한을 갖고 있어야 합니다.
- 시리즈와 드래프트가 같은 블로그에 속해야 합니다.
var seriesArticle = draftCommandPort.findSeriesArticleById(draftId) | ||
.orElseThrow(SERIES_ARTICLE_NOT_FOUND::exception); | ||
|
||
validateOwnership(userId, draftId); |
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.
❗️ 블로그 소유권을 확인하는 함수입니다.
지금처럼 실수가 생기지 않도록 함수 이름을 수정해 둬야 할 것 같기도 하네요. 저도 헷갈렸던 경험이 있어서 이참에 수정하는 게 좋을 것 같습니다!
이 요청 처리에는 사용자로부터 드래프트 소유권, 시리즈 소유권을 모두 확인해야 하고, 두 자원(드래프트, 시리즈)이 같은 블로그에 속해야 하므로 이하 확인이 필요해 보여요.
사전 조건
- 드래프트의 블로그 아이디와 시리즈의 블로그 아이디가 일치.
- 사용자가 해당 블로그의 소유권을 갖고 있음.
바쁜 중에 작업하다 보면 이렇게 리뷰로 확인할 수 있는 부분이 있어 리뷰 문화의 중요함을 알게 되네요.
앞으로 제 실수도 자주 발견되면 좋겠습니다!
…e, path, and series article
Issues
Description
Review Points
How Has This Been Tested?