This commit is contained in:
zaiun xu
2026-04-13 14:50:44 +08:00
parent 5a0d7ba11b
commit 6f006def64
5 changed files with 144 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ from fastapi import APIRouter, Depends, Header, Query
from starlette.responses import JSONResponse
from app.db import normalize_client_id, pop_next_health, pop_next_measure
from app.services.water_video import get_water_video_public_url
from app.settings import Settings, get_settings
router = APIRouter(prefix="/api/v1/biomass", tags=["biomass"])
@@ -121,3 +122,32 @@ async def get_health_result(
},
headers=_new_headers(True),
)
@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)
return JSONResponse(
content={
"code": 200,
"msg": "成功",
"data": {
"video_path": video_path,
},
},
)
@router.get("/sonar/video/")
async def get_sonar_video():
"""声纳图像信息:当前返回空 `video_path`;后续将提供 H.264 编码 MP4 的绝对 URL。"""
return JSONResponse(
content={
"code": 200,
"msg": "成功",
"data": {
"video_path": "",
},
},
)