feat: 平台同步状态记录(last_synced_at + 前端展示最后同步时间)

This commit is contained in:
gouki
2026-08-02 16:32:36 +00:00
parent cc69927f8c
commit 6109878c7e
5 changed files with 25 additions and 7 deletions
+5
View File
@@ -6,6 +6,7 @@
"""
import json
from datetime import datetime
from typing import Optional
from fastapi import HTTPException, status
@@ -217,4 +218,8 @@ def sync_provider(session: Session, provider_id: int) -> dict:
except Exception as e: # noqa: BLE001
result["account_error"] = str(e)
provider.last_synced_at = datetime.utcnow()
session.add(provider)
session.commit()
result["last_synced_at"] = provider.last_synced_at.isoformat()
return result