docs: Swagger 미문서화 API 29개 엔드포인트 문서화

- P1: AuthApi.php - token-login 추가
- P1: DepartmentApi.php - departments/tree 추가
- P2: AdminGlobalMenuApi.php 신규 생성 (9개 엔드포인트)
- P3: ModelSetApi.php 신규 생성 (10개 엔드포인트)
- P4: MenuApi.php 동기화 관련 7개 엔드포인트 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-21 14:55:16 +09:00
parent 60ae7ab7bd
commit 8df7f2cc09
5 changed files with 1114 additions and 0 deletions

View File

@@ -0,0 +1,316 @@
<?php
namespace App\Swagger\v1;
/**
* @OA\Tag(
* name="Admin.GlobalMenu",
* description="글로벌 메뉴 관리 (시스템 관리자용)"
* )
*/
/**
* =========================
* Domain 스키마
* =========================
*
* @OA\Schema(
* schema="GlobalMenu",
* type="object",
* description="글로벌 메뉴",
* required={"id","name"},
*
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="parent_id", type="integer", nullable=true, example=null),
* @OA\Property(property="name", type="string", example="대시보드"),
* @OA\Property(property="url", type="string", nullable=true, example="/dashboard"),
* @OA\Property(property="icon", type="string", nullable=true, example="dashboard"),
* @OA\Property(property="sort_order", type="integer", example=1),
* @OA\Property(property="is_active", type="boolean", example=true),
* @OA\Property(property="hidden", type="boolean", example=false),
* @OA\Property(property="is_external", type="boolean", example=false),
* @OA\Property(property="external_url", type="string", nullable=true, example=null),
* @OA\Property(property="created_at", type="string", format="date-time", example="2025-01-01 10:00:00"),
* @OA\Property(property="updated_at", type="string", format="date-time", example="2025-01-01 10:00:00")
* )
*
* @OA\Schema(
* schema="GlobalMenuCreateRequest",
* type="object",
* required={"name"},
*
* @OA\Property(property="parent_id", type="integer", nullable=true, example=null),
* @OA\Property(property="name", type="string", example="신규 메뉴"),
* @OA\Property(property="url", type="string", nullable=true, example="/new-menu"),
* @OA\Property(property="icon", type="string", nullable=true, example="add"),
* @OA\Property(property="sort_order", type="integer", example=10),
* @OA\Property(property="is_active", type="boolean", example=true),
* @OA\Property(property="hidden", type="boolean", example=false),
* @OA\Property(property="is_external", type="boolean", example=false),
* @OA\Property(property="external_url", type="string", nullable=true, example=null)
* )
*
* @OA\Schema(
* schema="GlobalMenuUpdateRequest",
* type="object",
*
* @OA\Property(property="parent_id", type="integer", nullable=true, example=null),
* @OA\Property(property="name", type="string", example="수정된 메뉴"),
* @OA\Property(property="url", type="string", nullable=true, example="/updated-menu"),
* @OA\Property(property="icon", type="string", nullable=true, example="edit"),
* @OA\Property(property="sort_order", type="integer", example=5),
* @OA\Property(property="is_active", type="boolean", example=true),
* @OA\Property(property="hidden", type="boolean", example=false),
* @OA\Property(property="is_external", type="boolean", example=false),
* @OA\Property(property="external_url", type="string", nullable=true, example=null)
* )
*
* @OA\Schema(
* schema="GlobalMenuReorderRequest",
* type="object",
* required={"items"},
*
* @OA\Property(
* property="items",
* type="array",
* @OA\Items(
* type="object",
* required={"id","sort_order"},
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="sort_order", type="integer", example=10),
* @OA\Property(property="parent_id", type="integer", nullable=true, example=null)
* )
* )
* )
*
* @OA\Schema(
* schema="GlobalMenuStats",
* type="object",
*
* @OA\Property(property="total", type="integer", example=25),
* @OA\Property(property="active", type="integer", example=20),
* @OA\Property(property="hidden", type="integer", example=3),
* @OA\Property(property="external", type="integer", example=2)
* )
*/
class AdminGlobalMenuApi
{
/**
* @OA\Get(
* path="/api/v1/admin/global-menus",
* summary="글로벌 메뉴 목록 조회",
* description="시스템 전체 글로벌 메뉴 목록을 조회합니다.",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @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", type="array", @OA\Items(ref="#/components/schemas/GlobalMenu"))
* )
* )
* )
*/
public function index() {}
/**
* @OA\Get(
* path="/api/v1/admin/global-menus/tree",
* summary="글로벌 메뉴 트리 조회",
* description="글로벌 메뉴를 계층 구조(트리)로 조회합니다.",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @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", type="array",
* @OA\Items(
* allOf={@OA\Schema(ref="#/components/schemas/GlobalMenu")},
* @OA\Property(property="children", type="array", @OA\Items(ref="#/components/schemas/GlobalMenu"))
* )
* )
* )
* )
* )
*/
public function tree() {}
/**
* @OA\Get(
* path="/api/v1/admin/global-menus/stats",
* summary="글로벌 메뉴 통계 조회",
* description="글로벌 메뉴의 통계 정보를 조회합니다.",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @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/GlobalMenuStats")
* )
* )
* )
*/
public function stats() {}
/**
* @OA\Get(
* path="/api/v1/admin/global-menus/{id}",
* summary="글로벌 메뉴 단건 조회",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="글로벌 메뉴 ID", @OA\Schema(type="integer", example=1)),
*
* @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/GlobalMenu")
* )
* ),
*
* @OA\Response(response=404, description="메뉴 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function show() {}
/**
* @OA\Post(
* path="/api/v1/admin/global-menus",
* summary="글로벌 메뉴 생성",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/GlobalMenuCreateRequest")),
*
* @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/GlobalMenu")
* )
* ),
*
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function store() {}
/**
* @OA\Put(
* path="/api/v1/admin/global-menus/{id}",
* summary="글로벌 메뉴 수정",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="글로벌 메뉴 ID", @OA\Schema(type="integer", example=1)),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/GlobalMenuUpdateRequest")),
*
* @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/GlobalMenu")
* )
* ),
*
* @OA\Response(response=404, description="메뉴 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function update() {}
/**
* @OA\Delete(
* path="/api/v1/admin/global-menus/{id}",
* summary="글로벌 메뉴 삭제",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="글로벌 메뉴 ID", @OA\Schema(type="integer", example=1)),
*
* @OA\Response(response=200, description="글로벌 메뉴 삭제 성공",
*
* @OA\JsonContent(
*
* @OA\Property(property="success", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="글로벌 메뉴 삭제")
* )
* ),
*
* @OA\Response(response=404, description="메뉴 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function destroy() {}
/**
* @OA\Post(
* path="/api/v1/admin/global-menus/reorder",
* summary="글로벌 메뉴 순서 변경",
* description="글로벌 메뉴의 정렬 순서를 일괄 변경합니다.",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/GlobalMenuReorderRequest")),
*
* @OA\Response(response=200, description="글로벌 메뉴 순서 변경 성공",
*
* @OA\JsonContent(
*
* @OA\Property(property="success", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="글로벌 메뉴 순서 변경")
* )
* ),
*
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function reorder() {}
/**
* @OA\Post(
* path="/api/v1/admin/global-menus/{id}/sync-to-tenants",
* summary="특정 글로벌 메뉴를 모든 테넌트에 동기화",
* description="지정한 글로벌 메뉴를 모든 테넌트의 메뉴에 동기화합니다.",
* tags={"Admin.GlobalMenu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="글로벌 메뉴 ID", @OA\Schema(type="integer", example=1)),
*
* @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", type="object",
* @OA\Property(property="synced_count", type="integer", example=5),
* @OA\Property(property="created_count", type="integer", example=2),
* @OA\Property(property="updated_count", type="integer", example=3)
* )
* )
* ),
*
* @OA\Response(response=404, description="메뉴 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function syncToTenants() {}
}

View File

@@ -207,6 +207,63 @@ public function debugApiKey() {}
*/ */
public function login() {} public function login() {}
/**
* @OA\Post(
* path="/api/v1/token-login",
* tags={"Auth"},
* summary="토큰 로그인 (1회용 토큰으로 로그인)",
* description="MNG에서 발급된 1회용 로그인 토큰으로 인증합니다. 토큰은 사용 후 즉시 폐기됩니다.",
* security={{"ApiKeyAuth": {}}},
*
* @OA\RequestBody(
* required=true,
*
* @OA\JsonContent(
* required={"token"},
*
* @OA\Property(property="token", type="string", example="abc123xyz456", description="1회용 로그인 토큰")
* )
* ),
*
* @OA\Response(
* response=200,
* description="로그인 성공",
*
* @OA\JsonContent(
* type="object",
*
* @OA\Property(property="message", type="string", example="로그인 성공"),
* @OA\Property(property="access_token", type="string", example="1|abc123xyz456"),
* @OA\Property(property="refresh_token", type="string", example="2|def456uvw789"),
* @OA\Property(property="token_type", type="string", example="Bearer"),
* @OA\Property(property="expires_in", type="integer", nullable=true, example=7200),
* @OA\Property(property="expires_at", type="string", nullable=true, example="2025-11-10 16:00:00"),
* @OA\Property(property="user", type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="user_id", type="string", example="hamss"),
* @OA\Property(property="name", type="string", example="홍길동"),
* @OA\Property(property="email", type="string", example="hamss@example.com"),
* @OA\Property(property="phone", type="string", nullable=true, example="010-1234-5678")
* ),
* @OA\Property(property="tenant", type="object", nullable=true,
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="company_name", type="string", example="주식회사 코드브리지")
* ),
* @OA\Property(property="menus", type="array", @OA\Items(type="object")),
* @OA\Property(property="roles", type="array", @OA\Items(type="object"))
* )
* ),
*
* @OA\Response(response=400, description="토큰 누락", @OA\JsonContent(
* @OA\Property(property="error", type="string", example="토큰이 필요합니다.")
* )),
* @OA\Response(response=401, description="유효하지 않거나 만료된 토큰", @OA\JsonContent(
* @OA\Property(property="error", type="string", example="유효하지 않거나 만료된 토큰입니다.")
* ))
* )
*/
public function tokenLogin() {}
/** /**
* @OA\Post( * @OA\Post(
* path="/api/v1/logout", * path="/api/v1/logout",

View File

@@ -177,6 +177,41 @@ class DepartmentApi
*/ */
public function index() {} public function index() {}
/**
* @OA\Get(
* path="/api/v1/departments/tree",
* summary="부서 트리 조회",
* description="부서를 계층 구조(트리)로 조회합니다. with_users=1 시 각 부서의 소속 사용자도 포함됩니다.",
* tags={"Department"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="with_users", in="query", required=false, description="사용자 포함 여부", @OA\Schema(type="integer", enum={0,1}, example=0)),
*
* @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", type="array",
* @OA\Items(
* type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="본사"),
* @OA\Property(property="code", type="string", nullable=true, example="HQ"),
* @OA\Property(property="parent_id", type="integer", nullable=true, example=null),
* @OA\Property(property="sort_order", type="integer", example=1),
* @OA\Property(property="is_active", type="integer", example=1),
* @OA\Property(property="children", type="array", @OA\Items(ref="#/components/schemas/DepartmentBrief")),
* @OA\Property(property="users", type="array", nullable=true, @OA\Items(ref="#/components/schemas/UserBrief"))
* )
* )
* )
* )
* )
*/
public function tree() {}
/** /**
* @OA\Get( * @OA\Get(
* path="/api/v1/departments/{id}", * path="/api/v1/departments/{id}",

View File

@@ -265,4 +265,229 @@ public function reorder() {}
* ) * )
*/ */
public function toggle() {} public function toggle() {}
/**
* @OA\Get(
* path="/api/v1/menus/trashed",
* summary="삭제된 메뉴 목록 조회",
* description="소프트 삭제된 메뉴 목록을 조회합니다.",
* tags={"Menu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @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", type="array", @OA\Items(ref="#/components/schemas/Menu"))
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function trashed() {}
/**
* @OA\Post(
* path="/api/v1/menus/{id}/restore",
* summary="삭제된 메뉴 복원",
* description="소프트 삭제된 메뉴를 복원합니다.",
* tags={"Menu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="복원할 메뉴 ID", @OA\Schema(type="integer", example=12)),
*
* @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/Menu")
* )
* ),
*
* @OA\Response(response=404, description="메뉴 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function restore() {}
/**
* @OA\Get(
* path="/api/v1/menus/available-global",
* summary="복제 가능한 글로벌 메뉴 목록",
* description="테넌트에서 복제(동기화)할 수 있는 글로벌 메뉴 목록을 조회합니다.",
* tags={"Menu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @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", type="array",
* @OA\Items(type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="대시보드"),
* @OA\Property(property="url", type="string", nullable=true, example="/dashboard"),
* @OA\Property(property="icon", type="string", nullable=true, example="dashboard"),
* @OA\Property(property="is_synced", type="boolean", example=false, description="이미 동기화된 메뉴 여부"),
* @OA\Property(property="has_updates", type="boolean", example=false, description="업데이트 필요 여부")
* )
* )
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function availableGlobal() {}
/**
* @OA\Get(
* path="/api/v1/menus/sync-status",
* summary="동기화 상태 조회",
* description="테넌트 메뉴와 글로벌 메뉴 간 동기화 상태를 조회합니다.",
* tags={"Menu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="status", in="query", description="상태 필터 (new|synced|modified|outdated)", @OA\Schema(type="string", example="outdated")),
*
* @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", type="object",
* @OA\Property(property="summary", type="object",
* @OA\Property(property="total", type="integer", example=25),
* @OA\Property(property="synced", type="integer", example=20),
* @OA\Property(property="new", type="integer", example=3),
* @OA\Property(property="outdated", type="integer", example=2)
* ),
* @OA\Property(property="items", type="array",
* @OA\Items(type="object",
* @OA\Property(property="global_menu_id", type="integer", example=1),
* @OA\Property(property="tenant_menu_id", type="integer", nullable=true, example=5),
* @OA\Property(property="name", type="string", example="대시보드"),
* @OA\Property(property="status", type="string", example="synced", description="new|synced|modified|outdated"),
* @OA\Property(property="last_synced_at", type="string", format="date-time", nullable=true)
* )
* )
* )
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function syncStatus() {}
/**
* @OA\Post(
* path="/api/v1/menus/sync",
* summary="메뉴 선택 동기화",
* description="선택한 글로벌 메뉴를 테넌트에 동기화합니다. 신규 생성 또는 기존 메뉴 업데이트.",
* tags={"Menu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\RequestBody(required=true, @OA\JsonContent(type="object",
*
* @OA\Property(property="menu_ids", type="array", @OA\Items(type="integer"), example={1, 2, 3}, description="동기화할 글로벌 메뉴 ID 목록"),
* @OA\Property(property="force", type="boolean", example=false, description="강제 덮어쓰기 여부 (커스텀 변경사항 무시)")
* )),
*
* @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", type="object",
* @OA\Property(property="created", type="integer", example=2),
* @OA\Property(property="updated", type="integer", example=1),
* @OA\Property(property="skipped", type="integer", example=0),
* @OA\Property(property="details", type="array", @OA\Items(type="object",
* @OA\Property(property="menu_id", type="integer"),
* @OA\Property(property="action", type="string", example="created"),
* @OA\Property(property="name", type="string")
* ))
* )
* )
* ),
*
* @OA\Response(response=400, description="파라미터 오류", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function sync() {}
/**
* @OA\Post(
* path="/api/v1/menus/sync-new",
* summary="신규 글로벌 메뉴 일괄 가져오기",
* description="아직 동기화되지 않은 신규 글로벌 메뉴를 일괄 가져옵니다.",
* tags={"Menu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @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", type="object",
* @OA\Property(property="imported", type="integer", example=5),
* @OA\Property(property="menus", type="array", @OA\Items(ref="#/components/schemas/MenuBrief"))
* )
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function syncNew() {}
/**
* @OA\Post(
* path="/api/v1/menus/sync-updates",
* summary="변경된 메뉴 일괄 업데이트",
* description="글로벌 메뉴에서 변경된 내용을 테넌트 메뉴에 일괄 반영합니다. 커스텀 수정된 메뉴는 제외됩니다.",
* tags={"Menu"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @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", type="object",
* @OA\Property(property="updated", type="integer", example=3),
* @OA\Property(property="skipped", type="integer", example=2, description="커스텀 수정으로 스킵된 메뉴 수"),
* @OA\Property(property="details", type="array", @OA\Items(type="object",
* @OA\Property(property="menu_id", type="integer"),
* @OA\Property(property="name", type="string"),
* @OA\Property(property="action", type="string", example="updated|skipped")
* ))
* )
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function syncUpdates() {}
} }

View File

@@ -0,0 +1,481 @@
<?php
namespace App\Swagger\v1;
/**
* @OA\Tag(
* name="ModelSet",
* description="모델셋 관리 (견적 카테고리 기반)"
* )
*/
/**
* =========================
* Domain 스키마
* =========================
*
* @OA\Schema(
* schema="ModelSet",
* type="object",
* description="모델셋 (견적 카테고리)",
* required={"id","code","name"},
*
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="parent_id", type="integer", nullable=true, example=null),
* @OA\Property(property="code_group", type="string", example="estimate"),
* @OA\Property(property="code", type="string", example="screen_product"),
* @OA\Property(property="name", type="string", example="스크린 제품"),
* @OA\Property(property="description", type="string", nullable=true, example="스크린 제품군 모델셋"),
* @OA\Property(property="level", type="integer", example=2),
* @OA\Property(property="sort_order", type="integer", example=1),
* @OA\Property(property="profile_code", type="string", example="custom_category"),
* @OA\Property(property="is_active", type="boolean", example=true),
* @OA\Property(property="fields", type="array", @OA\Items(ref="#/components/schemas/ModelSetField")),
* @OA\Property(property="children", type="array", @OA\Items(ref="#/components/schemas/ModelSet")),
* @OA\Property(property="created_at", type="string", format="date-time", example="2025-01-01 10:00:00"),
* @OA\Property(property="updated_at", type="string", format="date-time", example="2025-01-01 10:00:00")
* )
*
* @OA\Schema(
* schema="ModelSetField",
* type="object",
* description="모델셋 필드 정의",
*
* @OA\Property(property="key", type="string", example="open_width"),
* @OA\Property(property="name", type="string", example="열림폭"),
* @OA\Property(property="type", type="string", example="number"),
* @OA\Property(property="required", type="boolean", example=true),
* @OA\Property(property="order", type="integer", example=1),
* @OA\Property(property="default", type="string", nullable=true, example="1000"),
* @OA\Property(property="options", type="object", nullable=true, example=null),
* @OA\Property(property="description", type="string", nullable=true, example="제품 열림폭 (mm)")
* )
*
* @OA\Schema(
* schema="ModelSetDetail",
* type="object",
* description="모델셋 상세 정보",
*
* @OA\Property(property="category", ref="#/components/schemas/ModelSet"),
* @OA\Property(property="products", type="array", @OA\Items(type="object")),
* @OA\Property(property="models", type="array", @OA\Items(type="object")),
* @OA\Property(property="field_schema", type="array", @OA\Items(ref="#/components/schemas/ModelSetField"))
* )
*
* @OA\Schema(
* schema="ModelSetCreateRequest",
* type="object",
* required={"code","name"},
*
* @OA\Property(property="parent_id", type="integer", nullable=true, example=null),
* @OA\Property(property="code", type="string", example="new_product"),
* @OA\Property(property="name", type="string", example="신규 제품군"),
* @OA\Property(property="description", type="string", nullable=true, example="신규 제품군 설명"),
* @OA\Property(property="level", type="integer", example=2),
* @OA\Property(property="sort_order", type="integer", example=10),
* @OA\Property(property="profile_code", type="string", example="custom_category"),
* @OA\Property(property="is_active", type="boolean", example=true),
* @OA\Property(property="fields", type="array",
* @OA\Items(
* type="object",
* @OA\Property(property="key", type="string", example="width"),
* @OA\Property(property="name", type="string", example="폭"),
* @OA\Property(property="type", type="string", example="number"),
* @OA\Property(property="required", type="boolean", example=true),
* @OA\Property(property="order", type="integer", example=1),
* @OA\Property(property="default", type="string", nullable=true),
* @OA\Property(property="options", type="object", nullable=true),
* @OA\Property(property="description", type="string", nullable=true)
* )
* ),
* @OA\Property(property="create_model", type="boolean", example=false, description="기본 모델 및 BOM 템플릿 생성 여부"),
* @OA\Property(property="model_data", type="object", nullable=true,
* @OA\Property(property="code", type="string", example="NEW_MODEL"),
* @OA\Property(property="name", type="string", example="신규 모델"),
* @OA\Property(property="description", type="string", nullable=true)
* )
* )
*
* @OA\Schema(
* schema="ModelSetUpdateRequest",
* type="object",
*
* @OA\Property(property="name", type="string", example="수정된 제품군"),
* @OA\Property(property="description", type="string", nullable=true, example="수정된 설명"),
* @OA\Property(property="sort_order", type="integer", example=5),
* @OA\Property(property="is_active", type="boolean", example=true),
* @OA\Property(property="fields", type="array",
* @OA\Items(
* type="object",
* @OA\Property(property="key", type="string"),
* @OA\Property(property="name", type="string"),
* @OA\Property(property="type", type="string"),
* @OA\Property(property="required", type="boolean"),
* @OA\Property(property="order", type="integer"),
* @OA\Property(property="default", type="string", nullable=true),
* @OA\Property(property="options", type="object", nullable=true),
* @OA\Property(property="description", type="string", nullable=true)
* )
* )
* )
*
* @OA\Schema(
* schema="ModelSetCloneRequest",
* type="object",
* required={"code","name"},
*
* @OA\Property(property="code", type="string", example="cloned_product"),
* @OA\Property(property="name", type="string", example="복제된 제품군"),
* @OA\Property(property="description", type="string", nullable=true, example="복제된 설명"),
* @OA\Property(property="sort_order", type="integer", example=999),
* @OA\Property(property="is_active", type="boolean", example=true)
* )
*
* @OA\Schema(
* schema="ModelSetEstimateParameters",
* type="object",
* description="견적 파라미터 정보",
*
* @OA\Property(property="category", type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="스크린 제품"),
* @OA\Property(property="code", type="string", example="screen_product")
* ),
* @OA\Property(property="input_fields", type="array",
* @OA\Items(ref="#/components/schemas/ModelSetField")
* ),
* @OA\Property(property="calculated_fields", type="array",
* @OA\Items(type="object",
* @OA\Property(property="key", type="string", example="make_width"),
* @OA\Property(property="name", type="string", example="제작폭"),
* @OA\Property(property="type", type="string", example="number"),
* @OA\Property(property="description", type="string", nullable=true)
* )
* ),
* @OA\Property(property="calculation_schema", type="object", example={"size_calculation": "kyungdong_screen_size"})
* )
*
* @OA\Schema(
* schema="ModelSetBomCalculationRequest",
* type="object",
* description="BOM 계산 요청 파라미터",
*
* @OA\Property(property="open_width", type="number", example=1500, description="열림폭 (mm)"),
* @OA\Property(property="open_height", type="number", example=2000, description="열림높이 (mm)"),
* @OA\Property(property="quantity", type="integer", example=1, description="수량"),
* @OA\Property(property="model_name", type="string", nullable=true, example="스크린A"),
* @OA\Property(property="guide_rail_type", type="string", nullable=true, example="standard"),
* @OA\Property(property="shutter_box", type="string", nullable=true, example="type_a")
* )
*
* @OA\Schema(
* schema="ModelSetBomCalculationResult",
* type="object",
* description="BOM 계산 결과",
*
* @OA\Property(property="calculated_values", type="object",
* @OA\Property(property="make_width", type="number", example=1530),
* @OA\Property(property="make_height", type="number", example=2050),
* @OA\Property(property="calculated_area", type="number", example=3.14),
* @OA\Property(property="calculated_weight", type="number", example=45.5),
* @OA\Property(property="motor_capacity", type="string", example="0.5HP"),
* @OA\Property(property="motor_bracket_size", type="string", example="M-100")
* ),
* @OA\Property(property="bom_items", type="array",
* @OA\Items(type="object",
* @OA\Property(property="material_code", type="string", example="MAT001"),
* @OA\Property(property="material_name", type="string", example="알루미늄 프레임"),
* @OA\Property(property="quantity", type="number", example=2),
* @OA\Property(property="unit", type="string", example="EA"),
* @OA\Property(property="unit_price", type="number", example=15000),
* @OA\Property(property="total_price", type="number", example=30000)
* )
* ),
* @OA\Property(property="total_cost", type="number", example=500000)
* )
*/
class ModelSetApi
{
/**
* @OA\Get(
* path="/api/v1/model-sets",
* summary="모델셋 목록 조회",
* description="견적 카테고리 기반 모델셋 목록을 조회합니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="category_type", in="query", description="카테고리 유형", @OA\Schema(type="string", example="screen_product")),
* @OA\Parameter(name="is_active", in="query", description="활성화 여부", @OA\Schema(type="boolean", example=true)),
*
* @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", type="object",
* @OA\Property(property="model_sets", type="array", @OA\Items(ref="#/components/schemas/ModelSet"))
* )
* )
* )
* )
*/
public function index() {}
/**
* @OA\Get(
* path="/api/v1/model-sets/{id}",
* summary="모델셋 상세 조회",
* description="모델셋의 상세 정보(카테고리, 제품, 모델, 필드 스키마)를 조회합니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @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", type="object",
* @OA\Property(property="model_set", ref="#/components/schemas/ModelSetDetail")
* )
* )
* ),
*
* @OA\Response(response=404, description="모델셋 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function show() {}
/**
* @OA\Post(
* path="/api/v1/model-sets",
* summary="모델셋 생성",
* description="새로운 모델셋(견적 카테고리)을 생성합니다. 옵션으로 기본 모델 및 BOM 템플릿도 함께 생성할 수 있습니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ModelSetCreateRequest")),
*
* @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", type="object",
* @OA\Property(property="model_set", ref="#/components/schemas/ModelSetDetail")
* )
* )
* ),
*
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function store() {}
/**
* @OA\Put(
* path="/api/v1/model-sets/{id}",
* summary="모델셋 수정",
* description="모델셋 정보를 수정합니다. 필드 배열이 전달되면 기존 필드를 삭제하고 새로 생성합니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ModelSetUpdateRequest")),
*
* @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", type="object",
* @OA\Property(property="model_set", ref="#/components/schemas/ModelSetDetail")
* )
* )
* ),
*
* @OA\Response(response=404, description="모델셋 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function update() {}
/**
* @OA\Delete(
* path="/api/v1/model-sets/{id}",
* summary="모델셋 삭제",
* description="모델셋을 삭제합니다. 연관된 제품이나 하위 카테고리가 있으면 삭제할 수 없습니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @OA\Response(response=200, description="모델셋 삭제 성공",
*
* @OA\JsonContent(
*
* @OA\Property(property="success", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="데이터 삭제")
* )
* ),
*
* @OA\Response(response=404, description="모델셋 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=400, description="삭제 불가 (연관 데이터 존재)", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function destroy() {}
/**
* @OA\Post(
* path="/api/v1/model-sets/{id}/clone",
* summary="모델셋 복제",
* description="기존 모델셋을 복제하여 새로운 모델셋을 생성합니다. 필드 정의도 함께 복제됩니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="복제할 모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ModelSetCloneRequest")),
*
* @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", type="object",
* @OA\Property(property="model_set", ref="#/components/schemas/ModelSetDetail")
* )
* )
* ),
*
* @OA\Response(response=404, description="원본 모델셋 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function clone() {}
/**
* @OA\Get(
* path="/api/v1/model-sets/{id}/fields",
* summary="모델셋 필드 구조 조회",
* description="모델셋의 카테고리별 필드 구조(스키마)를 조회합니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @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", type="object",
* @OA\Property(property="category_fields", type="array", @OA\Items(ref="#/components/schemas/ModelSetField"))
* )
* )
* ),
*
* @OA\Response(response=404, description="모델셋 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function fields() {}
/**
* @OA\Get(
* path="/api/v1/model-sets/{id}/bom-templates",
* summary="모델셋 BOM 템플릿 목록",
* description="모델셋과 연관된 모델들의 BOM 템플릿 목록을 조회합니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @OA\Response(response=200, description="BOM 템플릿 목록 조회 성공",
*
* @OA\JsonContent(
*
* @OA\Property(property="success", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="데이터 조회"),
* @OA\Property(property="data", type="object",
* @OA\Property(property="bom_templates", type="array",
* @OA\Items(type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="model_version_id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="스크린 기본 BOM"),
* @OA\Property(property="company_type", type="string", example="경동기업"),
* @OA\Property(property="formula_version", type="string", example="v1.0"),
* @OA\Property(property="calculation_schema", type="object")
* )
* )
* )
* )
* ),
*
* @OA\Response(response=404, description="모델셋 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function bomTemplates() {}
/**
* @OA\Get(
* path="/api/v1/model-sets/{id}/estimate-parameters",
* summary="견적 파라미터 조회",
* description="모델셋의 견적 계산에 필요한 입력 파라미터와 계산 결과 필드를 조회합니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @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", type="object",
* @OA\Property(property="parameters", ref="#/components/schemas/ModelSetEstimateParameters")
* )
* )
* ),
*
* @OA\Response(response=404, description="모델셋 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function estimateParameters() {}
/**
* @OA\Post(
* path="/api/v1/model-sets/{id}/calculate-bom",
* summary="BOM 계산",
* description="입력 파라미터를 기반으로 BOM을 계산합니다. 크기 계산, 자재 수량 산출, 비용 계산이 수행됩니다.",
* tags={"ModelSet"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="모델셋(카테고리) ID", @OA\Schema(type="integer", example=1)),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ModelSetBomCalculationRequest")),
*
* @OA\Response(response=200, description="BOM 계산 성공",
*
* @OA\JsonContent(
*
* @OA\Property(property="success", type="boolean", example=true),
* @OA\Property(property="message", type="string", example="계산 완료"),
* @OA\Property(property="data", ref="#/components/schemas/ModelSetBomCalculationResult")
* )
* ),
*
* @OA\Response(response=404, description="모델셋 또는 BOM 템플릿 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=422, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function calculateBom() {}
}