This commit is contained in:
HuangHai
2026-01-14 15:54:22 +08:00
parent b4785cb088
commit 9fddb4c6eb
6 changed files with 57 additions and 17 deletions

View File

@@ -41,6 +41,29 @@ class TeLaiDianService:
async def close_db(self):
await self.db.close()
async def save_station_profile_only(self, station_name, address):
if not station_name or not address:
return False
station_hash = self.get_hash(station_name)
now = datetime.now()
async with await self.db.get_session() as session:
profile_id = self.generate_id()
await self.station_profile_model.save(
session=session,
id=profile_id,
station_hash=station_hash,
operator=self.operator,
station_name=station_name,
address=address,
valid_start_time=now
)
await session.commit()
logger.info(f"仅保存场站基础信息: {station_name}")
return True
async def save_station_data(self, station_name, address, prices):
"""
保存场站及其价格数据到数据库