mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 03:10:46 +08:00
Split port traffic service and replace deprecated UTC/lifespan APIs.
Keep the public facade stable while moving device CRUD and sample/compare logic into focused modules, and use naive UTC via timeutil plus FastAPI lifespan. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6dc3946bc6
commit
a2f91f6ee2
12 changed files with 1171 additions and 1044 deletions
|
|
@ -17,6 +17,7 @@ from .db import get_db
|
|||
from .importer import aggregate_alarms, import_alarm_excel, query_alarms
|
||||
from .models import AiAnalyzeHistory, AlarmBatch, AlarmNorm, ImportErrorRow, ImportJob
|
||||
from .parser_config import load_parser_config
|
||||
from .timeutil import utcnow_naive
|
||||
from .schemas import (
|
||||
AiAnalyzeHistoryItem,
|
||||
AiAnalyzeHistoryResponse,
|
||||
|
|
@ -276,7 +277,7 @@ def ap_analyze(payload: dict, db: Session = Depends(get_db)) -> dict:
|
|||
answer=answer,
|
||||
error=err,
|
||||
evidence_json=json.dumps(diag or {}, ensure_ascii=False),
|
||||
created_at=datetime.utcnow(),
|
||||
created_at=utcnow_naive(),
|
||||
)
|
||||
db.add(row)
|
||||
db.commit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue