fix: 코드 생성기 GetMapping/PostMapping import 누락 수정

생성되는 Controller에 GetMapping/PostMapping import가
포함되지 않는 문제 수정

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
HYOJIN 2026-03-26 16:50:01 +09:00
부모 d2932f4032
커밋 aabb235ac7
2개의 변경된 파일44개의 추가작업 그리고 1개의 파일을 삭제

파일 보기

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