Files
sam-api/app/Swagger/v1/SystemBoardApi.php
kent ab77bab510 feat: 시스템 게시판 API 추가 (/api/v1/system-boards)
- SystemBoardController: 시스템 게시판 목록/상세/필드 조회
- SystemPostController: 시스템 게시글 CRUD + 댓글 CRUD
- BoardService: getSystemBoardByCode(), getTenantBoardByCode() 추가
- PostService: 시스템/테넌트 게시판 전용 메서드 추가
- routes/api.php: /system-boards/* 엔드포인트 12개 추가
- SystemBoardApi.php: Swagger 문서

시스템 게시판 (is_system=true, tenant_id=null)과
테넌트 게시판 (is_system=false, tenant_id={current})의
board_code 중복 가능성으로 인해 별도 엔드포인트로 분리

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-28 00:53:26 +09:00

291 lines
12 KiB
PHP

<?php
namespace App\Swagger\v1;
/**
* @OA\Tag(name="SystemBoard", description="시스템 게시판 관리 (is_system=true, tenant_id=null)")
*/
class SystemBoardApi
{
/**
* @OA\Get(
* path="/api/v1/system-boards",
* tags={"SystemBoard"},
* summary="시스템 게시판 목록 조회",
* description="본사에서 생성한 시스템 게시판 목록을 조회합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="board_type", in="query", description="게시판 유형 필터", @OA\Schema(type="string")),
* @OA\Parameter(name="search", in="query", description="게시판명 검색", @OA\Schema(type="string")),
*
* @OA\Response(response=200, description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/Board")))
* })
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function index() {}
/**
* @OA\Get(
* path="/api/v1/system-boards/{code}",
* tags={"SystemBoard"},
* summary="시스템 게시판 상세 조회",
* description="시스템 게시판 코드로 상세 정보를 조회합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, description="시스템 게시판 코드", @OA\Schema(type="string")),
*
* @OA\Response(response=200, description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Board"))
* })
* ),
*
* @OA\Response(response=404, description="게시판 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function show() {}
/**
* @OA\Get(
* path="/api/v1/system-boards/{code}/fields",
* tags={"SystemBoard"},
* summary="시스템 게시판 커스텀 필드 목록",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, description="시스템 게시판 코드", @OA\Schema(type="string")),
*
* @OA\Response(response=200, description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/BoardField")))
* })
* ),
*
* @OA\Response(response=404, description="게시판 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function fields() {}
/**
* @OA\Get(
* path="/api/v1/system-boards/{code}/posts",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 목록 조회",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, description="시스템 게시판 코드", @OA\Schema(type="string")),
* @OA\Parameter(name="search", in="query", description="제목/내용 검색", @OA\Schema(type="string")),
* @OA\Parameter(name="is_notice", in="query", description="공지사항 필터", @OA\Schema(type="boolean")),
* @OA\Parameter(name="status", in="query", description="상태 필터", @OA\Schema(type="string")),
* @OA\Parameter(name="per_page", in="query", description="페이지당 개수", @OA\Schema(type="integer", default=15)),
*
* @OA\Response(response=200, description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/PostPagination"))
* })
* ),
*
* @OA\Response(response=404, description="게시판 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function postsIndex() {}
/**
* @OA\Get(
* path="/api/v1/system-boards/{code}/posts/{id}",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 상세 조회",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, description="시스템 게시판 코드", @OA\Schema(type="string")),
* @OA\Parameter(name="id", in="path", required=true, description="게시글 ID", @OA\Schema(type="integer")),
*
* @OA\Response(response=200, description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Post"))
* })
* ),
*
* @OA\Response(response=404, description="게시글 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function postsShow() {}
/**
* @OA\Post(
* path="/api/v1/system-boards/{code}/posts",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 작성",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, description="시스템 게시판 코드", @OA\Schema(type="string")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/PostCreateRequest")),
*
* @OA\Response(response=200, description="작성 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Post"))
* })
* ),
*
* @OA\Response(response=400, description="검증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=404, description="게시판 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function postsStore() {}
/**
* @OA\Put(
* path="/api/v1/system-boards/{code}/posts/{id}",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 수정",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, description="시스템 게시판 코드", @OA\Schema(type="string")),
* @OA\Parameter(name="id", in="path", required=true, description="게시글 ID", @OA\Schema(type="integer")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/PostUpdateRequest")),
*
* @OA\Response(response=200, description="수정 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Post"))
* })
* ),
*
* @OA\Response(response=404, description="게시글 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function postsUpdate() {}
/**
* @OA\Delete(
* path="/api/v1/system-boards/{code}/posts/{id}",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 삭제",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, description="시스템 게시판 코드", @OA\Schema(type="string")),
* @OA\Parameter(name="id", in="path", required=true, description="게시글 ID", @OA\Schema(type="integer")),
*
* @OA\Response(response=200, description="삭제 성공", @OA\JsonContent(ref="#/components/schemas/ApiResponse")),
* @OA\Response(response=404, description="게시글 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function postsDestroy() {}
/**
* @OA\Get(
* path="/api/v1/system-boards/{code}/posts/{postId}/comments",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 댓글 목록",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, @OA\Schema(type="string")),
* @OA\Parameter(name="postId", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(response=200, description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/Comment")))
* })
* )
* )
*/
public function commentsIndex() {}
/**
* @OA\Post(
* path="/api/v1/system-boards/{code}/posts/{postId}/comments",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 댓글 작성",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, @OA\Schema(type="string")),
* @OA\Parameter(name="postId", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/CommentCreateRequest")),
*
* @OA\Response(response=200, description="작성 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Comment"))
* })
* )
* )
*/
public function commentsStore() {}
/**
* @OA\Put(
* path="/api/v1/system-boards/{code}/posts/{postId}/comments/{commentId}",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 댓글 수정",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, @OA\Schema(type="string")),
* @OA\Parameter(name="postId", in="path", required=true, @OA\Schema(type="integer")),
* @OA\Parameter(name="commentId", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/CommentCreateRequest")),
*
* @OA\Response(response=200, description="수정 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Comment"))
* })
* ),
*
* @OA\Response(response=404, description="댓글 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function commentsUpdate() {}
/**
* @OA\Delete(
* path="/api/v1/system-boards/{code}/posts/{postId}/comments/{commentId}",
* tags={"SystemBoard"},
* summary="시스템 게시판 게시글 댓글 삭제",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="code", in="path", required=true, @OA\Schema(type="string")),
* @OA\Parameter(name="postId", in="path", required=true, @OA\Schema(type="integer")),
* @OA\Parameter(name="commentId", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(response=200, description="삭제 성공", @OA\JsonContent(ref="#/components/schemas/ApiResponse")),
* @OA\Response(response=404, description="댓글 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function commentsDestroy() {}
}