This commit is contained in:
zaiun xu
2026-04-13 17:13:02 +08:00
parent 6f006def64
commit c1aafc69bf
8 changed files with 580 additions and 66 deletions

View File

@@ -85,7 +85,10 @@ async def get_health_result(
settings: Settings = Depends(get_settings),
client_id: str = Depends(_resolve_client_id),
):
"""行为 / 健康结果:每次 GET 投递该客户端下一条未消费的 FishAction 快照(按 client_id 独立游标)。"""
"""行为 / 健康结果:每次 GET 投递该客户端下一条未消费的 FishAction 快照(按 client_id 独立游标)。
每个视频切片被视为独立的视频,会分别投递。
"""
h, has_new, _ = pop_next_health(settings, client_id)
if not has_new:
return JSONResponse(
@@ -125,9 +128,19 @@ async def get_health_result(
@router.get("/water/video/")
async def get_water_video(settings: Settings = Depends(get_settings)):
"""水上视频FishAction 输入 mp4 经 H.264 转码后托管在 /media/,返回 `video_path` 绝对 URL。"""
video_path = await get_water_video_public_url(settings)
async def get_water_video(
settings: Settings = Depends(get_settings),
client_id: str = Depends(_resolve_client_id),
):
"""水上视频FishAction 输入 mp4 经 H.264 转码后托管在 /media/,返回 `video_path` 绝对 URL。
如果视频较长超过15秒会自动切分为多个10秒的片段。
每个切片被视为独立的视频每次调用返回一个切片的URL按顺序轮流返回
对齐机制:使用 client_id 参数(请求头 X-Fish-Client-Id 或查询参数 client_id
确保与 /health/result/ 端点对齐返回同一切片。
"""
video_path = await get_water_video_public_url(settings, client_id)
return JSONResponse(
content={
"code": 200,