feat(接口6): 复刻接口1,新增 /api/v1/face/measure-v2
- 抽取 _face_measure_impl() 共用实现,接口1/6 零逻辑差异 - 接口6 路径 POST /api/v1/face/measure-v2 - 入参/出参与接口1 完全一致 - 文档同步更新(接口文档、实现说明、网关待改动) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -109,6 +109,30 @@ async def hair_grow_v2(request: Request):
|
||||
|
||||
若想让网关 `/docs` 展示准确,在 `gateway/app.py` 新增 `_GROW_V2_FORMS`(或复用 `_GROW_FORMS` 并补充 `gender`/`hair_style` 字段),然后将路由函数签名改为显式声明 Form 参数(参考接口 4 的写法)。不改也不影响实际转发。
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 6. 🔲【新增】接口6 四庭七眼测量 v2(`/api/v1/face/measure-v2`)
|
||||
|
||||
**背景**:worker 侧已新增接口 6,功能与接口 1 完全一致(复刻),共用同一实现。
|
||||
|
||||
**网关需新增一个路由**:
|
||||
|
||||
```python
|
||||
# gateway/app.py
|
||||
|
||||
@app.post("/api/v1/face/measure-v2", tags=["人脸分析"])
|
||||
async def face_measure_v2(request: Request):
|
||||
"""接口6:四庭七眼测量 v2(复刻接口1)"""
|
||||
return await _proxy(request, "/api/v1/face/measure-v2")
|
||||
```
|
||||
|
||||
**无需额外改动**:
|
||||
- 入参:与接口 1 完全相同(image_file/url/base64 三选一)
|
||||
- 出参:`annotated_image_base64` → 经现有 `rewrite_base64_to_url` 自动改写为 `annotated_image_url`
|
||||
- worker 侧与接口 1 共用 `_face_measure_impl()`,逻辑零差异
|
||||
|
||||
---
|
||||
|
||||
## 已经做好、无需再动的
|
||||
|
||||
Reference in New Issue
Block a user