You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
VIPS/src/main/java/go/kr/project/api/service/VehicleInfoService.java

99 lines
3.5 KiB
Java

package go.kr.project.api.service;
feat: VMIS 통합 모드 전환 기능 구현 (Strategy Pattern) 내부/외부 API 호출을 YAML 설정으로 전환할 수 있는 Strategy Pattern 구현 ## 주요 변경사항 ### 1. Strategy Pattern 구현 - VehicleInfoService 인터페이스 생성 (공통 추상화) - InternalVehicleInfoServiceImpl: 내부 VMIS 모듈 직접 호출 - ExternalVehicleInfoServiceImpl: 외부 REST API 호출 - @ConditionalOnProperty로 mode에 따라 Bean 자동 선택 ### 2. Bean 충돌 해결 - HttpClientConfig의 restTemplate → vmisRestTemplate으로 변경 - GovernmentApiClient에 @Qualifier("vmisRestTemplate") 추가 - 기존 RestTemplateConfig와 충돌 방지 ### 3. 설정 확장 - VmisProperties에 integration, external 속성 추가 - vmis.integration.mode: internal/external 설정 지원 - vmis.external.api.url: 외부 API 서버 URL 설정 ### 4. 모델 변환 유틸리티 - VehicleResponseMapper 생성 - 내부 모델(BasicResponse, LedgerResponse) → 외부 VO 변환 ### 5. 모니터링 및 로깅 - VmisIntegrationConfig: 시작 시 활성 모드 출력 - 각 구현체에 [Internal Mode]/[External Mode] 로그 추가 ## 사용 방법 ### Internal Mode (내부 모듈 직접 호출) ```yaml vmis: integration: mode: internal ``` ### External Mode (외부 REST API 호출) ```yaml vmis: integration: mode: external external: api: url: http://localhost:8081/api/v1/vehicles ``` ## 빌드 성공 확인 ✅ - Bean 충돌 해결 완료 - 전체 컴파일 성공 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
import go.kr.project.api.model.VehicleApiResponseVO;
import go.kr.project.api.model.request.BasicRequest;
import go.kr.project.api.model.request.LedgerRequest;
import go.kr.project.api.model.response.BasicResponse;
import go.kr.project.api.model.response.LedgerResponse;
feat: VMIS 통합 모드 전환 기능 구현 (Strategy Pattern) 내부/외부 API 호출을 YAML 설정으로 전환할 수 있는 Strategy Pattern 구현 ## 주요 변경사항 ### 1. Strategy Pattern 구현 - VehicleInfoService 인터페이스 생성 (공통 추상화) - InternalVehicleInfoServiceImpl: 내부 VMIS 모듈 직접 호출 - ExternalVehicleInfoServiceImpl: 외부 REST API 호출 - @ConditionalOnProperty로 mode에 따라 Bean 자동 선택 ### 2. Bean 충돌 해결 - HttpClientConfig의 restTemplate → vmisRestTemplate으로 변경 - GovernmentApiClient에 @Qualifier("vmisRestTemplate") 추가 - 기존 RestTemplateConfig와 충돌 방지 ### 3. 설정 확장 - VmisProperties에 integration, external 속성 추가 - vmis.integration.mode: internal/external 설정 지원 - vmis.external.api.url: 외부 API 서버 URL 설정 ### 4. 모델 변환 유틸리티 - VehicleResponseMapper 생성 - 내부 모델(BasicResponse, LedgerResponse) → 외부 VO 변환 ### 5. 모니터링 및 로깅 - VmisIntegrationConfig: 시작 시 활성 모드 출력 - 각 구현체에 [Internal Mode]/[External Mode] 로그 추가 ## 사용 방법 ### Internal Mode (내부 모듈 직접 호출) ```yaml vmis: integration: mode: internal ``` ### External Mode (외부 REST API 호출) ```yaml vmis: integration: mode: external external: api: url: http://localhost:8081/api/v1/vehicles ``` ## 빌드 성공 확인 ✅ - Bean 충돌 해결 완료 - 전체 컴파일 성공 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
import java.util.List;
/**
*
*
* <p> :</p>
* <ul>
* <li>InternalVehicleInfoServiceImpl: VMIS (vmis.integration.mode=internal)</li>
* <li>ExternalVehicleInfoServiceImpl: REST API (vmis.integration.mode=external)</li>
* </ul>
*
* <h3> :</h3>
* <pre>
* # application.yml
* vmis:
* integration:
* mode: internal # external
* </pre>
*
* <h3> :</h3>
* <pre>
* {@code
* @Autowired
* private VehicleInfoService vehicleInfoService;
*
* // 단일 차량 조회
* VehicleApiResponseVO response = vehicleInfoService.getVehicleInfo("12가3456");
*
* // 여러 차량 일괄 조회
* List<VehicleApiResponseVO> responses = vehicleInfoService.getVehiclesInfo(
* Arrays.asList("12가3456", "34나5678")
* );
*
* // 단독 조회 (기본/등록원부)
* BasicResponse basic = vehicleInfoService.getBasicInfo("12가3456");
* LedgerResponse ledger = vehicleInfoService.getLedgerInfo("12가3456");
feat: VMIS 통합 모드 전환 기능 구현 (Strategy Pattern) 내부/외부 API 호출을 YAML 설정으로 전환할 수 있는 Strategy Pattern 구현 ## 주요 변경사항 ### 1. Strategy Pattern 구현 - VehicleInfoService 인터페이스 생성 (공통 추상화) - InternalVehicleInfoServiceImpl: 내부 VMIS 모듈 직접 호출 - ExternalVehicleInfoServiceImpl: 외부 REST API 호출 - @ConditionalOnProperty로 mode에 따라 Bean 자동 선택 ### 2. Bean 충돌 해결 - HttpClientConfig의 restTemplate → vmisRestTemplate으로 변경 - GovernmentApiClient에 @Qualifier("vmisRestTemplate") 추가 - 기존 RestTemplateConfig와 충돌 방지 ### 3. 설정 확장 - VmisProperties에 integration, external 속성 추가 - vmis.integration.mode: internal/external 설정 지원 - vmis.external.api.url: 외부 API 서버 URL 설정 ### 4. 모델 변환 유틸리티 - VehicleResponseMapper 생성 - 내부 모델(BasicResponse, LedgerResponse) → 외부 VO 변환 ### 5. 모니터링 및 로깅 - VmisIntegrationConfig: 시작 시 활성 모드 출력 - 각 구현체에 [Internal Mode]/[External Mode] 로그 추가 ## 사용 방법 ### Internal Mode (내부 모듈 직접 호출) ```yaml vmis: integration: mode: internal ``` ### External Mode (외부 REST API 호출) ```yaml vmis: integration: mode: external external: api: url: http://localhost:8081/api/v1/vehicles ``` ## 빌드 성공 확인 ✅ - Bean 충돌 해결 완료 - 전체 컴파일 성공 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
* }
* </pre>
*/
public interface VehicleInfoService {
/**
*
*
* <p> .</p>
*
* @param vehicleNumber
* @return ( + )
*/
VehicleApiResponseVO getVehicleInfo(String vehicleNumber);
/**
* ( )
*
* <p> .</p>
* <p> , , .</p>
*
* @param basicRequest (, , )
* @return ( + )
*/
VehicleApiResponseVO getVehicleInfo(BasicRequest basicRequest);
feat: VMIS 통합 모드 전환 기능 구현 (Strategy Pattern) 내부/외부 API 호출을 YAML 설정으로 전환할 수 있는 Strategy Pattern 구현 ## 주요 변경사항 ### 1. Strategy Pattern 구현 - VehicleInfoService 인터페이스 생성 (공통 추상화) - InternalVehicleInfoServiceImpl: 내부 VMIS 모듈 직접 호출 - ExternalVehicleInfoServiceImpl: 외부 REST API 호출 - @ConditionalOnProperty로 mode에 따라 Bean 자동 선택 ### 2. Bean 충돌 해결 - HttpClientConfig의 restTemplate → vmisRestTemplate으로 변경 - GovernmentApiClient에 @Qualifier("vmisRestTemplate") 추가 - 기존 RestTemplateConfig와 충돌 방지 ### 3. 설정 확장 - VmisProperties에 integration, external 속성 추가 - vmis.integration.mode: internal/external 설정 지원 - vmis.external.api.url: 외부 API 서버 URL 설정 ### 4. 모델 변환 유틸리티 - VehicleResponseMapper 생성 - 내부 모델(BasicResponse, LedgerResponse) → 외부 VO 변환 ### 5. 모니터링 및 로깅 - VmisIntegrationConfig: 시작 시 활성 모드 출력 - 각 구현체에 [Internal Mode]/[External Mode] 로그 추가 ## 사용 방법 ### Internal Mode (내부 모듈 직접 호출) ```yaml vmis: integration: mode: internal ``` ### External Mode (외부 REST API 호출) ```yaml vmis: integration: mode: external external: api: url: http://localhost:8081/api/v1/vehicles ``` ## 빌드 성공 확인 ✅ - Bean 충돌 해결 완료 - 전체 컴파일 성공 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
/**
*
*
* <p> .</p>
*
* @param vehicleNumbers
* @return
*/
List<VehicleApiResponseVO> getVehiclesInfo(List<String> vehicleNumbers);
/**
* ()
* : , , BasicRequest
*
* @param request (, , )
* @return
*/
BasicResponse getBasicInfo(BasicRequest request);
/**
* () ()
* : , LedgerRequest
*
* @param request (, , )
* @return
*/
LedgerResponse getLedgerInfo(LedgerRequest request);
feat: VMIS 통합 모드 전환 기능 구현 (Strategy Pattern) 내부/외부 API 호출을 YAML 설정으로 전환할 수 있는 Strategy Pattern 구현 ## 주요 변경사항 ### 1. Strategy Pattern 구현 - VehicleInfoService 인터페이스 생성 (공통 추상화) - InternalVehicleInfoServiceImpl: 내부 VMIS 모듈 직접 호출 - ExternalVehicleInfoServiceImpl: 외부 REST API 호출 - @ConditionalOnProperty로 mode에 따라 Bean 자동 선택 ### 2. Bean 충돌 해결 - HttpClientConfig의 restTemplate → vmisRestTemplate으로 변경 - GovernmentApiClient에 @Qualifier("vmisRestTemplate") 추가 - 기존 RestTemplateConfig와 충돌 방지 ### 3. 설정 확장 - VmisProperties에 integration, external 속성 추가 - vmis.integration.mode: internal/external 설정 지원 - vmis.external.api.url: 외부 API 서버 URL 설정 ### 4. 모델 변환 유틸리티 - VehicleResponseMapper 생성 - 내부 모델(BasicResponse, LedgerResponse) → 외부 VO 변환 ### 5. 모니터링 및 로깅 - VmisIntegrationConfig: 시작 시 활성 모드 출력 - 각 구현체에 [Internal Mode]/[External Mode] 로그 추가 ## 사용 방법 ### Internal Mode (내부 모듈 직접 호출) ```yaml vmis: integration: mode: internal ``` ### External Mode (외부 REST API 호출) ```yaml vmis: integration: mode: external external: api: url: http://localhost:8081/api/v1/vehicles ``` ## 빌드 성공 확인 ✅ - Bean 충돌 해결 완료 - 전체 컴파일 성공 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
}