feat: BY PASS API 등록 프로세스 설계 및 개발 (#63) #108

병합
HYOJIN feature/ISSUE-63-bypass-api-registration 에서 develop 로 19 commits 를 머지했습니다 2026-03-27 14:32:14 +09:00
2개의 변경된 파일44개의 추가작업 그리고 1개의 파일을 삭제
Showing only changes of commit aabb235ac7 - Show all commits

파일 보기

@ -0,0 +1,39 @@
package com.snp.batch.jobs.web.compliance.controller;
import com.snp.batch.jobs.web.compliance.dto.ComplianceBypassDto;
import com.snp.batch.jobs.web.compliance.service.ComplianceBypassService;
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 java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestParam;
/**
* IMO 기반 선박 Compliance 조회 bypass API
* S&P Maritime API에서 데이터를 실시간 조회하여 그대로 반환
*/
@RestController
@RequestMapping("/api/compliance")
@RequiredArgsConstructor
@Tag(name = "Compliance", description = "IMO 기반 선박 Compliance 조회 bypass API")
public class ComplianceController extends BaseBypassController {
private final ComplianceBypassService complianceBypassService;
@Operation(
summary = "IMO 기반 선박 Compliance 조회 조회",
description = "S&P API에서 IMO 기반 선박 Compliance 조회 데이터를 요청하고 응답을 그대로 반환합니다."
)
@GetMapping
public ResponseEntity<ApiResponse<List<ComplianceBypassDto>>> getComplianceData(@Parameter(description = "IMO(최대 100개)")
@RequestParam(required = true) String imos) {
return execute(() -> complianceBypassService.getComplianceData(imos));
}
}

파일 보기

@ -203,6 +203,9 @@ public class BypassCodeGenerator {
? "import org.springframework.web.bind.annotation.RequestParam;\n" : "";
String requestBodyImport = isPost
? "import org.springframework.web.bind.annotation.RequestBody;\n" : "";
String mappingImport = isPost
? "import org.springframework.web.bind.annotation.PostMapping;\n"
: "import org.springframework.web.bind.annotation.GetMapping;\n";
String mappingPath = buildMappingPath(params);
String requestMappingPath = "/api/" + domain;
@ -221,7 +224,7 @@ public class BypassCodeGenerator {
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
{{PATH_VARIABLE_IMPORT}}{{REQUEST_PARAM_IMPORT}}{{REQUEST_BODY_IMPORT}}
{{MAPPING_IMPORT}}{{PATH_VARIABLE_IMPORT}}{{REQUEST_PARAM_IMPORT}}{{REQUEST_BODY_IMPORT}}
/**
* {{DISPLAY_NAME}} bypass API
* S&P Maritime API에서 데이터를 실시간 조회하여 그대로 반환
@ -251,6 +254,7 @@ public class BypassCodeGenerator {
.replace("{{PATH_VARIABLE_IMPORT}}", pathVariableImport)
.replace("{{REQUEST_PARAM_IMPORT}}", requestParamImport)
.replace("{{REQUEST_BODY_IMPORT}}", requestBodyImport)
.replace("{{MAPPING_IMPORT}}", mappingImport)
.replace("{{DISPLAY_NAME}}", config.getDisplayName())
.replace("{{DOMAIN_CAP}}", domainCap)
.replace("{{REQUEST_MAPPING_PATH}}", requestMappingPath)