release: 2026-03-31 (40건 커밋) #118
@ -0,0 +1,81 @@
|
||||
package com.snp.batch.jobs.web.compliance.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.snp.batch.common.web.ApiResponse;
|
||||
import com.snp.batch.common.web.controller.BaseBypassController;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import com.snp.batch.jobs.web.compliance.service.CompliancesByImosService;
|
||||
import com.snp.batch.jobs.web.compliance.service.UpdatedComplianceListService;
|
||||
import com.snp.batch.jobs.web.compliance.service.ComplianceValuesMeaningService;
|
||||
import com.snp.batch.jobs.web.compliance.service.PagedUpdatedComplianceListService;
|
||||
|
||||
/**
|
||||
* Compliance bypass API
|
||||
* S&P Maritime API에서 데이터를 실시간 조회하여 JSON을 그대로 반환
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/compliance")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Compliance", description = "[Service API] Compliance bypass API")
|
||||
public class ComplianceController extends BaseBypassController {
|
||||
|
||||
private final CompliancesByImosService compliancesByImosService;
|
||||
private final UpdatedComplianceListService updatedComplianceListService;
|
||||
private final ComplianceValuesMeaningService complianceValuesMeaningService;
|
||||
private final PagedUpdatedComplianceListService pagedUpdatedComplianceListService;
|
||||
|
||||
@Operation(
|
||||
summary = "IMO 기반 Compliance 조회 조회",
|
||||
description = "S&P API에서 IMO 기반 Compliance 조회 데이터를 요청하고 응답을 그대로 반환합니다."
|
||||
)
|
||||
@GetMapping("/CompliancesByImos")
|
||||
public ResponseEntity<ApiResponse<JsonNode>> getCompliancesByImosData(@Parameter(description = "Comma separated IMOs up to a total of 100", example = "9876543")
|
||||
@RequestParam(required = true) String imos) {
|
||||
return execute(() -> compliancesByImosService.getCompliancesByImosData(imos));
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "기간 내 변경 Compliance 조회 조회",
|
||||
description = "S&P API에서 기간 내 변경 Compliance 조회 데이터를 요청하고 응답을 그대로 반환합니다."
|
||||
)
|
||||
@GetMapping("/UpdatedComplianceList")
|
||||
public ResponseEntity<ApiResponse<JsonNode>> getUpdatedComplianceListData(@Parameter(description = "Time/seconds are optional", example = "9876543")
|
||||
@RequestParam(required = true) String fromDate,
|
||||
@Parameter(description = "Time/seconds are optional. If unspecified, the current UTC date and time is used", example = "9876543")
|
||||
@RequestParam(required = true) String toDate) {
|
||||
return execute(() -> updatedComplianceListService.getUpdatedComplianceListData(fromDate, toDate));
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "모든 Compliance 지표 조회 조회",
|
||||
description = "S&P API에서 모든 Compliance 지표 조회 데이터를 요청하고 응답을 그대로 반환합니다."
|
||||
)
|
||||
@GetMapping("/ComplianceValuesMeaning")
|
||||
public ResponseEntity<ApiResponse<JsonNode>> getComplianceValuesMeaningData() {
|
||||
return execute(() -> complianceValuesMeaningService.getComplianceValuesMeaningData());
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "PagedUpdatedComplianceList 조회",
|
||||
description = "S&P API에서 PagedUpdatedComplianceList 데이터를 요청하고 응답을 그대로 반환합니다."
|
||||
)
|
||||
@GetMapping("/PagedUpdatedComplianceList")
|
||||
public ResponseEntity<ApiResponse<JsonNode>> getPagedUpdatedComplianceListData(@Parameter(description = "Time/seconds are optional", example = "9876543")
|
||||
@RequestParam(required = true) String fromDate,
|
||||
@Parameter(description = "Time/seconds are optional. If unspecified, the current UTC date and time is used", example = "9876543")
|
||||
@RequestParam(required = true) String toDate,
|
||||
@Parameter(description = "Page number to display.", example = "9876543")
|
||||
@RequestParam(required = true) String pageNumber,
|
||||
@Parameter(description = "How many elements will be on the single page. Maximum allowed is 1000.", example = "9876543")
|
||||
@RequestParam(required = true) String pageSize) {
|
||||
return execute(() -> pagedUpdatedComplianceListService.getPagedUpdatedComplianceListData(fromDate, toDate, pageNumber, pageSize));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.snp.batch.jobs.web.compliance.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.snp.batch.common.web.service.BaseBypassService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 모든 Compliance 지표 조회 bypass 서비스
|
||||
* 외부 Maritime API에서 데이터를 실시간 조회하여 JSON을 그대로 반환
|
||||
*/
|
||||
@Service
|
||||
public class ComplianceValuesMeaningService extends BaseBypassService<JsonNode> {
|
||||
|
||||
public ComplianceValuesMeaningService(
|
||||
@Qualifier("maritimeServiceApiWebClient") WebClient webClient) {
|
||||
super(webClient, "/RiskAndCompliance/ComplianceValuesMeaning", "모든 Compliance 지표 조회",
|
||||
new ParameterizedTypeReference<>() {},
|
||||
new ParameterizedTypeReference<>() {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 모든 Compliance 지표 조회 데이터를 조회합니다.
|
||||
*/
|
||||
public JsonNode getComplianceValuesMeaningData() {
|
||||
return fetchRawGet(uri -> uri.path(getApiPath())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.snp.batch.jobs.web.compliance.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.snp.batch.common.web.service.BaseBypassService;
|
||||
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에서 데이터를 실시간 조회하여 JSON을 그대로 반환
|
||||
*/
|
||||
@Service
|
||||
public class CompliancesByImosService extends BaseBypassService<JsonNode> {
|
||||
|
||||
public CompliancesByImosService(
|
||||
@Qualifier("maritimeServiceApiWebClient") WebClient webClient) {
|
||||
super(webClient, "/RiskAndCompliance/CompliancesByImos", "IMO 기반 Compliance 조회",
|
||||
new ParameterizedTypeReference<>() {},
|
||||
new ParameterizedTypeReference<>() {});
|
||||
}
|
||||
|
||||
/**
|
||||
* IMO 기반 Compliance 조회 데이터를 조회합니다.
|
||||
*/
|
||||
public JsonNode getCompliancesByImosData(String imos) {
|
||||
return fetchRawGet(uri -> uri.path(getApiPath())
|
||||
.queryParam("imos", imos)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.snp.batch.jobs.web.compliance.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.snp.batch.common.web.service.BaseBypassService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* PagedUpdatedComplianceList bypass 서비스
|
||||
* 외부 Maritime API에서 데이터를 실시간 조회하여 JSON을 그대로 반환
|
||||
*/
|
||||
@Service
|
||||
public class PagedUpdatedComplianceListService extends BaseBypassService<JsonNode> {
|
||||
|
||||
public PagedUpdatedComplianceListService(
|
||||
@Qualifier("maritimeServiceApiWebClient") WebClient webClient) {
|
||||
super(webClient, "/RiskAndCompliance/PagedUpdatedComplianceList", "PagedUpdatedComplianceList",
|
||||
new ParameterizedTypeReference<>() {},
|
||||
new ParameterizedTypeReference<>() {});
|
||||
}
|
||||
|
||||
/**
|
||||
* PagedUpdatedComplianceList 데이터를 조회합니다.
|
||||
*/
|
||||
public JsonNode getPagedUpdatedComplianceListData(String fromDate, String toDate, String pageNumber, String pageSize) {
|
||||
return fetchRawGet(uri -> uri.path(getApiPath())
|
||||
.queryParam("fromDate", fromDate)
|
||||
.queryParam("toDate", toDate)
|
||||
.queryParam("pageNumber", pageNumber)
|
||||
.queryParam("pageSize", pageSize)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.snp.batch.jobs.web.compliance.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.snp.batch.common.web.service.BaseBypassService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 기간 내 변경 Compliance 조회 bypass 서비스
|
||||
* 외부 Maritime API에서 데이터를 실시간 조회하여 JSON을 그대로 반환
|
||||
*/
|
||||
@Service
|
||||
public class UpdatedComplianceListService extends BaseBypassService<JsonNode> {
|
||||
|
||||
public UpdatedComplianceListService(
|
||||
@Qualifier("maritimeServiceApiWebClient") WebClient webClient) {
|
||||
super(webClient, "/RiskAndCompliance/UpdatedComplianceList", "기간 내 변경 Compliance 조회",
|
||||
new ParameterizedTypeReference<>() {},
|
||||
new ParameterizedTypeReference<>() {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 기간 내 변경 Compliance 조회 데이터를 조회합니다.
|
||||
*/
|
||||
public JsonNode getUpdatedComplianceListData(String fromDate, String toDate) {
|
||||
return fetchRawGet(uri -> uri.path(getApiPath())
|
||||
.queryParam("fromDate", fromDate)
|
||||
.queryParam("toDate", toDate)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
package com.snp.batch.jobs.web.risk.controller;
|
||||
|
||||
import com.snp.batch.common.web.ApiResponse;
|
||||
import com.snp.batch.common.web.controller.BaseBypassController;
|
||||
import com.snp.batch.jobs.batch.risk.dto.RiskDto;
|
||||
import com.snp.batch.jobs.web.risk.service.RiskBypassService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Risk 상세 조회 bypass API
|
||||
* S&P Maritime API에서 Risk 데이터를 실시간 조회하여 그대로 반환
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/risk")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Risk", description = "[Service API] 선박 Risk 상세 정보 bypass API")
|
||||
public class RiskController extends BaseBypassController {
|
||||
|
||||
private final RiskBypassService riskBypassService;
|
||||
|
||||
@Operation(
|
||||
summary = "IMO 기반 Risk 상세 조회",
|
||||
description = "S&P API에 IMO 번호로 Risk 상세 데이터를 요청하고 응답을 그대로 반환합니다."
|
||||
)
|
||||
@GetMapping("/{imo}")
|
||||
public ResponseEntity<ApiResponse<List<RiskDto>>> getRiskDetailByImo(
|
||||
@Parameter(description = "IMO 번호", example = "9321483")
|
||||
@PathVariable String imo) {
|
||||
return execute(() -> riskBypassService.getRiskDetailByImo(imo));
|
||||
}
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package com.snp.batch.jobs.web.risk.service;
|
||||
|
||||
import com.snp.batch.common.web.service.BaseBypassService;
|
||||
import com.snp.batch.jobs.batch.risk.dto.RiskDto;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* S&P Risk API bypass 서비스
|
||||
* 외부 Maritime API에서 Risk 상세 데이터를 실시간 조회하여 그대로 반환
|
||||
*/
|
||||
@Service
|
||||
public class RiskBypassService extends BaseBypassService<RiskDto> {
|
||||
|
||||
public RiskBypassService(
|
||||
@Qualifier("maritimeServiceApiWebClient") WebClient webClient) {
|
||||
super(webClient, "/RiskAndCompliance/RisksByImos", "S&P Risk",
|
||||
new ParameterizedTypeReference<>() {},
|
||||
new ParameterizedTypeReference<>() {});
|
||||
}
|
||||
|
||||
/**
|
||||
* IMO 번호로 S&P Risk 상세 데이터를 조회합니다.
|
||||
*
|
||||
* @param imo IMO 번호
|
||||
* @return Risk 상세 데이터 목록
|
||||
*/
|
||||
public List<RiskDto> getRiskDetailByImo(String imo) {
|
||||
return fetchGetList(uri -> uri.path(getApiPath())
|
||||
.queryParam("imos", imo)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
불러오는 중...
Reference in New Issue
Block a user