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

View File

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

View File

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

View File

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

View File

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

View File

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