-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/필터 수정 #82
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
Refactor/필터 수정 #82
The head ref may contain hidden characters: "refactor/\uD544\uD130-\uC218\uC815"
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough복합 필터 응답에 도시별 계층인 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Controller as NoticeApi
participant Service as NoticeService
participant FilterService as ComplexFilterService
participant Repo as ComplexRepository
Note over Controller,Repo: 개별 필터 조회 흐름 (지역/비용/면적)
Client->>Controller: GET /{noticeId}/filter/districts
Controller->>Service: getDistrictFilter(noticeId)
Service->>Repo: findComplexesByNoticeId(noticeId)
Repo-->>Service: List<ComplexDocument>
Service->>FilterService: calculateDistrictFilter(List<ComplexDocument>)
FilterService->>FilterService: parseAddress / normalize / group by city / sort
FilterService-->>Service: DistrictFilter
Service-->>Controller: DistrictFilter
Controller-->>Client: ApiResponse.ok(DistrictFilter)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (2)
301-304:METRO_CITIES상수를 클래스 레벨로 추출하는 것을 권장합니다.현재
parseAddress메서드 내부에 정의된METRO_CITIES는 클래스 레벨 상수로 추출하면 재사용성과 가독성이 향상됩니다.🔎 제안된 수정
@Slf4j @Service @RequiredArgsConstructor public class ComplexFilterService { private final PinPointMongoRepository pinPointRepository; + + private static final Set<String> METRO_CITIES = Set.of( + "서울", "부산", "대구", "인천", "광주", "대전", "울산", "세종" + );그리고 메서드 내부의 정의를 제거합니다.
254-264: 스트림 그룹화 로직 개선을 권장합니다.현재
Collectors.collectingAndThen내에서toList()후 다시 스트림으로 변환하여distinct().sorted().toList()를 수행합니다.Collectors.toCollection(TreeSet::new)을 사용하면 자동으로 중복 제거와 정렬이 됩니다.🔎 제안된 수정
Map<String, List<String>> cityToDistricts = tempDistricts.stream() .collect(Collectors.groupingBy( TempDistrictInfo::city, Collectors.mapping( TempDistrictInfo::district, - Collectors.collectingAndThen( - Collectors.toList(), - list -> list.stream().distinct().sorted().toList() - ) + Collectors.collectingAndThen( + Collectors.toCollection(TreeSet::new), + ArrayList::new + ) ) ));
TreeSet은 자동으로 중복 제거 및 자연 정렬을 수행합니다.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/com/pinHouse/server/platform/housing/notice/application/dto/ComplexFilterResponse.javasrc/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.javasrc/main/java/com/pinHouse/server/platform/housing/notice/presentation/swagger/NoticeApiSpec.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (3)
src/main/java/com/pinHouse/server/platform/housing/notice/presentation/swagger/NoticeApiSpec.java (1)
62-62: LGTM!Swagger 예제 값 업데이트가 적절합니다. API 명세와 실제 데이터의 일관성을 유지하는 좋은 변경입니다.
src/main/java/com/pinHouse/server/platform/housing/notice/application/dto/ComplexFilterResponse.java (1)
30-46: LGTM!
District레코드를 통한 city별 그룹화 구조가 잘 설계되었습니다. 불변 레코드 사용과 Swagger 문서화가 적절합니다.src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (1)
246-278: 지역 필터 계산 로직이 잘 구현되었습니다.주소 파싱 → 임시 구조체 생성 → city별 그룹화 → 최종 응답 구성의 파이프라인이 명확하고, 한국 주소 체계(광역시/특별시, 도)에 대한 처리가 잘 반영되었습니다.
| private String shortenProvinceName(String province) { | ||
| if (province == null || province.isBlank()) { | ||
| return ""; | ||
| } | ||
|
|
||
| // "도" 제거 | ||
| if (province.endsWith("도")) { | ||
| String base = province.substring(0, province.length() - 1); | ||
|
|
||
| // "충청북", "충청남", "경상북", "경상남", "전라북", "전라남" → 첫글자 + 마지막글자 | ||
| if (base.startsWith("충청") || base.startsWith("경상") || base.startsWith("전라")) { | ||
| // "충청북" → "충북", "경상남" → "경남" | ||
| return base.charAt(0) + String.valueOf(base.charAt(base.length() - 1)); | ||
| } | ||
|
|
||
| // 그 외 도는 "도"만 제거 ("경기도" → "경기", "강원도" → "강원") | ||
| return base; | ||
| } | ||
|
|
||
| return province; | ||
| } |
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.
제주특별자치도 처리가 누락되었습니다.
현재 로직에서 "제주특별자치도"는 endsWith("도")를 만족하여 "제주특별자치"로 잘못 축약됩니다. "제주"로 올바르게 변환되어야 합니다.
🔎 제안된 수정
private String shortenProvinceName(String province) {
if (province == null || province.isBlank()) {
return "";
}
+ // "특별자치도" 제거 (제주)
+ if (province.endsWith("특별자치도")) {
+ return province.substring(0, province.length() - 5);
+ }
+
// "도" 제거
if (province.endsWith("도")) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| private String shortenProvinceName(String province) { | |
| if (province == null || province.isBlank()) { | |
| return ""; | |
| } | |
| // "도" 제거 | |
| if (province.endsWith("도")) { | |
| String base = province.substring(0, province.length() - 1); | |
| // "충청북", "충청남", "경상북", "경상남", "전라북", "전라남" → 첫글자 + 마지막글자 | |
| if (base.startsWith("충청") || base.startsWith("경상") || base.startsWith("전라")) { | |
| // "충청북" → "충북", "경상남" → "경남" | |
| return base.charAt(0) + String.valueOf(base.charAt(base.length() - 1)); | |
| } | |
| // 그 외 도는 "도"만 제거 ("경기도" → "경기", "강원도" → "강원") | |
| return base; | |
| } | |
| return province; | |
| } | |
| private String shortenProvinceName(String province) { | |
| if (province == null || province.isBlank()) { | |
| return ""; | |
| } | |
| // "특별자치도" 제거 (제주) | |
| if (province.endsWith("특별자치도")) { | |
| return province.substring(0, province.length() - 5); | |
| } | |
| // "도" 제거 | |
| if (province.endsWith("도")) { | |
| String base = province.substring(0, province.length() - 1); | |
| // "충청북", "충청남", "경상북", "경상남", "전라북", "전라남" → 첫글자 + 마지막글자 | |
| if (base.startsWith("충청") || base.startsWith("경상") || base.startsWith("전라")) { | |
| // "충청북" → "충북", "경상남" → "경남" | |
| return base.charAt(0) + String.valueOf(base.charAt(base.length() - 1)); | |
| } | |
| // 그 외 도는 "도"만 제거 ("경기도" → "경기", "강원도" → "강원") | |
| return base; | |
| } | |
| return province; | |
| } |
🤖 Prompt for AI Agents
In
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java
around lines 395 to 415, the shortening logic incorrectly transforms "제주특별자치도"
into "제주특별자치" — add a specific check before the generic endsWith("도") handling
to detect "제주특별자치" (or the full "제주특별자치도") and return "제주"; implement this by
trimming the trailing "도", then if the remaining base startsWith("제주특별자치")
return the fixed short form "제주", otherwise continue with the existing
special-case and default shortening logic.
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (1)
350-370: 이전 리뷰에서 지적된제주특별자치도처리 문제가 해결되지 않았습니다.현재 로직에서
"제주특별자치도"는endsWith("도")를 먼저 만족하여"제주특별자치"로 잘못 축약됩니다."제주"로 올바르게 변환되어야 합니다.🔎 제안된 수정
private String shortenProvinceName(String province) { if (province == null || province.isBlank()) { return ""; } + // "특별자치도" 제거 (제주) + if (province.endsWith("특별자치도")) { + return province.substring(0, province.length() - 5); + } + // "도" 제거 if (province.endsWith("도")) {
🧹 Nitpick comments (3)
src/main/java/com/pinHouse/server/platform/housing/notice/application/usecase/NoticeUseCase.java (1)
36-43: 주석의 명확성을 개선하세요.Line 42의 주석에서 "방타입"이라는 용어가 사용되었으나, 실제로
AreaFilter는typeCode기반의 면적 필터를 반환합니다. "방타입"은 일반적으로 방 개수(1룸, 2룸 등)를 의미하므로 오해의 소지가 있습니다.🔎 주석 개선 제안
- /// 공고의 단지 방타입 필터 정보 조회 + /// 공고의 단지 면적(타입코드) 필터 정보 조회 ComplexFilterResponse.AreaFilter getAreaFilter(String noticeId);src/main/java/com/pinHouse/server/platform/housing/notice/application/service/NoticeService.java (1)
182-225: 세 메서드의 중복 코드를 고려하세요.
getDistrictFilter,getCostFilter,getAreaFilter메서드가 동일한 패턴을 따르고 있습니다 (공고 검증 → 단지 로드 → 필터 계산). 중복을 줄이기 위해 제네릭 헬퍼 메서드로 통합하는 것을 고려할 수 있습니다.다만, 서비스 계층에서 명시적인 메서드 분리가 가독성 측면에서 선호될 수 있으므로 현재 구조도 합리적입니다.
💡 통합 리팩터링 예시
private <T> T getFilterByType( String noticeId, Function<List<ComplexDocument>, T> filterCalculator ) { // 공고 존재 확인 loadNotice(noticeId); // 단지 목록 조회 List<ComplexDocument> complexes = complexService.loadComplexes(noticeId); // 필터 계산 return filterCalculator.apply(complexes); } @Override @Transactional(readOnly = true) public ComplexFilterResponse.DistrictFilter getDistrictFilter(String noticeId) { return getFilterByType(noticeId, complexFilterService::calculateDistrictFilter); }src/main/java/com/pinHouse/server/platform/housing/notice/presentation/NoticeApi.java (1)
114-124: 주석의 명확성을 개선하세요.Line 114의 주석에서 "방타입"이라는 용어가 사용되었으나, 실제로는 면적(타입코드) 필터를 조회합니다. NoticeUseCase의 Line 42와 동일한 문제입니다.
🔎 주석 개선 제안
- /// 공고의 단지 방타입 필터 정보 조회 + /// 공고의 단지 면적(타입코드) 필터 정보 조회 @GetMapping("/{noticeId}/filter/area")
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.javasrc/main/java/com/pinHouse/server/platform/housing/notice/application/service/NoticeService.javasrc/main/java/com/pinHouse/server/platform/housing/notice/application/usecase/NoticeUseCase.javasrc/main/java/com/pinHouse/server/platform/housing/notice/presentation/NoticeApi.java
🔇 Additional comments (5)
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java (5)
186-196: LGTM!필터 응답을 구성하는 통합 메서드가 명확하고 각 필터 계산을 적절히 위임하고 있습니다.
201-233: LGTM!도시별 지역 그룹화 로직이 명확하며, 스트림을 효과적으로 사용하고 있습니다. 다만,
parseAddress메서드의 정확성에 의존하므로 해당 메서드의 철저한 테스트가 필요합니다.
316-342: LGTM!광역시 및 특별시 이름 추출 로직이 다양한 접미사를 적절히 처리하고 있습니다.
375-409: LGTM!가격 필터 계산 로직이 통계값(최소/최대/평균)과 분포를 올바르게 계산하고 있습니다.
463-476: LGTM!면적 필터 계산이 고유한 타입 코드를 정확히 수집하고 정렬하고 있습니다.
| private TempDistrictInfo parseAddress(ComplexDocument complex) { | ||
| String county = complex.getCounty(); | ||
| String city = complex.getCity(); | ||
|
|
||
| if (county == null || county.isBlank()) { | ||
| return null; | ||
| } | ||
|
|
||
| try { | ||
| PinPoint pinPoint = pinPointRepository.findById(pinPointId) | ||
| .orElse(null); | ||
| // 광역시 및 특별시 목록 | ||
| final Set<String> METRO_CITIES = Set.of( | ||
| "서울", "부산", "대구", "인천", "광주", "대전", "울산", "세종" | ||
| ); | ||
|
|
||
| if (pinPoint != null) { | ||
| return pinPoint.getLocation(); | ||
| // county를 공백으로 분리 | ||
| String[] countyParts = county.trim().split("\\s+"); | ||
|
|
||
| String finalCity; | ||
| String finalDistrict; | ||
|
|
||
| // 광역시/특별시 여부 확인 | ||
| boolean isMetroCity = false; | ||
| String metroCityName = null; | ||
|
|
||
| if (countyParts.length >= 1) { | ||
| String cityName = countyParts[0]; | ||
| // "광주광역시", "부산광역시", "서울특별시" 등에서 도시 이름 추출 | ||
| String cityBase = extractMetroCityName(cityName); | ||
| if (cityBase != null && METRO_CITIES.contains(cityBase)) { | ||
| isMetroCity = true; | ||
| metroCityName = cityBase; | ||
| } | ||
| } catch (Exception e) { | ||
| log.error("Failed to fetch PinPoint: {}", pinPointId, e); | ||
| } | ||
|
|
||
| return null; | ||
| if (isMetroCity) { | ||
| // 광역시/특별시인 경우 | ||
| finalCity = metroCityName; | ||
|
|
||
| if (countyParts.length >= 2) { | ||
| // "부산시 해운대구" 또는 "광주광역시 서구" → city: "부산", district: "해운대구" | ||
| finalDistrict = countyParts[1]; | ||
| } else { | ||
| // "대구광역시"만 있는 경우 → city: "대구", district: "대구광역시" (원본 유지) | ||
| finalDistrict = county; | ||
| } | ||
| } else { | ||
| // 일반시인 경우 | ||
| // city 필드가 광역시일 수도 있으므로 확인 | ||
| String cityBase = extractMetroCityName(city); | ||
| if (cityBase != null && METRO_CITIES.contains(cityBase)) { | ||
| // city 필드가 "대구광역시"인 경우 → city: "대구" | ||
| finalCity = cityBase; | ||
| } else { | ||
| // city 필드가 도인 경우 → "경기도" → "경기" | ||
| finalCity = shortenProvinceName(city); | ||
| } | ||
| finalDistrict = county; | ||
| } | ||
|
|
||
| return new TempDistrictInfo(finalCity, finalDistrict); | ||
| } |
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.
🧩 Analysis chain
🏁 Script executed:
# Find test files related to ComplexFilterService
fd -e java -path "*test*" | xargs rg -l "ComplexFilterService" | head -20Repository: PinHouse/PinHouse_BE
Length of output: 450
🏁 Script executed:
# Check for parseAddress method and its test cases
rg -nA 20 "void test.*[Pp]arse[Aa]ddress|@Test.*\n.*parseAddress" --type=javaRepository: PinHouse/PinHouse_BE
Length of output: 255
🏁 Script executed:
# Find the helper methods: extractMetroCityName and shortenProvinceName
rg -nA 10 "extractMetroCityName|shortenProvinceName" --type=java src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.javaRepository: PinHouse/PinHouse_BE
Length of output: 1870
🏁 Script executed:
# Look for sample address data or test data patterns
rg -nP "county|city" --type=java src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | grep -E "(county|city)\s*=" | head -30Repository: PinHouse/PinHouse_BE
Length of output: 211
🏁 Script executed:
# Check how ComplexDocument is populated and what data it receives
fd -e java -type f | xargs rg -l "ComplexDocument" | head -10Repository: PinHouse/PinHouse_BE
Length of output: 1244
🏁 Script executed:
# Search for test files more thoroughly
find . -type f -name "*Test.java" -o -name "*test*.java" 2>/dev/null | xargs rg -l "ComplexFilterService\|parseAddress" 2>/dev/nullRepository: PinHouse/PinHouse_BE
Length of output: 48
🏁 Script executed:
# Get the complete implementation of helper methods
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '309,380p'Repository: PinHouse/PinHouse_BE
Length of output: 2606
🏁 Script executed:
# Check where ComplexDocument data comes from
rg -n "setCounty|setCity|county|city" --type java src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | head -20Repository: PinHouse/PinHouse_BE
Length of output: 1296
🏁 Script executed:
# Look for test resources or sample data files
find . -type f \( -name "*.json" -o -name "*.xml" -o -name "*.properties" \) 2>/dev/null | xargs rg -l "county\|city\|광역시\|특별시" 2>/dev/null | head -10Repository: PinHouse/PinHouse_BE
Length of output: 46
🏁 Script executed:
# Check the ComplexDocument class definition to understand county/city fields
rg -A 10 "class ComplexDocument|private.*county|private.*city" --type java src/main/java/com/pinHouse/server/platform/housing/notice/domain/model/ComplexDocument.java 2>/dev/null || find . -name "ComplexDocument.java" -type f | xargs cat -n | head -80Repository: PinHouse/PinHouse_BE
Length of output: 2646
🏁 Script executed:
# Search for test cases related to parseAddress
find . -type f -name "*.java" | xargs grep -l "parseAddress" 2>/dev/nullRepository: PinHouse/PinHouse_BE
Length of output: 169
🏁 Script executed:
# Look for ComplexFilterService tests specifically
find . -type f -name "*ComplexFilterServiceTest*" -o -name "*Test.java" | xargs grep -l "parseAddress\|ComplexFilterService" 2>/dev/null | head -5Repository: PinHouse/PinHouse_BE
Length of output: 46
🏁 Script executed:
# Check how city field can be null or what values it gets
rg -B5 -A5 "getCity\(\)|getCounty\(\)" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.javaRepository: PinHouse/PinHouse_BE
Length of output: 1111
🏁 Script executed:
# Check for 제주 (Jeju) handling - special autonomous province
rg -n "제주\|세종\|특별자치" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.javaRepository: PinHouse/PinHouse_BE
Length of output: 46
🏁 Script executed:
# Look at the test directories to understand project structure
find . -type d -name "test" -o -type d -name "tests" 2>/dev/null | head -5Repository: PinHouse/PinHouse_BE
Length of output: 74
🏁 Script executed:
# Look for test files in the test directory
find ./src/test -type f -name "*.java" | xargs grep -l "ComplexFilterService\|parseAddress\|TempDistrictInfo" 2>/dev/nullRepository: PinHouse/PinHouse_BE
Length of output: 48
🏁 Script executed:
# Check the entire test directory structure
find ./src/test -type f -name "*.java" | head -20Repository: PinHouse/PinHouse_BE
Length of output: 345
🏁 Script executed:
# Look for any integration or unit tests that might test address parsing
find ./src/test -type f -name "*.java" | xargs grep -l "address\|county\|city" 2>/dev/null | head -10Repository: PinHouse/PinHouse_BE
Length of output: 46
🏁 Script executed:
# Check the full parseAddress method one more time and review the logic for edge cases
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '248,307p'Repository: PinHouse/PinHouse_BE
Length of output: 2457
🏁 Script executed:
# Check if 제주 (Jeju) is handled in the helper methods
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '316,370p'Repository: PinHouse/PinHouse_BE
Length of output: 1982
🏁 Script executed:
# Check if there's any documentation about expected city/county formats
find . -type f \( -name "README*" -o -name "*.md" \) | xargs grep -i "city\|county\|address" 2>/dev/null | head -20Repository: PinHouse/PinHouse_BE
Length of output: 98
🏁 Script executed:
# Check the Address class to understand the data structure better
find . -type f -name "Address.java" | xargs cat -n 2>/dev/null | head -50Repository: PinHouse/PinHouse_BE
Length of output: 773
🏁 Script executed:
# Verify how parseAddress is called and what happens with null return
rg -B3 -A5 "parseAddress\(" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.javaRepository: PinHouse/PinHouse_BE
Length of output: 470
🏁 Script executed:
# Check Korean administrative divisions to verify if 제주특별자치도 is handled
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '350,370p'Repository: PinHouse/PinHouse_BE
Length of output: 921
🏁 Script executed:
# Check if there are any data files or queries that show what city/county values actually look like
find . -type f \( -name "*.json" -o -name "*.yaml" -o -name "*.yml" \) | xargs grep -i "특별자치\|제주\|세종" 2>/dev/null | head -20Repository: PinHouse/PinHouse_BE
Length of output: 46
🏁 Script executed:
# Verify the exact behavior when shortenProvinceName receives "제주특별자치도"
cat > /tmp/test_jeju.java << 'EOF'
public class TestJeju {
public static void main(String[] args) {
String jeju = "제주특별자치도";
if (jeju.endsWith("도")) {
String base = jeju.substring(0, jeju.length() - 1);
System.out.println("Base after removing '도': [" + base + "]");
System.out.println("Expected: [제주]");
System.out.println("Actual result: [" + base + "]");
}
}
}
EOF
javac /tmp/test_jeju.java 2>&1 || echo "Java not available"Repository: PinHouse/PinHouse_BE
Length of output: 127
🏁 Script executed:
# Check if there's any special handling needed for Jeju in the codebase
rg -n "제주\|Jeju\|jeju" src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.javaRepository: PinHouse/PinHouse_BE
Length of output: 46
🏁 Script executed:
# Verify what happens with null city field in the parseAddress method more carefully
cat -n src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java | sed -n '292,304p'Repository: PinHouse/PinHouse_BE
Length of output: 639
shortenProvinceName 메서드에서 제주특별자치도 처리 누락
shortenProvinceName은 "도" 문자만 제거하기 때문에, city = "제주특별자치도"인 경우 "제주특별자치"를 반환하게 됩니다 (올바른 값: "제주"). extractMetroCityName에서 "특별자치시"를 처리하는 것과 유사하게, shortenProvinceName도 "특별자치도" 접미사를 처리해야 합니다.
🤖 Prompt for AI Agents
In
src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java
around lines 248 to 307, the shortenProvinceName method currently only strips a
trailing "도" so "제주특별자치도" becomes "제주특별자치" — update shortenProvinceName to
detect and strip the full "특별자치도" suffix (returning "제주") as well as existing
cases (e.g., remove "도", "도시" variants if needed), preserving behavior for other
inputs; implement the check/order so longer suffixes are removed first (e.g., if
endsWith("특별자치도") remove that, else if endsWith("도") remove that) and ensure
null/blank safety.
📌 작업한 내용
🔍 참고 사항
🖼️ 스크린샷
🔗 관련 이슈
✅ 체크리스트
Summary by CodeRabbit
새로운 기능
개선사항
✏️ Tip: You can customize this high-level summary in your review settings.