Files
sam-api/app/Swagger/v1/RegisterApi.php
hskwon bf905f3a5d fix: 회원가입 API 응답 구조 개선
- RegisterService: roles 응답에서 permissions 배열 제거
- menus 배열로 접근 가능한 메뉴 확인 가능하므로 중복 제거
- Swagger 문서 업데이트 (permissions 스키마 제거)
2025-11-11 10:22:40 +09:00

152 lines
8.0 KiB
PHP

<?php
namespace App\Swagger\v1;
/**
* @OA\Post(
* path="/api/v1/register",
* tags={"Auth"},
* summary="회원가입 및 테넌트 생성",
* description="신규 회원가입과 동시에 새로운 테넌트(회사)를 생성합니다. 사용자는 자동으로 system_manager 역할이 부여되며 모든 테넌트 메뉴 권한을 갖습니다.",
* operationId="register",
* security={{"ApiKeyAuth": {}}},
*
* @OA\RequestBody(
* required=true,
* description="회원가입 정보",
*
* @OA\JsonContent(
* required={"user_id", "name", "email", "password", "password_confirmation", "company_name", "business_num"},
*
* @OA\Property(property="user_id", type="string", example="john_doe", description="사용자 아이디 (영문, 숫자, _, - 만 허용)"),
* @OA\Property(property="name", type="string", example="홍길동", description="사용자 이름"),
* @OA\Property(property="email", type="string", format="email", example="john@example.com", description="이메일 주소"),
* @OA\Property(property="phone", type="string", example="010-1234-5678", description="전화번호 (선택)", nullable=true),
* @OA\Property(property="password", type="string", format="password", example="password123!", description="비밀번호 (최소 8자)"),
* @OA\Property(property="password_confirmation", type="string", format="password", example="password123!", description="비밀번호 확인"),
* @OA\Property(property="position", type="string", example="개발팀장", description="직책 (선택)", nullable=true),
* @OA\Property(property="company_name", type="string", example="(주)테크컴퍼니", description="회사명"),
* @OA\Property(property="business_num", type="string", example="123-45-67890", description="사업자등록번호 (000-00-00000 형식)"),
* @OA\Property(property="company_scale", type="string", example="중소기업", description="회사 규모 (선택)", nullable=true),
* @OA\Property(property="industry", type="string", example="IT/소프트웨어", description="업종 (선택)", nullable=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="user",
* type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="user_id", type="string", example="john_doe"),
* @OA\Property(property="name", type="string", example="홍길동"),
* @OA\Property(property="email", type="string", example="john@example.com"),
* @OA\Property(property="phone", type="string", example="010-1234-5678", nullable=true),
* @OA\Property(
* property="options",
* type="object",
* @OA\Property(property="position", type="string", example="개발팀장"),
* nullable=true
* )
* ),
* @OA\Property(
* property="tenant",
* type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="company_name", type="string", example="(주)테크컴퍼니"),
* @OA\Property(property="business_num", type="string", example="123-45-67890"),
* @OA\Property(property="tenant_st_code", type="string", example="trial", description="테넌트 상태 (trial: 데모, active: 정식, none: 비활성)"),
* @OA\Property(
* property="options",
* type="object",
* @OA\Property(property="company_scale", type="string", example="중소기업"),
* @OA\Property(property="industry", type="string", example="IT/소프트웨어"),
* nullable=true
* )
* ),
* @OA\Property(
* property="menus",
* type="array",
* description="생성된 테넌트의 기본 메뉴 목록 (9개: 대시보드, 기초정보관리, 제품관리, 거래처관리, BOM관리, 시스템관리, 사용자관리, 권한관리, 부서관리)",
*
* @OA\Items(
* type="object",
*
* @OA\Property(property="id", type="integer", example=1, description="메뉴 ID"),
* @OA\Property(property="parent_id", type="integer", example=null, nullable=true, description="상위 메뉴 ID (최상위 메뉴는 null)"),
* @OA\Property(property="name", type="string", example="대시보드", description="메뉴명"),
* @OA\Property(property="url", type="string", example="/dashboard", description="메뉴 URL"),
* @OA\Property(property="icon", type="string", example="dashboard", description="메뉴 아이콘"),
* @OA\Property(property="sort_order", type="integer", example=1, description="정렬 순서"),
* @OA\Property(property="is_external", type="integer", example=0, description="외부 링크 여부 (0: 내부, 1: 외부)"),
* @OA\Property(property="external_url", type="string", example=null, nullable=true, description="외부 링크 URL")
* )
* ),
* @OA\Property(
* property="roles",
* type="array",
* description="생성된 역할 목록 (시스템 관리자 역할 1개)",
*
* @OA\Items(
* type="object",
*
* @OA\Property(property="id", type="integer", example=1, description="역할 ID"),
* @OA\Property(property="name", type="string", example="system_manager", description="역할명"),
* @OA\Property(property="description", type="string", example="시스템 관리자", description="역할 설명")
* )
* )
* )
* )
* ),
*
* @OA\Response(
* response=422,
* description="유효성 검증 실패",
*
* @OA\JsonContent(
*
* @OA\Property(property="success", type="boolean", example=false),
* @OA\Property(property="message", type="string", example="유효성 검증에 실패했습니다"),
* @OA\Property(
* property="errors",
* type="object",
* @OA\Property(
* property="user_id",
* type="array",
*
* @OA\Items(type="string", example="이미 사용 중인 아이디입니다")
* ),
*
* @OA\Property(
* property="business_num",
* type="array",
*
* @OA\Items(type="string", example="사업자등록번호 형식이 올바르지 않습니다 (000-00-00000)")
* )
* )
* )
* ),
*
* @OA\Response(
* response=500,
* description="서버 오류",
*
* @OA\JsonContent(
*
* @OA\Property(property="success", type="boolean", example=false),
* @OA\Property(property="message", type="string", example="회원가입 처리 중 오류가 발생했습니다")
* )
* )
* )
*/
class RegisterApi {}