mirror of
https://github.com/hansjone/netx.git
synced 2026-10-10 13:50:44 +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
9
netx_api/timeutil.py
Normal file
9
netx_api/timeutil.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"""Timezone helpers. DB columns store naive UTC; keep values naive for comparisons."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timezone
|
||||
|
||||
|
||||
def utcnow_naive() -> datetime:
|
||||
return datetime.now(timezone.utc).replace(tzinfo=None)
|
||||
Loading…
Add table
Add a link
Reference in a new issue