fix:文明
This commit is contained in:
6
server/app/api/__init__.py
Normal file
6
server/app/api/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
"""
|
||||
API 路由入口
|
||||
|
||||
说明:按 FastAPI 常见工程结构拆分 api/v1/* 路由模块。
|
||||
"""
|
||||
|
||||
4
server/app/api/v1/__init__.py
Normal file
4
server/app/api/v1/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
"""
|
||||
V1 API 路由集合
|
||||
"""
|
||||
|
||||
26
server/app/api/v1/user_profile_scoring.py
Normal file
26
server/app/api/v1/user_profile_scoring.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.features.user_profile_scoring.scoring import build_user_profile_from_questionnaire
|
||||
from app.features.user_profile_scoring.types import BuildUserProfileRequest, UserProfileV1_2_Extended
|
||||
|
||||
router = APIRouter(prefix="/v1/user-profile", tags=["user-profile"])
|
||||
|
||||
|
||||
@router.post("/score", response_model=UserProfileV1_2_Extended)
|
||||
async def score_user_profile(req: BuildUserProfileRequest) -> UserProfileV1_2_Extended:
|
||||
"""
|
||||
根据问卷答案生成用户画像(V1.2)
|
||||
|
||||
说明:
|
||||
- 问卷题目允许跳过
|
||||
- 允许注入 generated_at/now,用于回归测试或离线批处理
|
||||
"""
|
||||
|
||||
return build_user_profile_from_questionnaire(
|
||||
req.answers,
|
||||
generated_at=req.generated_at,
|
||||
now=req.now,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user