fix: 将52号接口范围限定为GPU worker

撤回52号网关路由、图片字段改名和mock改动,gateway目录恢复a3fddbb。worker保持base64和null响应,更新接口说明和回归测试。

验证:worker API、IP限制与网关兼容性共54项测试通过。
This commit is contained in:
xsl
2026-11-04 10:45:16 +08:00
parent 5b2b73f5d5
commit 1c51f3eaab
11 changed files with 58 additions and 92 deletions
-10
View File
@@ -7,7 +7,6 @@
- POST /api/v1/hair/grow-b → mock 响应
- POST /api/v1/face/features → mock 响应
- POST /api/v1/hairline/generate → mock 响应
- POST /api/v1/hairline/generate-52 → 新规则 mock 响应
鉴权:校验 X-Internal-Token 头,不匹配返回 401。
并发模拟:可通过 ?delay=N 让接口 sleep N 秒(默认 1)。
@@ -214,7 +213,6 @@ def create_app(port: int, password: str) -> FastAPI:
# --- 接口5 ---
@app.post("/api/v1/hairline/generate")
@app.post("/api/v1/hairline/generate-52")
async def hairline_generate(
request: Request,
x_internal_token: Optional[str] = Header(default=None),
@@ -247,14 +245,6 @@ def create_app(port: int, password: str) -> FastAPI:
],
"best_hairline_center_point": {"x": 540, "y": 430},
}
if request.url.path.endswith("generate-52"):
for item in data["hairline_images"]:
item["image_high_base64"] = None
item["image_low_base64"] = None
data.update(high_hairline_center_point=None, low_hairline_center_point=None,
face_measure=None, framing=None, height_rule=None,
guide_landmarks={}, input_image_base64=_png, original_image_base64=_png,
coordinate_space="original_image", width=1, height=1)
return mock_ok(data, delay=delay)
return app