Skip to content

Conversation

@ayoung-dev
Copy link
Collaborator

resolved :

📌 과제 설명

커뮤니티 게시글 삭제 기능

👩‍💻 요구 사항과 구현 내용

  • 커뮤니티 게시글 삭제 기능
  • 이미 삭제된 게시글 삭제 시 exception 메시지

✅ PR 포인트 & 궁금한 점

@ayoung-dev ayoung-dev self-assigned this Nov 26, 2024
@ayoung-dev ayoung-dev linked an issue Nov 26, 2024 that may be closed by this pull request
2 tasks

@Override
public void deleteCommunityBoard(UUID writerId, Long id) {
CommunityBoard communityBoard = communityBoardRepository.findById(id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

아래에 valiadteWriter처럼 메서드로 빼서 추상화 레벨 맞춰주는것도 좋아보여요!

Copy link
Collaborator Author

@ayoung-dev ayoung-dev Nov 26, 2024

Choose a reason for hiding this comment

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

넵! 수정하겠습니다

Copy link
Collaborator

@m-a-king m-a-king left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

Comment on lines 40 to 44
CommunityBoardCreateRequestDto dto = CommunityBoardCreateRequestDto.builder()
.title("커뮤니티 테스트 제목")
.content("커뮤니티 테스트 내용")
.build();

Copy link
Collaborator

@m-a-king m-a-king Nov 26, 2024

Choose a reason for hiding this comment

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

중복되는 부분이 눈에 띄는데 @BeforeEach를 사용해보는 것은 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

수정하겠습니다!

Copy link
Collaborator

@leebs0521 leebs0521 left a comment

Choose a reason for hiding this comment

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

고생하셨습니당~

private void validateWriter(CommunityBoard communityBoard, UUID writerId) {
if (communityBoard.getWriterId().equals(writerId)) {
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

communityBoard.getWriterId().equals(writerId)

이 부분은 CommunityBoard 메서드 호출해서 하는거 어떻게 생각하세요??
communityBoard.isWriter(writerId); 이런식으로요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TDA 감사합니다
수정하겠습니다!

- findById 메서드로 추출(추상화 레벨 일관성)
- ServiceTest 중복되는 부분 @beforeeach로 추출
- CommunityBoard 메서드에 isWriter 추가
@sonarqubecloud
Copy link

@ayoung-dev ayoung-dev merged commit c3f6a22 into main Nov 27, 2024
2 checks passed
@ayoung-dev ayoung-dev deleted the feature/47-add-community-board-delete branch November 27, 2024 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 커뮤니티 게시글 삭제 기능

5 participants