This commit is contained in:
HuangHai
2026-01-13 20:12:38 +08:00
parent 099f8fb148
commit c1effd1249
6 changed files with 154 additions and 65 deletions

View File

@@ -61,7 +61,7 @@ class XinDianTuService:
async def close_db(self):
await self.db.close()
async def process_station_list_vl(self, vl_image_url_or_path, json_metadata, device_info=None) -> list:
async def process_station_list_vl(self, vl_image_url_or_path, json_metadata, device_info=None, max_count=None) -> list:
"""
基于 VL 模式处理场站列表
"""
@@ -72,6 +72,12 @@ class XinDianTuService:
processed_stations = []
async with await self.db.get_session() as session:
for station in station_list:
# 如果指定了最大数量且已达到,则停止保存
if max_count is not None and len(processed_stations) >= max_count:
# 填充空位以保持索引对齐,但不保存到数据库
processed_stations.append(None)
continue
name = station.get("station_name")
if not name:
continue