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:
부모
d2932f4032
커밋
aabb235ac7
@ -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)
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user