diff --git a/backend/app/__pycache__/main.cpython-311.pyc b/backend/app/__pycache__/main.cpython-311.pyc index 0625e84..b9e9e61 100644 Binary files a/backend/app/__pycache__/main.cpython-311.pyc and b/backend/app/__pycache__/main.cpython-311.pyc differ diff --git a/backend/app/api/v1/__pycache__/__init__.cpython-311.pyc b/backend/app/api/v1/__pycache__/__init__.cpython-311.pyc index 4338c0e..b5a5d9f 100644 Binary files a/backend/app/api/v1/__pycache__/__init__.cpython-311.pyc and b/backend/app/api/v1/__pycache__/__init__.cpython-311.pyc differ diff --git a/backend/app/api/v1/__pycache__/auth.cpython-311.pyc b/backend/app/api/v1/__pycache__/auth.cpython-311.pyc index 15c4386..a8156af 100644 Binary files a/backend/app/api/v1/__pycache__/auth.cpython-311.pyc and b/backend/app/api/v1/__pycache__/auth.cpython-311.pyc differ diff --git a/backend/app/api/v1/__pycache__/ips.cpython-311.pyc b/backend/app/api/v1/__pycache__/ips.cpython-311.pyc index 5e96667..30c7aa6 100644 Binary files a/backend/app/api/v1/__pycache__/ips.cpython-311.pyc and b/backend/app/api/v1/__pycache__/ips.cpython-311.pyc differ diff --git a/backend/app/api/v1/__pycache__/networks.cpython-311.pyc b/backend/app/api/v1/__pycache__/networks.cpython-311.pyc index 1c437cf..28c5168 100644 Binary files a/backend/app/api/v1/__pycache__/networks.cpython-311.pyc and b/backend/app/api/v1/__pycache__/networks.cpython-311.pyc differ diff --git a/backend/app/api/v1/__pycache__/snmp.cpython-311.pyc b/backend/app/api/v1/__pycache__/snmp.cpython-311.pyc index 53aa76c..343b624 100644 Binary files a/backend/app/api/v1/__pycache__/snmp.cpython-311.pyc and b/backend/app/api/v1/__pycache__/snmp.cpython-311.pyc differ diff --git a/backend/app/services/__pycache__/snmp_service.cpython-311.pyc b/backend/app/services/__pycache__/snmp_service.cpython-311.pyc index a835278..bf5e848 100644 Binary files a/backend/app/services/__pycache__/snmp_service.cpython-311.pyc and b/backend/app/services/__pycache__/snmp_service.cpython-311.pyc differ diff --git a/backend/app/services/snmp_service.py b/backend/app/services/snmp_service.py index fcebeb1..409ff05 100644 --- a/backend/app/services/snmp_service.py +++ b/backend/app/services/snmp_service.py @@ -221,18 +221,20 @@ class SNMPService: arp_data[ip_address]['if_index'] = if_index # 转换为列表 + now = datetime.utcnow() for ip, data in arp_data.items(): if 'mac_address' in data: entry = { 'ip_address': ip, 'mac_address': data.get('mac_address'), 'interface': str(data.get('if_index', '')), - 'device_id': device.id + 'device_id': device.id, + 'last_seen': now.isoformat(), + 'discovered_at': now.isoformat() } arp_entries.append(entry) # 保存到数据库 - now = datetime.utcnow() for entry_data in arp_entries: # 查找是否已存在 existing = db.query(ARPEntry).filter(