- 사용자 초대 API: role 문자열 지원 추가 (React 호환) - 알림 설정 API: 그룹 기반 계층 구조 구현 - notification_setting_groups 테이블 추가 - notification_setting_group_items 테이블 추가 - notification_setting_group_states 테이블 추가 - GET/PUT /api/v1/settings/notifications 엔드포인트 추가 - Pint 코드 스타일 정리
321 lines
12 KiB
PHP
321 lines
12 KiB
PHP
<?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() {}
|
|
}
|