Files
sam-api/app/Swagger/v1/BendingItemApi.php
강영보 c29090a0b8 feat: [bending] 절곡품 전용 테이블 분리 API
- bending_items 전용 테이블 생성 (items.options → 정규 컬럼 승격)
- bending_models 전용 테이블 생성 (가이드레일/케이스/하단마감재 통합)
- bending_data JSON 통합 (별도 테이블 → bending_items.bending_data 컬럼)
- bending_item_mappings 테이블 DROP (bending_items.code에 흡수)
- BendingItemService/BendingCodeService → BendingItem 모델 전환
- GuiderailModelService component 이미지 자동 복사
- ItemsFileController bending_items/bending_models 폴백 지원
- Swagger 스키마 업데이트
2026-03-19 20:00:18 +09:00

193 lines
12 KiB
PHP

<?php
namespace App\Swagger\v1;
/**
* @OA\Tag(name="BendingItem", description="절곡품 기초관리 (bending_items 전용 테이블)")
*
* @OA\Schema(
* schema="BendingItem",
* @OA\Property(property="id", type="integer", example=431),
* @OA\Property(property="code", type="string", example="RS260319", description="LOT 코드: {제품Code}{종류Code}{YYMMDD}"),
* @OA\Property(property="legacy_code", type="string", nullable=true, example="BD-RS-30", description="이전 코드 (items 기반)"),
* @OA\Property(property="item_name", type="string", example="SUS마감재"),
* @OA\Property(property="item_sep", type="string", enum={"스크린","철재"}),
* @OA\Property(property="item_bending", type="string", example="가이드레일"),
* @OA\Property(property="item_spec", type="string", nullable=true, example="120*70"),
* @OA\Property(property="material", type="string", example="SUS 1.2T"),
* @OA\Property(property="model_name", type="string", nullable=true, example="KSS01"),
* @OA\Property(property="model_UA", type="string", nullable=true, enum={"인정","비인정"}),
* @OA\Property(property="rail_width", type="number", nullable=true),
* @OA\Property(property="exit_direction", type="string", nullable=true, description="출구방향 (케이스 전용)"),
* @OA\Property(property="front_bottom", type="number", nullable=true, description="전면밑 (케이스 전용)"),
* @OA\Property(property="box_width", type="number", nullable=true, description="박스폭 (케이스 전용)"),
* @OA\Property(property="box_height", type="number", nullable=true, description="박스높이 (케이스 전용)"),
* @OA\Property(property="inspection_door", type="string", nullable=true, description="점검구 (케이스 전용)"),
* @OA\Property(property="length_code", type="string", nullable=true, example="30", description="원자재 길이코드"),
* @OA\Property(property="length_mm", type="integer", nullable=true, example=3000, description="원자재 길이(mm)"),
* @OA\Property(property="bendingData", type="array", nullable=true, description="전개도 데이터 (bending_data 테이블)", @OA\Items(
* @OA\Property(property="no", type="integer", description="열 순서"),
* @OA\Property(property="input", type="number", description="입력 치수"),
* @OA\Property(property="rate", type="string", description="연신율: 빈값/'-1'(하향)/'1'(상향)"),
* @OA\Property(property="sum", type="number", description="누적 합계"),
* @OA\Property(property="color", type="boolean", description="음영 마킹"),
* @OA\Property(property="aAngle", type="boolean", description="A각 표시")
* )),
* @OA\Property(property="search_keyword", type="string", nullable=true),
* @OA\Property(property="author", type="string", nullable=true),
* @OA\Property(property="memo", type="string", nullable=true),
* @OA\Property(property="registration_date", type="string", format="date", nullable=true),
* @OA\Property(property="image_file_id", type="integer", nullable=true, description="절곡 도면 이미지 파일 ID"),
* @OA\Property(property="legacy_bending_id", type="integer", nullable=true, description="chandj.bending.num 참조"),
* @OA\Property(property="legacy_bending_num", type="integer", nullable=true, description="MNG2 호환 (=legacy_bending_id)"),
* @OA\Property(property="modified_by", type="string", nullable=true),
* @OA\Property(property="width_sum", type="number", nullable=true, example=203, description="폭합계 (전개도 마지막 sum)"),
* @OA\Property(property="bend_count", type="integer", example=5, description="절곡 횟수"),
* @OA\Property(property="is_active", type="boolean", example=true),
* @OA\Property(property="name", type="string", description="MNG2 호환 (=item_name)"),
* @OA\Property(property="front_bottom_width", type="number", nullable=true, description="MNG2 호환 (=front_bottom)"),
* @OA\Property(property="item_type", type="string", example="PT", description="MNG2 호환 (고정값)"),
* @OA\Property(property="item_category", type="string", example="BENDING", description="MNG2 호환 (고정값)"),
* @OA\Property(property="unit", type="string", example="EA", description="MNG2 호환 (고정값)"),
* @OA\Property(property="created_at", type="string", format="date-time"),
* @OA\Property(property="updated_at", type="string", format="date-time")
* )
*/
class BendingItemApi
{
/**
* @OA\Get(
* path="/api/v1/bending-items",
* tags={"BendingItem"},
* summary="절곡품 목록 조회",
* description="bending_items 테이블에서 검색. 정규 컬럼 인덱스로 빠른 검색 지원.",
* @OA\Parameter(name="item_sep", in="query", required=false, @OA\Schema(type="string", enum={"스크린","철재"})),
* @OA\Parameter(name="item_bending", in="query", required=false, @OA\Schema(type="string")),
* @OA\Parameter(name="material", in="query", required=false, @OA\Schema(type="string")),
* @OA\Parameter(name="model_UA", in="query", required=false, @OA\Schema(type="string", enum={"인정","비인정"})),
* @OA\Parameter(name="model_name", in="query", required=false, @OA\Schema(type="string")),
* @OA\Parameter(name="legacy_bending_num", in="query", required=false, @OA\Schema(type="integer"), description="chandj.bending.num으로 검색"),
* @OA\Parameter(name="search", in="query", required=false, @OA\Schema(type="string"), description="item_name, code, item_spec, legacy_code 통합 검색"),
* @OA\Parameter(name="page", in="query", required=false, @OA\Schema(type="integer")),
* @OA\Parameter(name="size", in="query", required=false, @OA\Schema(type="integer", default=50)),
* @OA\Response(response=200, description="성공", @OA\JsonContent(
* @OA\Property(property="data", type="object",
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/BendingItem")),
* @OA\Property(property="total", type="integer")
* )
* ))
* )
*/
public function index() {}
/**
* @OA\Get(
* path="/api/v1/bending-items/filters",
* tags={"BendingItem"},
* summary="절곡품 필터 옵션 조회",
* description="item_sep, item_bending, material, model_UA, model_name 고유값 목록",
* @OA\Response(response=200, description="성공", @OA\JsonContent(
* @OA\Property(property="data", type="object",
* @OA\Property(property="item_sep", type="array", @OA\Items(type="string")),
* @OA\Property(property="item_bending", type="array", @OA\Items(type="string")),
* @OA\Property(property="material", type="array", @OA\Items(type="string")),
* @OA\Property(property="model_UA", type="array", @OA\Items(type="string")),
* @OA\Property(property="model_name", type="array", @OA\Items(type="string"))
* )
* ))
* )
*/
public function filters() {}
/**
* @OA\Get(
* path="/api/v1/bending-items/{id}",
* tags={"BendingItem"},
* summary="절곡품 상세 조회",
* description="전개도 데이터(bendingData) 포함",
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
* @OA\Response(response=200, description="성공", @OA\JsonContent(
* @OA\Property(property="data", ref="#/components/schemas/BendingItem")
* ))
* )
*/
public function show() {}
/**
* @OA\Post(
* path="/api/v1/bending-items",
* tags={"BendingItem"},
* summary="절곡품 등록",
* @OA\RequestBody(@OA\JsonContent(
* required={"code","item_name","item_sep","item_bending","material"},
* @OA\Property(property="code", type="string", example="RM260319", description="LOT 코드"),
* @OA\Property(property="item_name", type="string", example="본체"),
* @OA\Property(property="item_sep", type="string", enum={"스크린","철재"}),
* @OA\Property(property="item_bending", type="string", example="가이드레일"),
* @OA\Property(property="material", type="string", example="EGI 1.55T"),
* @OA\Property(property="item_spec", type="string", nullable=true, example="120*70"),
* @OA\Property(property="model_name", type="string", nullable=true, example="KSS01"),
* @OA\Property(property="model_UA", type="string", nullable=true, enum={"인정","비인정"}),
* @OA\Property(property="rail_width", type="number", nullable=true),
* @OA\Property(property="exit_direction", type="string", nullable=true),
* @OA\Property(property="front_bottom", type="number", nullable=true),
* @OA\Property(property="box_width", type="number", nullable=true),
* @OA\Property(property="box_height", type="number", nullable=true),
* @OA\Property(property="inspection_door", type="string", nullable=true),
* @OA\Property(property="length_code", type="string", nullable=true, example="30"),
* @OA\Property(property="length_mm", type="integer", nullable=true, example=3000),
* @OA\Property(property="bendingData", type="array", nullable=true, @OA\Items(
* @OA\Property(property="no", type="integer"),
* @OA\Property(property="input", type="number"),
* @OA\Property(property="rate", type="string"),
* @OA\Property(property="sum", type="number"),
* @OA\Property(property="color", type="boolean"),
* @OA\Property(property="aAngle", type="boolean")
* )),
* @OA\Property(property="memo", type="string", nullable=true),
* @OA\Property(property="author", type="string", nullable=true)
* )),
* @OA\Response(response=200, description="성공")
* )
*/
public function store() {}
/**
* @OA\Put(
* path="/api/v1/bending-items/{id}",
* tags={"BendingItem"},
* summary="절곡품 수정",
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
* @OA\RequestBody(@OA\JsonContent(
* @OA\Property(property="code", type="string"),
* @OA\Property(property="item_name", type="string"),
* @OA\Property(property="item_sep", type="string", enum={"스크린","철재"}),
* @OA\Property(property="item_bending", type="string"),
* @OA\Property(property="material", type="string"),
* @OA\Property(property="item_spec", type="string", nullable=true),
* @OA\Property(property="model_name", type="string", nullable=true),
* @OA\Property(property="model_UA", type="string", nullable=true),
* @OA\Property(property="rail_width", type="number", nullable=true),
* @OA\Property(property="length_code", type="string", nullable=true),
* @OA\Property(property="length_mm", type="integer", nullable=true),
* @OA\Property(property="bendingData", type="array", nullable=true, description="전체 교체", @OA\Items(type="object")),
* @OA\Property(property="memo", type="string", nullable=true)
* )),
* @OA\Response(response=200, description="성공")
* )
*/
public function update() {}
/**
* @OA\Delete(
* path="/api/v1/bending-items/{id}",
* tags={"BendingItem"},
* summary="절곡품 삭제",
* description="bending_data(전개도)도 함께 삭제",
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
* @OA\Response(response=200, description="성공")
* )
*/
public function destroy() {}
}