import '../models/bo/device_topology_bo.dart';
import '../repositories/device_topology_repository.dart';

class DeviceTopologyService {
  final DeviceTopologyRepository _repository;

  DeviceTopologyService({required DeviceTopologyRepository repository})
      : _repository = repository;

  Future<DeviceTopologyBO> getTopology({required String deviceId}) async {
    final result = await _repository.getTopology(deviceId: deviceId);
    if (result.success && result.data != null) {
      return result.data!;
    }
    throw Exception(result.msg);
  }
}