-
Notifications
You must be signed in to change notification settings - Fork 0
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] 댓글 조회 기능 #90 #124
[Feat] 댓글 조회 기능 #90 #124
Conversation
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.
👍
@RequestParam Long postId, | ||
@RequestParam(required = false) Long cursorKey, | ||
@RequestParam(defaultValue = "10") Integer size) { |
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.
DTO로 분리해서 관리하면 편합니다
@GetMapping("/search")
public ResponseEntity<List<ContentReadListDto>> searchFortuneContent(
@ParameterObject @ModelAttribute SearchRequest searchRequest
) {
// 키워드를 포함하는 이름을 가진 컨텐츠 목록 가져오기
List<ContentReadListDto> searchResult = fortuneContentService.getSearchList(searchRequest);
return ResponseEntity
.status(HttpStatus.OK)
.body(searchResult);
}
위 코드 참고해 주세욥 😃
…into feature/comment-read/#90
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.
고생하셨습니다~
🚀 Pull Request
#️⃣ 연관된 이슈
📋 작업 내용
🔧 변경된 코드 설명
CommentRepositoryCustom
과CommentRepositoryCustomImpl
로 나누어 작성하였습니다. 그 이유는 아래와 같습니다Custom Repository의 역할
Spring Data JPA에서 기본적으로 제공되지 않는 복잡한 쿼리나 커스텀 로직을 구현하기 위해 Custom Repository를 사용합니다.
CommentRepositoryCustom (인터페이스): 사용자 정의 쿼리를 선언하기 위한 계약 역할을 합니다.
실제 구현 내용은 포함하지 않고, 필요한 메서드의 시그니처만 정의합니다.
CommentRepositoryCustomImpl (구현체): CommentRepositoryCustom 인터페이스를 구현하여 실제 QueryDSL 기반의 복잡한 쿼리 로직을 작성합니다.
구조 요약
CommentRepository
├── JpaRepository<Comment, Long>
├── CommentRepositoryCustom
└── CommentRepositoryCustomImpl (QueryDSL 구현체)
✅ 테스트 여부
👽 비고
FortuneContentReadRepositoryTest
에서 테스트 실패합니다.Expected :2, Actual :0
여서 값 확인 해보셔야 할 것 같아요