Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
import com.zipte.platform.core.response.pageable.PageResponse;
import com.zipte.platform.server.adapter.in.web.dto.response.EstateDetailResponse;
import com.zipte.platform.server.adapter.in.web.dto.response.EstateListResponse;
import com.zipte.platform.server.adapter.in.web.dto.response.EstatePriceListResponse;
import com.zipte.platform.server.adapter.in.web.swagger.EstateApiSpec;
import com.zipte.platform.server.application.in.estate.EstatePriceUseCase;
import com.zipte.platform.server.application.in.estate.GetEstateUseCase;
import com.zipte.platform.server.application.in.external.OpenAiUseCase;
import com.zipte.platform.server.domain.estate.Estate;
import com.zipte.platform.server.domain.estate.EstatePrice;
import jakarta.persistence.EntityNotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
Expand All @@ -25,6 +28,9 @@ public class EstateApi implements EstateApiSpec {

private final GetEstateUseCase getService;

/// 가격 의존성
private final EstatePriceUseCase priceService;

/// AI 의존성
private final OpenAiUseCase openAiService;

Expand Down Expand Up @@ -74,9 +80,8 @@ public ApiResponse<List<EstateListResponse>> getEstateByLocation(
@RequestParam(value = "longitude") double longitude,
@RequestParam(value = "latitude") double latitude,
@RequestParam(value = "radius") double radius) {
List<Estate> list = getService.loadEstatesNearBy(longitude, latitude, radius);

return ApiResponse.ok(EstateListResponse.from(list));
return ApiResponse.ok(getService.loadEstatesNearBy(longitude, latitude, radius));

}

Expand All @@ -101,4 +106,25 @@ public ApiResponse<String> getEstateDetail(@PathVariable String kaptCode) {

return ApiResponse.ok(result);
}


/// 가격 조회
@GetMapping("/price")
public ApiResponse<List<EstatePriceListResponse>> getPriceByCodeAndArea(
@RequestParam String kaptCode,
@RequestParam double area) {

List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode, area);

return ApiResponse.ok(EstatePriceListResponse.from(list));
}
Comment on lines +119 to +127
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

파라미터 검증 로직을 추가하는 것을 고려하세요.

새로운 가격 조회 엔드포인트가 추가되었습니다. 그러나 입력 파라미터에 대한 검증이 부족합니다.

다음과 같은 개선사항을 적용하는 것을 권장합니다:

@GetMapping("/price")
public ApiResponse<List<EstatePriceListResponse>> getPriceByCodeAndArea(
        @RequestParam String kaptCode,
        @RequestParam double area) {

+    if (kaptCode == null || kaptCode.trim().isEmpty()) {
+        throw new IllegalArgumentException("kaptCode는 필수 파라미터입니다.");
+    }
+    if (area <= 0) {
+        throw new IllegalArgumentException("area는 0보다 큰 값이어야 합니다.");
+    }

    List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode, area);

    return ApiResponse.ok(EstatePriceListResponse.from(list));
}
📝 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.

Suggested change
@GetMapping("/price")
public ApiResponse<List<EstatePriceListResponse>> getPriceByCodeAndArea(
@RequestParam String kaptCode,
@RequestParam double area) {
List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode, area);
return ApiResponse.ok(EstatePriceListResponse.from(list));
}
@GetMapping("/price")
public ApiResponse<List<EstatePriceListResponse>> getPriceByCodeAndArea(
@RequestParam String kaptCode,
@RequestParam double area) {
if (kaptCode == null || kaptCode.trim().isEmpty()) {
throw new IllegalArgumentException("kaptCode는 필수 파라미터입니다.");
}
if (area <= 0) {
throw new IllegalArgumentException("area는 0보다 큰 값이어야 합니다.");
}
List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode, area);
return ApiResponse.ok(EstatePriceListResponse.from(list));
}
🤖 Prompt for AI Agents
In src/main/java/com/zipte/platform/server/adapter/in/web/EstateApi.java around
lines 112 to 120, the getPriceByCodeAndArea method lacks validation for its
input parameters kaptCode and area. Add validation logic to check that kaptCode
is not null or empty and that area is a positive number. If validation fails,
return an appropriate error response or throw a validation exception to prevent
processing invalid inputs.



