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 #41] 나의활동 API #47

Merged
merged 22 commits into from
Aug 16, 2024
Merged

[feat #41] 나의활동 API #47

merged 22 commits into from
Aug 16, 2024

Conversation

dudxo
Copy link
Collaborator

@dudxo dudxo commented Aug 15, 2024

관련 이슈

📑 작업 상세 내용

  • 작성한 질문 목록 API
    • QueryDSL을 통한 작성한 질문 목록 찾기
    • 특정 QuestionPost와 연관된 InteractionCount 레코드가 NULL 일 수 있어서 Inner Join이 아닌 Left Join 사용
  • 댓글 단 질문 목록 API
    • QueryDSL을 통한 댓글 단 질문 목록 찾기
    • 특정 QuestionPost와 연관된 InteractionCount 레코드가 NULL 일 수 있어서 Inner Join이 아닌 Left Join 사용
  • Repository 테스트 및 통합 테스트 작성

💫 작업 요약

  • 작성한 질문 목록 API
  • 댓글 단 질문 목록 API

🔍 중점적으로 리뷰 할 부분

  • 각 API 응답 DTO 내부 InteractionCount NULL 처리 로직이 괜찮은지 확인 부탁드립니다.
  • Repository와 Service 두 계층 Test가 다른게 없어보여 Repository Test 한 쪽만 진행했습니다.

@dudxo dudxo added the ✨ feat 기능 추가 label Aug 15, 2024
@dudxo dudxo requested a review from hyun2371 August 15, 2024 16:56
@dudxo dudxo self-assigned this Aug 15, 2024
@dudxo dudxo linked an issue Aug 15, 2024 that may be closed by this pull request
2 tasks
Copy link

github-actions bot commented Aug 15, 2024

Test Results

72 tests   67 ✅  7s ⏱️
18 suites   5 💤
18 files     0 ❌

Results for commit 64df7d3.

♻️ This comment has been updated with latest results.

@dudxo
Copy link
Collaborator Author

dudxo commented Aug 16, 2024

@hyun2371 비즈니스 로직 응답 부분에 문제가 있는 것 같아서 검증 및 수정 진행 후 재요청드리겠습니다!

++ CI build 오류 수정

hyun2371 and others added 4 commits August 16, 2024 16:13
* [style] : 정적 팩토리 메서드 네이밍 변경

* [style] : enum 라벨 필드명 변경

* [feat] : 게시글 상호작용 에러코드 추가

* [feat] : postInteraction mapper 추가

* [feat] : postInteraction 상태 변경 메서드 추가

* [feat] : postInteractionCount 필드 변경 메서드 추가

* [feat] : 게시글 상호작용 응답 추가

* [feat] : 게시글 상호작용, 게시글 상호작용수 repository 추가

* [feat] : 게시글 상호작용(추천, 북마크) 활성화, 비활성화 비즈니스 로직 작성

* [feat] : 게시글 상호작용(추천, 북마크) 활성화, 비활성화 API 메서드 작성

* [feat] : 상호작용 에러 코드 추가 및 네이밍 변경

* [refactor] : 질문글 비즈니스 메서드 파라미터 변경

* [feat] : 질문글 상호작용 생성 전 검증 로직 추가

* [test] : 상호작용, 상호작용 수 fixture 추가

* [fix] : 상태변경 로직 오류 수정

* [feat] : 상태변경 에러코드 수정

* [feat] : 응답 필드에 라벨로 반환

* [test] : 상호작용 활성화/비활성화 단위 테스트

* [style] : 코드 리포멧팅

* [feat] : 컨트롤러 파라미터 어노테이션 수정

* [feat] : 게시글 상호작용 생성 시 기존에 게시글 상호작용 수 엔티티 존재하는지 검증

* [test] : 게시글 상호작용 생성 시 기존에 게시글 상호작용 수 엔티티 존재하는지 로직 추가에 대한 테스트 반영

* [test] : 이메일 중복 저장 방지를 위해 memberFixture 객체 추가

* [fix] : 도메인 비즈니스 로직 오류 수정

* [test] : 게시글 상호작용 통합 테스트 작성

* [rename] : 상호작용, 상호작용 수 엔티티명 변경

* [style] : 코드 리포멧팅
* [feat] : 질문글 등록 응답 dto 생성

* [feat] : 상세 조회 응답 dto에 추천수, 북마크수 필드 추가

* [feat] : 상세 조회 DTO, 등록 DTO 분리

* [feat] : 북마크수, 추천수 구하는 비즈니스 로직 추가

* [refactor] : fixture 메서드명 수정

* [feat] : 북마크수, 추천수 구하는 비즈니스 로직 테스트

* [feat] : API별 DTO 분리 반영

* [test] : dto 응답 필드 추가 반영

* [style] : 코드 리포멧팅

* [fix] : DTO mapper 함수명 수정

* [feat] : 엔티티 필드명 수정
Copy link
Member

@hyun2371 hyun2371 left a comment

Choose a reason for hiding this comment

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

수고 많으셨습니다! 저도 queryProjection을 사용해봐야겠네요..!
응답에 totalCount만 있고 recommendCount나 bookmarkCount가 없는 것 같더라고요
그렇게 설계하신 이유도 궁금합니당

public Slice<QuestionPostsByMemberResponse> getQuestionPostsByMember(Member member, Pageable pageable) {
QQuestionPost qp = QQuestionPost.questionPost;
QInteractionCount ic = QInteractionCount.interactionCount;

Copy link
Member

Choose a reason for hiding this comment

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

개인적으로 따로 변수로 빼야하나 생각이 듭니다! 변수명를을축약하니까 한 번 더 생각을 해야 하는 것 같아요! static import를 하면 별로 길어질 것 같지 않습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

기존 가현님 코드를 참고하며 static import를 하다보니 무언가 더 이해하기 힘들다라는 생각이 들더라고요!
이 부분은 추후 더 생각해보겠습니다!

Copy link
Member

Choose a reason for hiding this comment

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

QQuestionPost가 static import 해서 questionPost로 되는거라 이해가 안된다는 말씀이 잘 와닿지 않네요,, 저는 오히려 개인적으로 약어를 변수명으로 선언한게 한 번 더 생각하도록 만든다고 느꼈습니다!

@dudxo
Copy link
Collaborator Author

dudxo commented Aug 16, 2024

@hyun2371 getAnsweredQuestionPostsByMember() 쿼리가 매우 길고 더티한데 시간이 없어 리팩토링 때 변경하겠습니다ㅜㅜ
getAnsweredQuestionPostsByMember() 쿼리 수정(+테스트)하는데 거짓말 없이 오늘 하루 다 썼네요....
최종 리뷰 부탁드립니다~

@dudxo dudxo requested a review from hyun2371 August 16, 2024 14:21
@dudxo dudxo merged commit 30a7944 into dev Aug 16, 2024
3 checks passed
@dudxo dudxo deleted the feat/#41/member-activities branch August 16, 2024 15:12
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