fix(security): complete security and delivery compliance remediation
This commit is contained in:
@@ -8,6 +8,7 @@ from sqlalchemy import asc, desc, distinct, or_
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from app.core.database import get_db
|
||||
from app.core.errors import internal_error
|
||||
from app.middleware.permission_middleware import require_permission
|
||||
from app.models.device import ONUDevice, DeviceStatusHistory, OLTDevice, DeviceReplacement
|
||||
from app.schemas.device import DeviceListResponse, ONUDeviceResponse, RebootResponse, OpticalPowerResponse
|
||||
@@ -439,7 +440,7 @@ def refresh_device_status(
|
||||
result = service.check_single_device(device_id)
|
||||
return result
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
raise internal_error("Refresh device status", e)
|
||||
|
||||
|
||||
|
||||
@@ -641,7 +642,7 @@ def reboot_device(
|
||||
result = IMCService().reboot_onu(device.mac_address)
|
||||
return RebootResponse(**result)
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=f"重启失败: {str(e)}")
|
||||
raise internal_error("Reboot ONU", e)
|
||||
|
||||
|
||||
@router.get("/{device_id}/optical-power", response_model=OpticalPowerResponse)
|
||||
@@ -694,7 +695,7 @@ def get_device_optical_power(
|
||||
except HTTPException:
|
||||
raise
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=f"获取光功率失败: {str(e)}")
|
||||
raise internal_error("Get optical power", e)
|
||||
|
||||
|
||||
@router.get("/{device_id}/onu-events")
|
||||
@@ -726,7 +727,7 @@ def get_onu_events(
|
||||
"events": events,
|
||||
}
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=f"查询失败: {str(e)}")
|
||||
raise internal_error("Get ONU events", e)
|
||||
|
||||
|
||||
@router.get("/{device_id}/optical-power-history")
|
||||
|
||||
Reference in New Issue
Block a user