@GetMapping("/price/{kaptCode}")
public ApiResponse<List<EstatePriceListResponse>> getPrice(@PathVariable String kaptCode) {

List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode);

return ApiResponse.ok(EstatePriceListResponse.from(list));
}
Comment on lines +130 to +136
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

코드 중복을 제거하고 예외 처리를 개선하세요.

두 번째 가격 조회 엔드포인트에서도 파라미터 검증과 예외 처리가 필요합니다. 또한 두 메서드 간에 유사한 로직이 반복됩니다.

다음과 같이 개선할 수 있습니다:

@GetMapping("/price/{kaptCode}")
public ApiResponse<List<EstatePriceListResponse>> getPrice(@PathVariable String kaptCode) {

+    if (kaptCode == null || kaptCode.trim().isEmpty()) {
+        throw new IllegalArgumentException("kaptCode는 필수 파라미터입니다.");
+    }

-    List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode);
-
-    return ApiResponse.ok(EstatePriceListResponse.from(list));
+    try {
+        List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode);
+        return ApiResponse.ok(EstatePriceListResponse.from(list));
+    } catch (Exception e) {
+        throw new EntityNotFoundException("해당 아파트의 가격 정보를 찾을 수 없습니다.");
+    }
}

또한 두 메서드를 하나로 통합하여 코드 중복을 줄일 수 있습니다:

@GetMapping("/price")
public ApiResponse<List<EstatePriceListResponse>> getPriceByCodeAndArea(
        @RequestParam String kaptCode,
        @RequestParam(required = false) Double area) {
    
    if (kaptCode == null || kaptCode.trim().isEmpty()) {
        throw new IllegalArgumentException("kaptCode는 필수 파라미터입니다.");
    }
    
    List<EstatePrice> list;
    if (area != null) {
        if (area <= 0) {
            throw new IllegalArgumentException("area는 0보다 큰 값이어야 합니다.");
        }
        list = priceService.getEstatePriceByCode(kaptCode, area);
    } else {
        list = priceService.getEstatePriceByCode(kaptCode);
    }
    
    return ApiResponse.ok(EstatePriceListResponse.from(list));
}
📝 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.

Suggested change
@GetMapping("/price/{kaptCode}")
public ApiResponse<List<EstatePriceListResponse>> getPrice(@PathVariable String kaptCode) {
List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode);
return ApiResponse.ok(EstatePriceListResponse.from(list));
}
@GetMapping("/price/{kaptCode}")
public ApiResponse<List<EstatePriceListResponse>> getPrice(@PathVariable String kaptCode) {
if (kaptCode == null || kaptCode.trim().isEmpty()) {
throw new IllegalArgumentException("kaptCode는 필수 파라미터입니다.");
}
try {
List<EstatePrice> list = priceService.getEstatePriceByCode(kaptCode);
return ApiResponse.ok(EstatePriceListResponse.from(list));
} catch (Exception e) {
throw new EntityNotFoundException("해당 아파트의 가격 정보를 찾을 수 없습니다.");
}
}
🤖 Prompt for AI Agents
In src/main/java/com/zipte/platform/server/adapter/in/web/EstateApi.java around
lines 123 to 129, the getPrice method lacks parameter validation and exception
handling, and duplicates logic present in another price retrieval method.
Refactor by adding validation for kaptCode and proper exception handling to
manage invalid inputs or service errors. Then, consolidate this method with the
other similar price retrieval method into a single unified method to eliminate
code duplication and centralize the logic.

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zipte.platform.server.domain.estate.Estate;
import com.zipte.platform.server.domain.estate.EstatePrice;
import lombok.Builder;
import lombok.Data;

