fix: 회원가입 API 응답 구조 개선

- RegisterService: roles 응답에서 permissions 배열 제거
- menus 배열로 접근 가능한 메뉴 확인 가능하므로 중복 제거
- Swagger 문서 업데이트 (permissions 스키마 제거)
This commit is contained in:
2025-11-11 10:21:36 +09:00
parent c83e029448
commit bf905f3a5d
2 changed files with 22 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ class RegisterService
* 'company_scale' => string (optional),
* 'industry' => string (optional),
* ]
* @return array ['user' => array, 'tenant' => array]
* @return array ['user' => array, 'tenant' => array, 'menus' => array, 'roles' => array]
*/
public static function register(array $params): array
{
@@ -113,7 +113,7 @@ public static function register(array $params): array
->get(['id', 'parent_id', 'name', 'url', 'icon', 'sort_order', 'is_external', 'external_url'])
->toArray();
// 12. Return user, tenant, and menus data
// 12. Return user, tenant, menus, and roles data
return [
'user' => [
'id' => $user->id,
@@ -131,6 +131,13 @@ public static function register(array $params): array
'options' => $tenant->options,
],
'menus' => $menus,
'roles' => [
[
'id' => $role->id,
'name' => $role->name,
'description' => $role->description,
],
],
];
});
}

View File

@@ -90,6 +90,19 @@
* @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="역할 설명")
* )
* )
* )
* )