feat: BY PASS API 등록 프로세스 설계 및 개발 (#63) #108
@ -0,0 +1,35 @@
|
|||||||
|
package com.snp.batch.jobs.web.compliance.service;
|
||||||
|
|
||||||
|
import com.snp.batch.jobs.web.compliance.dto.ComplianceBypassDto;
|
||||||
|
import com.snp.batch.common.web.service.BaseBypassService;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.reactive.function.client.WebClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMO 기반 선박 Compliance 조회 bypass 서비스
|
||||||
|
* 외부 Maritime API에서 데이터를 실시간 조회하여 그대로 반환
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ComplianceBypassService extends BaseBypassService<ComplianceBypassDto> {
|
||||||
|
|
||||||
|
public ComplianceBypassService(
|
||||||
|
@Qualifier("maritimeServiceApiWebClient") WebClient webClient) {
|
||||||
|
super(webClient, "/RiskAndCompliance/CompliancesByImos", "IMO 기반 선박 Compliance 조회",
|
||||||
|
new ParameterizedTypeReference<>() {},
|
||||||
|
new ParameterizedTypeReference<>() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMO 기반 선박 Compliance 조회 데이터를 조회합니다.
|
||||||
|
*
|
||||||
|
* @return IMO 기반 선박 Compliance 조회
|
||||||
|
*/
|
||||||
|
public List<ComplianceBypassDto> getComplianceData(String imos) {
|
||||||
|
return fetchGetList(uri -> uri.path(getApiPath())
|
||||||
|
.queryParam("imos", imos)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -145,7 +145,7 @@ public class BypassCodeGenerator {
|
|||||||
|
|
||||||
public {{DOMAIN_CAP}}BypassService(
|
public {{DOMAIN_CAP}}BypassService(
|
||||||
@Qualifier("{{WEBCLIENT_BEAN}}") WebClient webClient) {
|
@Qualifier("{{WEBCLIENT_BEAN}}") WebClient webClient) {
|
||||||
super(webClient, "{{DISPLAY_NAME}}", "{{EXTERNAL_PATH}}",
|
super(webClient, "{{EXTERNAL_PATH}}", "{{DISPLAY_NAME}}",
|
||||||
new ParameterizedTypeReference<>() {},
|
new ParameterizedTypeReference<>() {},
|
||||||
new ParameterizedTypeReference<>() {});
|
new ParameterizedTypeReference<>() {});
|
||||||
}
|
}
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user