Skip to content
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

[feat #186] 질문글 삭제 API #187

Merged
merged 15 commits into from
Jan 12, 2025
Merged

Conversation

hyun2371
Copy link
Member

@hyun2371 hyun2371 commented Jan 5, 2025

관련 이슈

📑 작업 상세 내용

  • 질문글 삭제 API
    • 해당 질문글에 답변이 달리지 않았을 경우 삭제 가능
    • 삭제 후 질문 등록 시 걸었던 금액 반환

💫 작업 요약

  • 질문글 삭제 API 추가 및 테스트 수행

🔍 중점적으로 리뷰 할 부분

  • 환불하는 함수가 추가로 생겨, 질문 자동마감 시 환불하는 함수명을 refundClosedQuestionPosts()로 수정했습니다.
  • 질문 마감, 질문 삭제 시 creditHistory에 저장하는 로직이 똑같아서 함수로 추출했습니다.

@hyun2371 hyun2371 added the ✨ feat 기능 추가 label Jan 5, 2025
@hyun2371 hyun2371 requested a review from dudxo January 5, 2025 06:55
@hyun2371 hyun2371 self-assigned this Jan 5, 2025
@hyun2371 hyun2371 linked an issue Jan 5, 2025 that may be closed by this pull request
1 task
Copy link

github-actions bot commented Jan 5, 2025

Code Coverage

Overall Project 83.96% -0.24% 🍏
Files changed 87.13% 🍏

File Coverage
QuestionPostController.java 100% 🍏
QuestionPostService.java 84.67% -4.74% 🍏

Copy link

github-actions bot commented Jan 5, 2025

Test Results

 28 files   28 suites   14s ⏱️
142 tests 140 ✅ 2 💤 0 ❌
143 runs  141 ✅ 2 💤 0 ❌

Results for commit aac0f2c.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@dudxo dudxo left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

작성자 유효성 검증이 없어서 추가 후 승인하겠습니다!

@hyun2371 hyun2371 requested a review from dudxo January 10, 2025 06:12
Copy link
Collaborator

@dudxo dudxo 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 validateIfQuestioner(Member member, QuestionPost questionPost){
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍


@DisplayName("[질문글 작성자가 아닌 경우 질문글을 삭제할 수 없다.]")
@Test
void deleteQuestionPostFails2() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

�예외 발생 추가 케이스에 대한 테스트 코드 좋네요👍

@hyun2371
Copy link
Member Author

고생하셨습니다! 테스트 코드의 네이밍을 조금 더 신경 써도 좋을 것 같아요!

메서드명에 테스트 행위를 담으면 길어져서 오히려 가독성이 떨어진다고 생각했습니다! DisplayName으로 나타낼 수 있으니 간결하게 네이밍해도 괜찮을 것 같아요~

@hyun2371 hyun2371 merged commit d979d52 into dev Jan 12, 2025
3 checks passed
@hyun2371 hyun2371 deleted the feat/#186/delete-question-post branch January 12, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feat 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ 질문글 삭제 API
2 participants