2025-08-01 23:36:47 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Swagger\v1;
|
|
|
|
|
|
2025-12-21 03:56:48 +09:00
|
|
|
/**
|
|
|
|
|
* @OA\Tag(
|
|
|
|
|
* name="Settings - Common Codes",
|
|
|
|
|
* description="공통 코드 관리 API"
|
|
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="CommonCode",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Property(property="id", type="integer"),
|
|
|
|
|
* @OA\Property(property="code_group", type="string", example="product_type"),
|
|
|
|
|
* @OA\Property(property="code", type="string", example="PRODUCT"),
|
|
|
|
|
* @OA\Property(property="name", type="string", example="제품"),
|
|
|
|
|
* @OA\Property(property="description", type="string", example="완제품"),
|
|
|
|
|
* @OA\Property(property="is_active", type="boolean", example=true)
|
|
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="CommonCodeCreateRequest",
|
|
|
|
|
* required={"code_group", "code", "name"},
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Property(property="code_group", type="string", example="product_type"),
|
|
|
|
|
* @OA\Property(property="code", type="string", example="SERVICE"),
|
|
|
|
|
* @OA\Property(property="name", type="string", example="서비스"),
|
|
|
|
|
* @OA\Property(property="description", type="string", example="서비스 상품")
|
|
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="CommonCodeUpdateRequest",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Property(property="name", type="string", example="수정된 이름"),
|
|
|
|
|
* @OA\Property(property="description", type="string", example="수정된 설명")
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
class CommonApi
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/api/v1/settings/common/code",
|
|
|
|
|
* summary="공통 코드 조회",
|
|
|
|
|
* description="테넌트의 활성화된 공통 코드 목록을 조회합니다.",
|
|
|
|
|
* tags={"Settings - Common Codes"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}}},
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="공통 코드 조회 성공",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(
|
|
|
|
|
* type="object",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="공통코드"),
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="data",
|
|
|
|
|
* type="array",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Items(ref="#/components/schemas/CommonCode")
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function getComeCode() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/api/v1/settings/common",
|
|
|
|
|
* summary="공통 코드 목록 조회",
|
|
|
|
|
* description="전체 공통 코드 목록을 조회합니다.",
|
|
|
|
|
* tags={"Settings - Common Codes"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="공통 코드 목록 조회 성공"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function list() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/api/v1/settings/common/{group}",
|
|
|
|
|
* summary="특정 그룹 공통 코드 조회",
|
|
|
|
|
* description="특정 그룹의 공통 코드 목록을 조회합니다.",
|
|
|
|
|
* tags={"Settings - Common Codes"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Parameter(
|
|
|
|
|
* name="group",
|
|
|
|
|
* in="path",
|
|
|
|
|
* required=true,
|
|
|
|
|
* description="코드 그룹",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Schema(type="string", example="product_type")
|
|
|
|
|
* ),
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="그룹 코드 조회 성공"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function index() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Post(
|
|
|
|
|
* path="/api/v1/settings/common",
|
|
|
|
|
* summary="공통 코드 생성",
|
|
|
|
|
* description="새로운 공통 코드를 생성합니다.",
|
|
|
|
|
* tags={"Settings - Common Codes"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\RequestBody(
|
|
|
|
|
* required=true,
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(ref="#/components/schemas/CommonCodeCreateRequest")
|
|
|
|
|
* ),
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=201,
|
|
|
|
|
* description="공통 코드 생성 성공"
|
|
|
|
|
* ),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=409,
|
|
|
|
|
* description="중복된 공통 코드",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(
|
|
|
|
|
* type="object",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=false),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="중복된 공통 코드가 존재합니다.")
|
|
|
|
|
* )
|
|
|
|
|
* ),
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=422,
|
|
|
|
|
* description="유효성 검사 실패",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(ref="#/components/schemas/ErrorResponse")
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function store() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Patch(
|
|
|
|
|
* path="/api/v1/settings/common/{id}",
|
|
|
|
|
* summary="공통 코드 수정",
|
|
|
|
|
* description="기존 공통 코드를 수정합니다.",
|
|
|
|
|
* tags={"Settings - Common Codes"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Parameter(
|
|
|
|
|
* name="id",
|
|
|
|
|
* in="path",
|
|
|
|
|
* required=true,
|
|
|
|
|
* description="공통 코드 ID",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Schema(type="integer", example=1)
|
|
|
|
|
* ),
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\RequestBody(
|
|
|
|
|
* required=true,
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(ref="#/components/schemas/CommonCodeUpdateRequest")
|
|
|
|
|
* ),
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="공통 코드 수정 성공"
|
|
|
|
|
* ),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=404,
|
|
|
|
|
* description="공통 코드를 찾을 수 없음",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(
|
|
|
|
|
* type="object",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=false),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="해당 공통 코드를 찾을 수 없습니다.")
|
|
|
|
|
* )
|
|
|
|
|
* ),
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=422,
|
|
|
|
|
* description="유효성 검사 실패",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(ref="#/components/schemas/ErrorResponse")
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function update() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Delete(
|
|
|
|
|
* path="/api/v1/settings/common/{id}",
|
|
|
|
|
* summary="공통 코드 삭제",
|
|
|
|
|
* description="공통 코드를 삭제합니다.",
|
|
|
|
|
* tags={"Settings - Common Codes"},
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Parameter(
|
|
|
|
|
* name="id",
|
|
|
|
|
* in="path",
|
|
|
|
|
* required=true,
|
|
|
|
|
* description="공통 코드 ID",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Schema(type="integer", example=1)
|
|
|
|
|
* ),
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="공통 코드 삭제 성공"
|
|
|
|
|
* ),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=404,
|
|
|
|
|
* description="공통 코드를 찾을 수 없음",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\JsonContent(
|
|
|
|
|
* type="object",
|
2025-12-22 17:42:59 +09:00
|
|
|
*
|
2025-12-21 03:56:48 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=false),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="해당 공통 코드를 찾을 수 없습니다.")
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function destroy() {}
|
2025-12-22 17:42:59 +09:00
|
|
|
}
|