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/#22] 여행지 검색 api #62

Merged
merged 6 commits into from
Jun 10, 2024
Merged

[Feat/#22] 여행지 검색 api #62

merged 6 commits into from
Jun 10, 2024

Conversation

mmihye
Copy link
Member

@mmihye mmihye commented Jun 10, 2024

🚩 관련 이슈

📋 구현 기능 명세

  • 여행지 검색 api

📌 PR Point

  • 어떤 부분에 리뷰어가 집중해야 하는지
    쿼리 조건 빼먹는게 있는지....

  • 개발하면서 어떤 점이 궁금했는지
    장애유형이랑 장애세부유형을 필터링하는쿼리를 하나씩 있는것들을 필터링하는걸로 작성했는데 더 좋은 방법이 있을지....

private BooleanExpression disabilityTypeHas(List<Long> disabilityType) {
        if(disabilityType == null || disabilityType.isEmpty())
            return null;

        return checkDisabilityTypes(disabilityType, 0);
    }


    private BooleanExpression checkDisabilityTypes(List<Long> disabilityType, int index) {
        if (index == disabilityType.size() - 1) {
            return disabilityPlaceCategory.place.in(
                    JPAExpressions.select(disabilityPlaceCategory.place)
                            .from(disabilityPlaceCategory)
                            .innerJoin(disabilityPlaceCategory.subCategory, disabilitySubCategory)
                            .join(disabilitySubCategory.category, disabilityCategory)
                            .groupBy(disabilityPlaceCategory.place)
                            .where(disabilityPlaceCategory.subCategory.category.id.in(disabilityType.get(index)))
            );
        } else {
            return disabilityPlaceCategory.place.in(
                    JPAExpressions.select(disabilityPlaceCategory.place)
                            .from(disabilityPlaceCategory)
                            .innerJoin(disabilityPlaceCategory.subCategory, disabilitySubCategory)
                            .join(disabilitySubCategory.category, disabilityCategory)
                            .groupBy(disabilityPlaceCategory.place)
                            .where(disabilityPlaceCategory.subCategory.category.id.in(disabilityType.get(index)))
            ).and(checkDisabilityTypes(disabilityType, index + 1));
        }
    }

📸 결과물 스크린샷

스크린샷 2024-06-11 오전 12 35 37

🛠️ 테스트

  • 테스트

🚀 API Endpoint

  • ~/v1/place/search

mmihye added 6 commits June 3, 2024 15:58
# Conflicts:
#	src/main/java/Journey/Together/domain/place/controller/PlaceController.java
#	src/main/java/Journey/Together/domain/place/service/PlaceService.java
#	src/main/java/Journey/Together/global/exception/ErrorCode.java
@mmihye mmihye self-assigned this Jun 10, 2024
@mmihye mmihye added the ⚒️ Feature 기능 개발 label Jun 10, 2024
@mmihye mmihye merged commit bfce29f into main Jun 10, 2024
1 check passed
@mmihye mmihye deleted the feat/#22 branch June 10, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚒️ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 관광정보 리스트 검색
1 participant