import java.util.List;
import java.util.Optional;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL) // NULL 값인 필드는 JSON 응답에서
@JsonInclude(JsonInclude.Include.NON_NULL) // NULL 값인 필드는 JSON 응답에서 제외
public class EstateListResponse {

// 아파트 기본 정보
Expand All @@ -20,6 +22,9 @@ public class EstateListResponse {
// 매물 개수
private Integer propertyCount;

// 최근 거래 조회
private EstatePriceDetailResponse price;

// 좌표
private EstateLocationResponse location;

Expand All @@ -43,8 +48,21 @@ public static EstateListResponse from(Estate estate, int count) {
.build();
}

/// 아파트 정보와 가격을 동시에 보여주는 로직
public static EstateListResponse from(Estate estate, Optional<EstatePrice> price) {
return EstateListResponse.builder()
.complexCode(estate.getKaptCode())
.complexName(estate.getKaptName())
.address(estate.getKaptAddr())
.price(EstatePriceDetailResponse.from(price))
.location(EstateLocationResponse.from(estate))
.build();
}

public static List<EstateListResponse> from(List<Estate> estates) {
return estates.stream().map(EstateListResponse::from).toList();
return estates.stream()
.map(EstateListResponse::from)
.toList();
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.zipte.platform.server.adapter.in.web.dto.response;

import com.zipte.platform.server.domain.estate.EstatePrice;
import lombok.Builder;

import java.util.Optional;

@Builder
public record EstatePriceDetailResponse(
double exclusiveArea, String price, String transactionDate) {

public static EstatePriceDetailResponse from(Optional<EstatePrice> estatePrice) {
if (estatePrice.isEmpty()) {
return EstatePriceDetailResponse.builder()
.exclusiveArea(0.0)
.price("없음")
.transactionDate("없음")
.build();
}

EstatePrice price = estatePrice.get();
return EstatePriceDetailResponse.builder()
.exclusiveArea(price.getExclusiveArea() != 0.0 ? price.getExclusiveArea() : 0.0)
.price(price.getPrice() != null ? price.getPrice() : "없음")
.transactionDate(price.getTransactionDate() != null ? price.getTransactionDate() : "없음")
.build();
}
Comment on lines +21 to +27
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

중복된 null 체크 로직

line 23-25에서 각 필드마다 null 체크를 하고 있는데, 이미 Optional이 존재하는지 확인했으므로 일부 중복된 체크가 있을 수 있습니다. 또한 price.getExclusiveArea() != 0.0 ? price.getExclusiveArea() : 0.0 로직은 불필요합니다.

다음과 같이 간소화할 수 있습니다:

        EstatePrice price = estatePrice.get();
        return EstatePriceDetailResponse.builder()
-                .exclusiveArea(price.getExclusiveArea() != 0.0 ? price.getExclusiveArea() : 0.0)
+                .exclusiveArea(price.getExclusiveArea())
                .price(price.getPrice() != null ? price.getPrice() : "없음")
                .transactionDate(price.getTransactionDate() != null ? price.getTransactionDate() : "없음")
                .build();
🤖 Prompt for AI Agents
In
src/main/java/com/zipte/platform/server/adapter/in/web/dto/response/EstatePriceDetailResponse.java
lines 21 to 27, the code redundantly checks for null values on fields of the
EstatePrice object even though the Optional presence has already been confirmed.
Also, the check for exclusiveArea being not equal to 0.0 is unnecessary since it
returns the same value either way. Simplify the code by removing these redundant
null checks and directly returning the field values or default values where
appropriate without extra conditional checks.


}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.zipte.platform.core.response.pageable.PageResponse;
import com.zipte.platform.server.adapter.in.web.dto.response.EstateDetailResponse;
import com.zipte.platform.server.adapter.in.web.dto.response.EstateListResponse;
import com.zipte.platform.server.adapter.in.web.dto.response.EstatePriceListResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand Down Expand Up @@ -45,10 +46,10 @@ ApiResponse<PageResponse<EstateListResponse>> getEstateByRegion(
description = "지정한 경도, 위도, 반경 값으로부터 근처에 위치한 아파트 목록을 반환합니다."
)
ApiResponse<List<EstateListResponse>> getEstateByLocation(
@Parameter(description = "경도", required = true, example = "127.029704677041")
@Parameter(description = "경도", required = true, example = "127.118904")
@RequestParam(value = "longitude") double longitude,

@Parameter(description = "위도", required = true, example = "37.498266842599")
@Parameter(description = "위도", required = true, example = "37.382698")
@RequestParam(value = "latitude") double latitude,

@Parameter(description = "반경 (km 단위)", required = true, example = "1")
Expand All @@ -60,10 +61,10 @@ ApiResponse<List<EstateListResponse>> getEstateByLocation(
description = "지정한 좌표와 반경을 기준으로 근처의 아파트 및 해당 아파트에 등록된 매물 정보를 함께 조회합니다."
)
ApiResponse<List<EstateListResponse>> getEstateByLocationByKaptCode(
@Parameter(description = "경도", required = true, example = "127.029704677041")
@Parameter(description = "경도", required = true, example = "127.118904")
@RequestParam(value = "longitude") double longitude,

@Parameter(description = "위도", required = true, example = "37.498266842599")
@Parameter(description = "위도", required = true, example = "37.382698")
@RequestParam(value = "latitude") double latitude,

@Parameter(description = "반경 (km 단위)", required = true, example = "1.0")
Expand All @@ -77,4 +78,27 @@ ApiResponse<List<EstateListResponse>> getEstateByLocationByKaptCode(
ApiResponse<String> getEstateDetail(
@Parameter(description = "아파트 코드", required = true, example = "A46378823")
@PathVariable String kaptCode);



@Operation(
summary = "아파트 가격 정보 조회",
description = "아파트 코드를 통해 가격 정보를 조회합니다."
)
ApiResponse<List<EstatePriceListResponse>> getPrice(
@Parameter(description = "아파트 코드", required = true, example = "A46392821")
@PathVariable String kaptCode);



@Operation(
summary = "아파트 가격 정보 조회",
description = "아파트 코드와 평수를 통해 가격 정보를 조회합니다."
)
ApiResponse<List<EstatePriceListResponse>> getPriceByCodeAndArea(
@Parameter(description = "아파트 코드", required = true, example = "A46392821")
@RequestParam String kaptCode,

@Parameter(description = "면적", required = true, example = "83.73")
@RequestParam double area);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Optional;

@Component
@RequiredArgsConstructor
public class EstatePricePersistenceAdapter implements EstatePricePort {

private final EstatePriceMongoRepository repository;

@Override
public Optional<EstatePrice> loadRecentPriceByKaptCode(String kaptCode) {
return repository.findFirstByKaptCodeOrderByTransactionDateDesc(kaptCode)
.map(EstatePriceDocument::toDomain);
}

@Override
public List<EstatePrice> loadAllEstatePrices(String kaptCode) {
return repository.findAllByKaptCode(kaptCode).stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;
import java.util.Optional;

public interface EstatePriceMongoRepository extends MongoRepository<EstatePriceDocument, String> {

List<EstatePriceDocument> findAllByKaptCode(String kaptCode);

List<EstatePriceDocument> findALlByKaptCodeAndExclusiveArea(String kaptCode, double exclusiveArea);
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

기존 메서드명 오타 수정 필요

기존 메서드명에 오타가 있습니다: findALlByKaptCodeAndExclusiveAreafindAllByKaptCodeAndExclusiveArea가 되어야 합니다.

다음과 같이 수정하세요:

-    List<EstatePriceDocument> findALlByKaptCodeAndExclusiveArea(String kaptCode, double exclusiveArea);
+    List<EstatePriceDocument> findAllByKaptCodeAndExclusiveArea(String kaptCode, double exclusiveArea);

이 변경사항은 해당 메서드를 사용하는 다른 코드에도 영향을 줄 수 있으므로 전체 코드베이스에서 확인이 필요합니다.

다음 스크립트로 영향받는 코드를 확인하세요:


🏁 Script executed:

#!/bin/bash
# 오타가 있는 메서드 사용 위치 찾기
rg -A 3 "findALlByKaptCodeAndExclusiveArea"

Length of output: 1165


메서드명 오타 수정 및 참조 변경 필요

findALlByKaptCodeAndExclusiveArea 오타로 인해 Spring Data 쿼리 메소드가 제대로 파싱되지 않을 수 있습니다. 선언부와 사용부를 모두 아래와 같이 수정하세요.

• src/main/java/com/zipte/platform/server/adapter/out/mongo/estate/EstatePriceMongoRepository.java
• src/main/java/com/zipte/platform/server/adapter/out/EstatePricePersistenceAdapter.java

--- src/main/java/com/zipte/platform/server/adapter/out/mongo/estate/EstatePriceMongoRepository.java
-    List<EstatePriceDocument> findALlByKaptCodeAndExclusiveArea(String kaptCode, double exclusiveArea);
+    List<EstatePriceDocument> findAllByKaptCodeAndExclusiveArea(String kaptCode, double exclusiveArea);

--- src/main/java/com/zipte/platform/server/adapter/out/EstatePricePersistenceAdapter.java
-        return repository.findALlByKaptCodeAndExclusiveArea(kaptCode, exclusiveArea).stream()
+        return repository.findAllByKaptCodeAndExclusiveArea(kaptCode, exclusiveArea).stream()

이후 전체 코드베이스에서 동일 오타가 남아있는지 재확인해주세요.

📝 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.

Suggested change
List<EstatePriceDocument> findALlByKaptCodeAndExclusiveArea(String kaptCode, double exclusiveArea);
List<EstatePriceDocument> findAllByKaptCodeAndExclusiveArea(String kaptCode, double exclusiveArea);
🤖 Prompt for AI Agents
In
src/main/java/com/zipte/platform/server/adapter/out/mongo/estate/EstatePriceMongoRepository.java
at line 12, correct the method name from findALlByKaptCodeAndExclusiveArea to
findAllByKaptCodeAndExclusiveArea to fix the typo. Also, update all references
to this method, including in
src/main/java/com/zipte/platform/server/adapter/out/EstatePricePersistenceAdapter.java
and any other usage across the codebase. After renaming, verify no remaining
occurrences of the typo exist by searching the entire project.


Optional<EstatePriceDocument> findFirstByKaptCodeOrderByTransactionDateDesc(String kaptCode);

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface GetEstateUseCase {
*/

// 특정 좌표 주변의 아파트 가져오기
List<Estate> loadEstatesNearBy(double latitude, double longitude, double radiusInKm);
List<EstateListResponse> loadEstatesNearBy(double latitude, double longitude, double radiusInKm);

// 특정 좌표 근처에서의 매물이 있는 아파트만 뜨도록
List<EstateListResponse> loadEstatesNearByProperty(double latitude, double longitude, double radiusInKm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
import com.zipte.platform.server.domain.estate.EstatePrice;

import java.util.List;
import java.util.Optional;

public interface EstatePricePort {

/// 가장 최근의 거래 조회하기
Optional<EstatePrice> loadRecentPriceByKaptCode(String kaptCode);

/// 목록 조회하기
List<EstatePrice> loadAllEstatePrices(String kaptCode);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import com.zipte.platform.server.adapter.in.web.dto.response.EstateListResponse;
import com.zipte.platform.server.application.in.estate.GetEstateUseCase;
import com.zipte.platform.server.application.out.estate.EstatePricePort;
import com.zipte.platform.server.application.out.estate.LoadEstatePort;
import com.zipte.platform.server.application.out.property.LoadPropertyPort;
import com.zipte.platform.server.domain.estate.Estate;
import com.zipte.platform.server.domain.estate.EstatePrice;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
Expand All @@ -14,6 +17,7 @@
import java.util.List;
import java.util.Optional;

@Slf4j
@Service
@RequiredArgsConstructor
public class EstateService implements GetEstateUseCase {
Expand All @@ -22,10 +26,28 @@ public class EstateService implements GetEstateUseCase {

private final LoadPropertyPort loadPropertyPort;

/// 아파트 가격 조회
private final EstatePricePort pricePort;


@Override
public List<Estate> loadEstatesNearBy(double latitude, double longitude, double radiusInKm) {
public List<EstateListResponse> loadEstatesNearBy(double latitude, double longitude, double radiusInKm) {
double radiusInRadians = radiusInKm / 6378.1; // 반경 km -> radians 변환
return loadPort.loadEstatesNearBy(latitude, longitude, radiusInRadians);

/// 좌표 근처의 아파트 가져오기
List<Estate> estates = loadPort.loadEstatesNearBy(latitude, longitude, radiusInRadians);

List<EstateListResponse> responses = new ArrayList<>();

/// 최신의 거래 목록 가져오기
estates.forEach(estate -> {
Optional<EstatePrice> price = pricePort.loadRecentPriceByKaptCode(estate.getKaptCode());
EstateListResponse response = EstateListResponse.from(estate, price);
responses.add(response);
});

return responses;

Comment on lines +36 to +52
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

메서드 시그니처 변경 및 로직 통합

메서드 반환 타입이 List<Estate>에서 List<EstateListResponse>로 변경되어 가격 정보가 통합되었습니다. 다음 사항들을 확인해주세요:

  1. 이 시그니처 변경이 다른 컨트롤러나 서비스에 영향을 미치지 않는지 확인
  2. pricePort.loadRecentPriceByKaptCode() 호출이 실패할 경우의 예외 처리 고려

다음 스크립트를 실행하여 메서드 사용처를 확인해주세요:


🏁 Script executed:

#!/bin/bash
# 설명: loadEstatesNearBy 메서드의 사용처를 찾아 시그니처 변경 영향도 확인

# 메서드 호출처 검색
rg -A 3 -B 3 "loadEstatesNearBy"

# GetEstateUseCase 인터페이스 구현체들 확인  
ast-grep --pattern 'class $_ implements GetEstateUseCase'

Length of output: 8809


시그니처 변경 영향도 확인 완료 및 예외 처리 권고

  • GetEstateUseCase.loadEstatesNearBy 호출부는
    • 컨트롤러: EstateApi.getService.loadEstatesNearBy(...)
    • 서비스 구현: EstateService.loadEstatesNearBy
    • loadEstatesNearByProperty
      위 3곳에만 존재하며, 모두 반환 타입 변경에 맞춰 업데이트되어 있어 추가 수정은 필요치 않습니다.

가격 정보 조회 예외 처리 검토

  • EstateServicepricePort.loadRecentPriceByKaptCode() 호출 시
    • Optional.empty() 반환을 EstateListResponse.from()에서 안전하게 처리하는지 확인
    • DB 연결 실패 등 런타임 예외 발생 시 전체 응답이 중단되지 않도록 try-catch 또는 기본값(fallback) 로직 도입 검토

점검 위치:

  • src/main/java/com/zipte/platform/server/application/service/EstateService.java
  • src/main/java/com/zipte/platform/server/application/in/estate/EstateListResponse.java
🤖 Prompt for AI Agents
In
src/main/java/com/zipte/platform/server/application/service/EstateService.java
around lines 34 to 50, the method loadEstatesNearBy now returns
List<EstateListResponse> including price info, but the call to
pricePort.loadRecentPriceByKaptCode() may throw runtime exceptions that could
disrupt the entire response. To fix this, wrap the
pricePort.loadRecentPriceByKaptCode() call inside a try-catch block to handle
exceptions gracefully, returning Optional.empty() or a default value on failure,
ensuring the method continues processing all estates without interruption.

}

@Override
Expand Down
Loading