Skip to content

Conversation

wowddok99
Copy link
Contributor

…e, path, and series article

Issues

Description

  • Draft 제목 임시저장을 어플리케이션 영역에 추가하였습니다.
  • Draft 시리즈 임시저장을 어플리케이션 영역에 추가하였습니다.
  • Draft URL 임시저장을 어플리케이션 영역에 추가하였습니다.-

Review Points

  • UseCase, Service, Port 전반의 네이밍과 파라미터가 기획 의도와 일치하는지 검토 부탁드립니다

How Has This Been Tested?

  • 테스트 생략

@wowddok99 wowddok99 added this to the ✨ General Backlog milestone Sep 8, 2025
@wowddok99 wowddok99 self-assigned this Sep 8, 2025
@wowddok99 wowddok99 changed the title raft > Application: Draft 제목, 시리즈, URL 임시저장을 추가하였습니다. Draft > Application: Draft 제목, 시리즈, URL 임시저장을 추가하였습니다. Sep 8, 2025
@wowddok99 wowddok99 changed the title Draft > Application: Draft 제목, 시리즈, URL 임시저장을 추가하였습니다. Draft > Application: Draft 제목, 시리즈, URL을 임시저장 합니다. Sep 8, 2025
Copy link
Member

@merge-simpson merge-simpson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빠른 작업 감사합니다...! 💪
조금 더 고칠 부분도 발견되어서 아직은 approve 하지 않아야 할 것 같지만, 수정하시면 다시 리뷰하겠습니다!

Comment on lines 25 to 30
public class DraftCommandService implements
DraftCreateUseCase,
DraftUpdateUseCase,
DraftDeleteUseCase,
DraftImageCreateUseCase,
DraftPatchUseCase
Copy link
Member

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) {
Copy link
Member

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
}

Comment on lines 107 to 114
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);
}
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗️ 블로그 소유권을 확인하는 함수입니다.

지금처럼 실수가 생기지 않도록 함수 이름을 수정해 둬야 할 것 같기도 하네요. 저도 헷갈렸던 경험이 있어서 이참에 수정하는 게 좋을 것 같습니다!

이 요청 처리에는 사용자로부터 드래프트 소유권, 시리즈 소유권을 모두 확인해야 하고, 두 자원(드래프트, 시리즈)이 같은 블로그에 속해야 하므로 이하 확인이 필요해 보여요.

사전 조건

  • 드래프트의 블로그 아이디와 시리즈의 블로그 아이디가 일치.
  • 사용자가 해당 블로그의 소유권을 갖고 있음.

바쁜 중에 작업하다 보면 이렇게 리뷰로 확인할 수 있는 부분이 있어 리뷰 문화의 중요함을 알게 되네요.
앞으로 제 실수도 자주 발견되면 좋겠습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants