api 설명 추가

This commit is contained in:
hyojun.choi 2024-08-20 10:48:37 +09:00
parent c1e97de96e
commit 17d3b5d797
6 changed files with 32 additions and 21 deletions

View File

@ -1,6 +1,8 @@
package com.interplug.qcast.biz.module;
import com.interplug.qcast.biz.module.dto.ModuleResponse;
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.*;
@ -8,10 +10,11 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/module")
@RequiredArgsConstructor
@Tag(name = "ModuleController", description = "모듈 관련 API")
public class ModuleController {
private final ModuleService moduleService;
// 모듈 조회
@Operation(description = "지붕재 ID와 가대 ID에 따라 설치 가능한 모듈 목록을 조회한다.")
@GetMapping("/v1.0/modules/{roofMaterialId}/{trestleId}")
public List<ModuleResponse> getModulesByRoofMaterialIdAndTrestleId(
@PathVariable("roofMaterialId") Integer roofMaterialId,

View File

@ -1,6 +1,8 @@
package com.interplug.qcast.biz.roofmaterial;
import com.interplug.qcast.biz.roofmaterial.dto.RoofMaterialResponse;
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;
@ -10,9 +12,11 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/roof-material")
@Tag(name = "RoofMaterialController", description = "지붕재 API")
public class RoofMaterialController {
private final RoofMaterialService roofService;
@Operation(description = "지붕재 목록을 조회한다.")
@GetMapping("/v1.0/roof-materials")
public List<RoofMaterialResponse> getRoofMaterials() {
return roofService.getRoofMaterials();

View File

@ -1,6 +1,8 @@
package com.interplug.qcast.biz.trestle;
import com.interplug.qcast.biz.trestle.dto.TrestleResponse;
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.*;
@ -8,9 +10,11 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/trestle")
@Tag(description = "가대 관련 API", name = "TrestleController")
public class TrestleController {
private final TrestleService trestleService;
@Operation(description = "지붕재 ID에 따라 가대 목록을 조회한다.")
@GetMapping("/v1.0/trestles/{roofMaterialId}")
public List<TrestleResponse> getTrestlesByRoofMaterialId(@PathVariable Integer roofMaterialId) {
return trestleService.getTrestlesByRoofMaterialId(roofMaterialId);

View File

@ -3,12 +3,12 @@
<mapper namespace="com.interplug.qcast.biz.module.ModuleMapper">
<select id="getModulesByRoofMaterialIdAndTrestleId" parameterType="integer" resultType="com.interplug.qcast.biz.module.dto.ModuleResponse">
select b.id
, b.name
from tb_map_roof_material_trestle_module a
join tb_module b
on a.MODULE_ID = b.ID
where a.roof_material_id = #{roofMaterialId}
and a.trestle_id = #{trestleId}
SELECT B.ID
, B.NAME
FROM TB_MAP_ROOF_MATERIAL_TRESTLE_MODULE A
JOIN TB_MODULE B
ON A.MODULE_ID = B.ID
WHERE A.ROOF_MATERIAL_ID = #{roofMaterialId}
AND A.TRESTLE_ID = #{trestleId}
</select>
</mapper>

View File

@ -3,8 +3,8 @@
<mapper namespace="com.interplug.qcast.biz.roofmaterial.RoofMaterialMapper">
<select id="getRoofMaterials" resultType="com.interplug.qcast.biz.roofmaterial.dto.RoofMaterialResponse">
select id
, name
from TB_ROOF_MATERIAL
SELECT ID
, NAME
FROM TB_ROOF_MATERIAL
</select>
</mapper>

View File

@ -4,15 +4,15 @@
<mapper namespace="com.interplug.qcast.biz.trestle.TrestleMapper">
<select id="getTrestlesByRoofMaterialId" parameterType="integer"
resultType="com.interplug.qcast.biz.trestle.dto.TrestleResponse">
select a.trestle_id as id
, b.name as name
, c.id as manufacturerId
, c.name as manufacturerName
from tb_map_roof_material_trestle a
join tb_trestle b
on a.trestle_id = b.id
join tb_manufacturer c
on b.manufacturer_id = c.id
where a.roof_material_id = #{roofMaterialId}
SELECT A.TRESTLE_ID AS ID
, B.NAME AS NAME
, C.ID AS MANUFACTURERID
, C.NAME AS MANUFACTURERNAME
FROM TB_MAP_ROOF_MATERIAL_TRESTLE A
JOIN TB_TRESTLE B
ON A.TRESTLE_ID = B.ID
JOIN TB_MANUFACTURER C
ON B.MANUFACTURER_ID = C.ID
WHERE A.ROOF_MATERIAL_ID = #{roofMaterialId}
</select>
</mapper>