From 07f1a004b7f905e61de2ca88a8a38c6f318136bb Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Thu, 12 Dec 2024 10:54:46 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20query=20string=20=EB=B0=A9=EC=8B=9D?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD,=20validation=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interplug/qcast/biz/master/MasterController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/interplug/qcast/biz/master/MasterController.java b/src/main/java/com/interplug/qcast/biz/master/MasterController.java index 9518fedf..6f831b3e 100644 --- a/src/main/java/com/interplug/qcast/biz/master/MasterController.java +++ b/src/main/java/com/interplug/qcast/biz/master/MasterController.java @@ -9,15 +9,16 @@ import com.interplug.qcast.biz.master.dto.ApiTrestleDetailRequest; import com.interplug.qcast.biz.master.dto.ApiTrestleDetailResponse; import com.interplug.qcast.biz.master.dto.ApiTrestleRequest; import com.interplug.qcast.biz.master.dto.ApiTrestleResponse; +import com.interplug.qcast.config.Exception.ErrorCode; +import com.interplug.qcast.config.Exception.QcastException; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; - import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RestController @@ -34,9 +35,12 @@ public class MasterController { } @Operation(description = "모듈 타입별 아이템 목록을 조회한다.") - @GetMapping("/getModuleTypeItemList/{roofMatlCd}") + @GetMapping("/getModuleTypeItemList") public ApiResponse getModuleTypeItemList( - @PathVariable("roofMatlCd") String roofMaterialCd) { + @RequestParam("roofMatlCd") String roofMaterialCd) throws QcastException { + if (roofMaterialCd == null || roofMaterialCd.trim().isEmpty()) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE); + } return masterService.getModuleTypeItemList(roofMaterialCd); }