-
Notifications
You must be signed in to change notification settings - Fork 1
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
프로젝트 전체 조회 시 기술 스택 및 제목과 멤버로 검색 기능 #191
Conversation
…nto feat/#173-read-projects-with-search
📝 Jacoco Test Coverage
|
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.
어려운 기능인데.. 감사합니당!! QueryDSL 마법사..👍🏻👍🏻
@@ -111,23 +141,48 @@ private Page<ProjectListResponse> findPageByCondition(EntityPathBase<?> from, | |||
|
|||
private Long getCount(EntityPathBase<?> from, BooleanExpression condition, QProject join) { | |||
return queryFactory | |||
.select(project.count()) | |||
.select(project.countDistinct()) |
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.
count()
와 countDistinct()
차이를 알 수 있을까용??
중복 필터링같긴 한데, 혹시 중복된 프로젝트가 조회되는 경우도 있을까요?
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.
제가 검색 기능을 구현하면서, getCount()
를 잠시 사용한 적이 있는데 전체 프로젝트 개수를 반환할 때 중복되는 경우가 있기에 distinct를 추가했습니다!
// 프로젝트 ID 서브쿼리를 생성하여 스킬을 모두 포함하는 프로젝트를 찾기 | ||
JPAQuery<Long> projectHasSkillsSubQuery = queryFactory | ||
.select(projectSkill.project.id) | ||
.from(projectSkill) | ||
.join(projectSkill.skill) | ||
.where(projectSkill.skill.name.in(skillNames)) | ||
.groupBy(projectSkill.project.id) | ||
.having(projectSkill.project.id.count().eq(Expressions.constant(skillNames.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.
좋아요랑 비슷한 형식같아 보이네용!
혹시 좋아요는 좋아요 서비스에서 구현했지만, 스킬은 프로젝트 레포지토리에서 구현한 이유가 따로 있을까융?
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.
저도 ProjectSkill에 구현할까 고민했었지만, 우선 기능 개발이 중요하기에 project에 우선적으로 구현했습니다! 확실히 분리해보이는 것이 좋겠네요! 리팩토링하면서 분리하도록 하겠습니다! 좋은 의견 감사합니다 🙇
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.
검색 기능 로직 생각만해도 어려운데 메서드 분리해주시고 잘 구현해주셔서 너무 감사합니다! 멋져용!!!!ㅠㅠㅠ
src/main/java/sixgaezzang/sidepeek/common/doc/description/ProjectDescription.java
Show resolved
Hide resolved
src/main/java/sixgaezzang/sidepeek/projects/controller/ProjectController.java
Show resolved
Hide resolved
src/main/java/sixgaezzang/sidepeek/projects/dto/request/FindProjectRequest.java
Show resolved
Hide resolved
src/main/java/sixgaezzang/sidepeek/projects/repository/project/ProjectRepositoryCustomImpl.java
Outdated
Show resolved
Hide resolved
📝 Jacoco Test Coverage
|
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
🎫 관련 이슈
Resolves #107
Resolves #158
Fix #173
✅ 구현 내용
💬 코멘트
프로젝트 메인과 검색 결과 페이지에서 기술 스택 별로 검색하는 기능 구현 완료했습니다.
우선 dev에 merge 시키기 위한 목적으로 테스트 코드는 아직 작성하지 않았습니다. 테스트 코드는 천천히 작성해 보려고 합니다!