prepare backend-only fastapi deployment
This commit is contained in:
+21
-1
@@ -9,7 +9,8 @@ router = APIRouter()
|
||||
|
||||
@router.get("/me", response_model=ApiResponse[AuthMeResponse])
|
||||
async def auth_me(ctx: UserContext = Depends(get_user_context)):
|
||||
"""当前用户:返回经 Django 用户中心或 Demo Header 标准化后的用户信息。"""
|
||||
"""当前用户:转发 Authorization 到 Django 用户中心,并返回标准化后的用户信息。"""
|
||||
profile = ctx.profile or {}
|
||||
return ok(
|
||||
AuthMeResponse(
|
||||
user_id=ctx.user_id,
|
||||
@@ -18,5 +19,24 @@ async def auth_me(ctx: UserContext = Depends(get_user_context)):
|
||||
display_name=ctx.display_name,
|
||||
tenant_id=ctx.tenant_id,
|
||||
role=ctx.role,
|
||||
phone=profile.get("phone"),
|
||||
avatar=profile.get("avatar"),
|
||||
gender=profile.get("gender"),
|
||||
institution=profile.get("institution"),
|
||||
institution_name=profile.get("institution_name"),
|
||||
department=profile.get("department"),
|
||||
department_name=profile.get("department_name"),
|
||||
title_name=profile.get("title_name"),
|
||||
major=profile.get("major"),
|
||||
training_stage=profile.get("training_stage"),
|
||||
learning_target=profile.get("learning_target"),
|
||||
competency_profile=profile.get("competency_profile"),
|
||||
weak_dimensions=profile.get("weak_dimensions"),
|
||||
strong_dimensions=profile.get("strong_dimensions"),
|
||||
ai_preference=profile.get("ai_preference"),
|
||||
total_training_count=profile.get("total_training_count"),
|
||||
total_case_count=profile.get("total_case_count"),
|
||||
current_level=profile.get("current_level"),
|
||||
status=profile.get("status"),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user