From 37b47049b0f25445641e18b92ed1dc61abdfd0b3 Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Mon, 23 Dec 2024 15:00:54 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=AA=A8=EB=93=88=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=EB=B3=84=20=EC=95=84=EC=9D=B4=ED=85=9C=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20api=EC=9D=98=20req=20param?= =?UTF-8?q?=EC=9D=84=20=EB=B0=B0=EC=97=B4=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/interplug/qcast/biz/master/MasterController.java | 8 ++++++-- .../com/interplug/qcast/biz/master/MasterService.java | 6 +++--- 2 files changed, 9 insertions(+), 5 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 240015a9..55704a25 100644 --- a/src/main/java/com/interplug/qcast/biz/master/MasterController.java +++ b/src/main/java/com/interplug/qcast/biz/master/MasterController.java @@ -10,6 +10,7 @@ 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 java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -32,8 +33,11 @@ public class MasterController { @Operation(description = "모듈 타입별 아이템 목록을 조회한다.") @GetMapping("/getModuleTypeItemList") public ApiResponse getModuleTypeItemList( - @RequestParam("roofMatlCd") String roofMaterialCd) throws QcastException { - if (roofMaterialCd == null || roofMaterialCd.trim().isEmpty()) { + @RequestParam("arrRoofMatlCd") List roofMaterialCd) throws QcastException { + if (roofMaterialCd == null + || roofMaterialCd.isEmpty() + || roofMaterialCd.size() > 4 + || roofMaterialCd.stream().anyMatch(s -> s == null || s.trim().isEmpty())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE); } return masterService.getModuleTypeItemList(roofMaterialCd); diff --git a/src/main/java/com/interplug/qcast/biz/master/MasterService.java b/src/main/java/com/interplug/qcast/biz/master/MasterService.java index 1f1ee556..64a9e640 100644 --- a/src/main/java/com/interplug/qcast/biz/master/MasterService.java +++ b/src/main/java/com/interplug/qcast/biz/master/MasterService.java @@ -6,7 +6,7 @@ import com.interplug.qcast.biz.master.dto.ApiResponse; import com.interplug.qcast.biz.master.dto.ApiRoofMaterialResponse; import com.interplug.qcast.biz.master.dto.ApiTrestleDetailResponse; import com.interplug.qcast.biz.master.dto.ApiTrestleResponse; - +import java.util.List; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -22,8 +22,8 @@ public interface MasterService { // 모듈 타입별 아이템 목록 조회 @GetMapping("/moduleTypeItemList") public ApiResponse getModuleTypeItemList( - @RequestParam("roofMatlCd") String roofMaterialCd); - + @RequestParam("arrRoofMatlCd") List roofMaterialCd); + // 가대 목록 조회 @GetMapping("/trestle") public ApiResponse getTrestleList(