feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Swagger\v1;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Tag(
|
|
|
|
|
* name="Items Files",
|
2025-12-12 17:38:22 +09:00
|
|
|
* description="품목 파일 관리 API - group_id 기반, field_key 동적 지원"
|
|
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="ItemFile",
|
|
|
|
|
* type="object",
|
|
|
|
|
* required={"id", "file_name", "file_path"},
|
|
|
|
|
*
|
|
|
|
|
* @OA\Property(property="id", type="integer", example=123, description="파일 ID"),
|
|
|
|
|
* @OA\Property(property="file_name", type="string", example="도면_v1.pdf", description="파일명"),
|
|
|
|
|
* @OA\Property(property="file_path", type="string", example="1/items/2025/12/a1b2c3d4.pdf", description="파일 경로"),
|
|
|
|
|
* @OA\Property(property="file_url", type="string", format="uri", example="https://api.sam.kr/api/v1/files/download/...", description="다운로드 URL"),
|
|
|
|
|
* @OA\Property(property="file_size", type="integer", example=102400, description="파일 크기 (bytes)"),
|
|
|
|
|
* @OA\Property(property="mime_type", type="string", example="application/pdf", description="MIME 타입"),
|
|
|
|
|
* @OA\Property(property="field_key", type="string", example="drawing", description="필드 키"),
|
|
|
|
|
* @OA\Property(property="created_at", type="string", format="date-time", example="2025-12-12 10:00:00", description="생성일시")
|
|
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="ItemFilesGrouped",
|
|
|
|
|
* type="object",
|
|
|
|
|
* description="field_key별 그룹핑된 파일 목록",
|
|
|
|
|
* example={"drawing": {{"id": 10, "file_name": "도면1.pdf", "file_path": "..."}, {"id": 11, "file_name": "도면2.pdf", "file_path": "..."}}, "certificate": {{"id": 12, "file_name": "인증서.pdf", "file_path": "..."}}}
|
|
|
|
|
* )
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="ItemFileUploadRequest",
|
|
|
|
|
* type="object",
|
|
|
|
|
* required={"field_key", "file"},
|
|
|
|
|
*
|
|
|
|
|
* @OA\Property(property="field_key", type="string", example="drawing", description="필드 키 (자유롭게 지정)"),
|
|
|
|
|
* @OA\Property(property="file", type="string", format="binary", description="업로드할 파일 (최대 20MB)"),
|
|
|
|
|
* @OA\Property(property="file_id", type="integer", nullable=true, example=123, description="기존 파일 ID (있으면 교체, 없으면 추가)")
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="ItemFileUploadResponse",
|
|
|
|
|
* type="object",
|
2025-12-12 17:38:22 +09:00
|
|
|
* required={"file_id", "field_key", "file_url", "file_path", "file_name"},
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
*
|
2025-12-12 17:38:22 +09:00
|
|
|
* @OA\Property(property="file_id", type="integer", example=123, description="파일 ID"),
|
|
|
|
|
* @OA\Property(property="field_key", type="string", example="drawing", description="필드 키"),
|
|
|
|
|
* @OA\Property(property="file_url", type="string", format="uri", example="https://api.sam.kr/api/v1/files/download/...", description="다운로드 URL"),
|
|
|
|
|
* @OA\Property(property="file_path", type="string", example="1/items/2025/12/a1b2c3d4.pdf", description="파일 경로"),
|
|
|
|
|
* @OA\Property(property="file_name", type="string", example="도면_v1.pdf", description="원본 파일명"),
|
2025-12-11 22:40:55 +09:00
|
|
|
* @OA\Property(property="file_size", type="integer", example=102400, description="파일 크기 (bytes)"),
|
2025-12-12 17:38:22 +09:00
|
|
|
* @OA\Property(property="mime_type", type="string", example="application/pdf", description="MIME 타입"),
|
|
|
|
|
* @OA\Property(property="replaced", type="boolean", example=false, description="기존 파일 교체 여부")
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="ItemFileDeleteResponse",
|
|
|
|
|
* type="object",
|
2025-12-12 17:38:22 +09:00
|
|
|
* required={"file_id", "deleted"},
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
*
|
2025-12-12 17:38:22 +09:00
|
|
|
* @OA\Property(property="file_id", type="integer", example=123, description="삭제된 파일 ID"),
|
|
|
|
|
* @OA\Property(property="deleted", type="boolean", example=true, description="삭제 성공 여부")
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
class ItemsFileApi
|
|
|
|
|
{
|
2025-12-12 17:38:22 +09:00
|
|
|
/**
|
|
|
|
|
* 파일 목록 조회
|
|
|
|
|
*
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/api/v1/items/{id}/files",
|
|
|
|
|
* summary="품목 파일 목록 조회",
|
|
|
|
|
* description="품목에 등록된 모든 파일을 field_key별로 그룹핑하여 조회합니다. 응답은 field_key를 키로 하고 파일 배열을 값으로 하는 객체입니다.",
|
|
|
|
|
* operationId="getItemFiles",
|
|
|
|
|
* tags={"Items Files"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
|
|
|
|
*
|
|
|
|
|
* @OA\Parameter(
|
|
|
|
|
* name="id",
|
|
|
|
|
* in="path",
|
|
|
|
|
* required=true,
|
|
|
|
|
* description="품목 ID",
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(type="integer", example=795)
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Parameter(
|
|
|
|
|
* name="item_type",
|
|
|
|
|
* in="query",
|
|
|
|
|
* required=false,
|
|
|
|
|
* description="품목 유형 (FG|PT|SM|RM|CS)",
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(type="string", enum={"FG", "PT", "SM", "RM", "CS"}, default="FG")
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Parameter(
|
|
|
|
|
* name="field_key",
|
|
|
|
|
* in="query",
|
|
|
|
|
* required=false,
|
|
|
|
|
* description="특정 field_key만 조회 (미지정 시 전체)",
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(type="string", example="drawing")
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="파일 목록 조회 성공",
|
|
|
|
|
*
|
|
|
|
|
* @OA\JsonContent(
|
|
|
|
|
*
|
|
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="조회되었습니다."),
|
|
|
|
|
* @OA\Property(property="data", ref="#/components/schemas/ItemFilesGrouped")
|
|
|
|
|
* )
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
|
|
|
|
|
* @OA\Response(response=404, description="품목 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function index() {}
|
|
|
|
|
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
/**
|
|
|
|
|
* 파일 업로드
|
|
|
|
|
*
|
|
|
|
|
* @OA\Post(
|
2025-12-11 22:40:55 +09:00
|
|
|
* path="/api/v1/items/{id}/files",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* summary="품목 파일 업로드",
|
2025-12-12 17:38:22 +09:00
|
|
|
* description="품목에 파일을 업로드합니다.
|
2025-12-11 22:40:55 +09:00
|
|
|
*
|
2025-12-12 17:38:22 +09:00
|
|
|
* **동작 방식**:
|
|
|
|
|
* - `file_id` 없음 → 새 파일 추가
|
|
|
|
|
* - `file_id` 있음 → 기존 파일 soft delete 후 새 파일 추가 (교체)
|
2025-12-11 22:40:55 +09:00
|
|
|
*
|
2025-12-12 17:38:22 +09:00
|
|
|
* **저장 경로**: `storage/app/tenants/{tenant_id}/items/{year}/{month}/{stored_name}`",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* operationId="uploadItemFile",
|
|
|
|
|
* tags={"Items Files"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
|
|
|
|
*
|
|
|
|
|
* @OA\Parameter(
|
2025-12-11 22:40:55 +09:00
|
|
|
* name="id",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* in="path",
|
|
|
|
|
* required=true,
|
2025-12-11 22:40:55 +09:00
|
|
|
* description="품목 ID",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
*
|
2025-12-11 22:40:55 +09:00
|
|
|
* @OA\Schema(type="integer", example=795)
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\RequestBody(
|
|
|
|
|
* required=true,
|
|
|
|
|
*
|
|
|
|
|
* @OA\MediaType(
|
|
|
|
|
* mediaType="multipart/form-data",
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
2025-12-12 17:38:22 +09:00
|
|
|
* required={"field_key", "file"},
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
*
|
|
|
|
|
* @OA\Property(
|
2025-12-12 17:38:22 +09:00
|
|
|
* property="field_key",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* type="string",
|
2025-12-12 17:38:22 +09:00
|
|
|
* description="필드 키 (자유롭게 지정)",
|
|
|
|
|
* example="drawing"
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* ),
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="file",
|
|
|
|
|
* type="string",
|
|
|
|
|
* format="binary",
|
2025-12-11 22:40:55 +09:00
|
|
|
* description="업로드할 파일 (이미지: jpg,png,gif,svg / 문서: pdf,doc,docx,xls,xlsx,hwp). 최대 20MB"
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* ),
|
|
|
|
|
* @OA\Property(
|
2025-12-12 17:38:22 +09:00
|
|
|
* property="file_id",
|
|
|
|
|
* type="integer",
|
|
|
|
|
* nullable=true,
|
|
|
|
|
* description="기존 파일 ID (있으면 교체, 없으면 추가)",
|
|
|
|
|
* example=123
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* ),
|
|
|
|
|
* @OA\Property(
|
2025-12-12 17:38:22 +09:00
|
|
|
* property="item_type",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* type="string",
|
2025-12-12 17:38:22 +09:00
|
|
|
* description="품목 유형 (FG|PT|SM|RM|CS)",
|
|
|
|
|
* example="FG"
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="파일 업로드 성공",
|
|
|
|
|
*
|
|
|
|
|
* @OA\JsonContent(
|
|
|
|
|
*
|
|
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="파일이 업로드되었습니다."),
|
|
|
|
|
* @OA\Property(property="data", ref="#/components/schemas/ItemFileUploadResponse")
|
|
|
|
|
* )
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
|
2025-12-12 17:38:22 +09:00
|
|
|
* @OA\Response(response=404, description="품목 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function upload() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 파일 삭제
|
|
|
|
|
*
|
|
|
|
|
* @OA\Delete(
|
2025-12-12 17:38:22 +09:00
|
|
|
* path="/api/v1/items/{id}/files/{fileId}",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* summary="품목 파일 삭제",
|
2025-12-12 17:38:22 +09:00
|
|
|
* description="품목의 특정 파일을 삭제합니다 (Soft Delete).",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* operationId="deleteItemFile",
|
|
|
|
|
* tags={"Items Files"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
|
|
|
|
*
|
|
|
|
|
* @OA\Parameter(
|
2025-12-11 22:40:55 +09:00
|
|
|
* name="id",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* in="path",
|
|
|
|
|
* required=true,
|
2025-12-11 22:40:55 +09:00
|
|
|
* description="품목 ID",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
*
|
2025-12-11 22:40:55 +09:00
|
|
|
* @OA\Schema(type="integer", example=795)
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Parameter(
|
2025-12-12 17:38:22 +09:00
|
|
|
* name="fileId",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* in="path",
|
|
|
|
|
* required=true,
|
2025-12-12 17:38:22 +09:00
|
|
|
* description="파일 ID",
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(type="integer", example=123)
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Parameter(
|
|
|
|
|
* name="item_type",
|
|
|
|
|
* in="query",
|
|
|
|
|
* required=false,
|
|
|
|
|
* description="품목 유형 (FG|PT|SM|RM|CS)",
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
*
|
2025-12-12 17:38:22 +09:00
|
|
|
* @OA\Schema(type="string", enum={"FG", "PT", "SM", "RM", "CS"}, default="FG")
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="파일 삭제 성공",
|
|
|
|
|
*
|
|
|
|
|
* @OA\JsonContent(
|
|
|
|
|
*
|
|
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="파일이 삭제되었습니다."),
|
|
|
|
|
* @OA\Property(property="data", ref="#/components/schemas/ItemFileDeleteResponse")
|
|
|
|
|
* )
|
|
|
|
|
* ),
|
|
|
|
|
*
|
|
|
|
|
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
|
2025-12-12 17:38:22 +09:00
|
|
|
* @OA\Response(response=404, description="품목 또는 파일 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
|
feat: 품목 파일 업로드 API 구현 (절곡도, 시방서, 인정서)
- Products 테이블에 9개 파일 관련 필드 추가
- bending_diagram, bending_details (JSON)
- specification_file, specification_file_name
- certification_file, certification_file_name
- certification_number, certification_start_date, certification_end_date
- ItemsFileController 구현 (Code-based API)
- POST /items/{code}/files - 파일 업로드
- DELETE /items/{code}/files/{type} - 파일 삭제
- 파일 타입: bending_diagram, specification, certification
- ItemsFileUploadRequest 검증
- 파일 타입별 MIME 검증 (이미지/문서)
- 파일 크기 제한 (10MB/20MB)
- 인증 정보 및 절곡 상세 정보 검증
- Swagger 문서 작성 (ItemsFileApi.php)
- 업로드/삭제 API 스펙
- 스키마: ItemFileUploadResponse, ItemFileDeleteResponse
2025-11-17 13:40:07 +09:00
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function delete() {}
|
2025-12-12 17:38:22 +09:00
|
|
|
}
|