package com.interplug.qcast.biz.module;

import com.interplug.qcast.biz.module.dto.ModuleInfoResponse;
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.*;

@RestController
@RequestMapping("/api/module/module-infos")
@RequiredArgsConstructor
@Tag(name = "ModuleInfoController", description = "모듈 정보 API")
public class ModuleInfoController {
  private final ModuleInfoService moduleService;

  @Operation(description = "지붕재 ID와 가대 ID에 따라 설치 가능한 모듈 목록을 조회한다.")
  @GetMapping
  public List<ModuleInfoResponse> getModulesByRoofMaterialIdAndTrestleId(
      @RequestParam("roofMaterialId") Integer roofMaterialId,
      @RequestParam("trestleId") Integer trestleId) {
    return moduleService.getModulesByRoofMaterialIdAndTrestleId(roofMaterialId, trestleId);
  }
}
