refactor: 모듈 타입별 아이템 목록 조회 api의 req param을 배열로 변경

This commit is contained in:
Daseul Kim 2024-12-23 15:00:54 +09:00
parent 90abb0b003
commit 37b47049b0
2 changed files with 9 additions and 5 deletions

View File

@ -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<ApiModuleTpResponse> getModuleTypeItemList(
@RequestParam("roofMatlCd") String roofMaterialCd) throws QcastException {
if (roofMaterialCd == null || roofMaterialCd.trim().isEmpty()) {
@RequestParam("arrRoofMatlCd") List<String> 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);

View File

@ -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,7 +22,7 @@ public interface MasterService {
// 모듈 타입별 아이템 목록 조회
@GetMapping("/moduleTypeItemList")
public ApiResponse<ApiModuleTpResponse> getModuleTypeItemList(
@RequestParam("roofMatlCd") String roofMaterialCd);
@RequestParam("arrRoofMatlCd") List<String> roofMaterialCd);
// 가대 목록 조회
@GetMapping("/trestle")