Files
sam-api/app/Swagger/v1/RegisterApi.php
hskwon 9092ce8f93 docs: Swagger 문서 Phase 1 개선
- SAMInfo.php Auth 태그 상세화
  - 인증 흐름 설명 추가 (API Key + Bearer Token)
  - 사용 예시 코드 추가
  - IP 기반 접근 제어 안내 추가

- RegisterApi.php 보안 어노테이션 추가
  - security={"ApiKeyAuth": {}} 설정
  - "Authentication: Not Required" 오류 해결

- SWAGGER_AUDIT.md 작업 추적 문서 생성
  - Phase별 점검 계획 수립
  - 표준 체크리스트 정의
  - 진행 상황 추적 체계 구축
2025-11-06 20:54:23 +09:00

121 lines
5.9 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\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 {}