feat(api): 添加OLT端口管理和设备发现功能

- 在check.py中更新discover_olt方法,使用scan_and_discover替代check_olt_devices
- 在olt.py中添加get_olt_ports和toggle_olt_port接口,支持获取和控制OLT端口状态
- 添加TogglePortRequest模型用于端口操作请求验证
- 更新SSHService类,新增get_olt_ports和toggle_olt_port方法
- 优化CheckService中的MAC地址索引逻辑,支持模型信息更新
```
This commit is contained in:
2026-04-04 22:13:22 +08:00
parent 381ea7085d
commit dfa8fa62a8
21 changed files with 4121 additions and 733 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ def discover_olt(olt_id: int, db: Session = Depends(get_db)):
"""扫描单台 OLT 并将新发现的 MAC 自动入库关联"""
try:
service = CheckService(db)
result = asyncio.run(service.check_olt_devices(olt_id))
result = service.scan_and_discover(olt_id)
return result
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))