Commit 77fb6258 authored by 张宏's avatar 张宏

解耦

parent a49802fa
class DeviceTopologyBO {
final DeviceTopologyInfoBO deviceInfo;
final List<TreeNodeBO> treeNodes;
const DeviceTopologyBO({
required this.deviceInfo,
required this.treeNodes,
});
factory DeviceTopologyBO.fromJson(Map<String, dynamic> json) {
return DeviceTopologyBO(
deviceInfo: DeviceTopologyInfoBO.fromJson(
json['deviceInfo'] as Map<String, dynamic>? ?? {},
),
treeNodes: (json['treeNodes'] as List<dynamic>?)
?.map((e) => TreeNodeBO.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
);
}
}
class DeviceTopologyInfoBO {
final int deviceId;
final String deviceName;
final String deviceCode;
final String locationText;
const DeviceTopologyInfoBO({
required this.deviceId,
required this.deviceName,
required this.deviceCode,
required this.locationText,
});
factory DeviceTopologyInfoBO.fromJson(Map<String, dynamic> json) {
return DeviceTopologyInfoBO(
deviceId: json['deviceId'] as int? ?? 0,
deviceName: json['deviceName'] as String? ?? '',
deviceCode: json['deviceCode'] as String? ?? '',
locationText: json['locationText'] as String? ?? '',
);
}
}
class TreeNodeBO {
final int deviceId;
final String deviceName;
final String deviceType;
final String icon;
final String status;
final String statusText;
final String deviceCode;
const TreeNodeBO({
required this.deviceId,
required this.deviceName,
required this.deviceType,
required this.icon,
required this.status,
required this.statusText,
required this.deviceCode,
});
factory TreeNodeBO.fromJson(Map<String, dynamic> json) {
return TreeNodeBO(
deviceId: json['deviceId'] as int? ?? 0,
deviceName: json['deviceName'] as String? ?? '',
deviceType: json['deviceType'] as String? ?? '',
icon: json['icon'] as String? ?? '',
status: json['status'] as String? ?? '',
statusText: json['statusText'] as String? ?? '',
deviceCode: json['deviceCode'] as String? ?? '',
);
}
}
\ No newline at end of file
import '../utils/http/response_model.dart';
import '../utils/http/dio_request.dart';
import '../models/bo/device_topology_bo.dart';
class DeviceTopologyRepository {
/// 获取设备拓扑
Future<ResponseModel<DeviceTopologyBO>> getTopology({required int deviceId}) {
return DioRequest.instance.post<DeviceTopologyBO>(
'/app/device/topology',
data: {'deviceId': deviceId},
fromJsonT: (data) =>
DeviceTopologyBO.fromJson(data as Map<String, dynamic>),
);
}
}
\ No newline at end of file
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 int deviceId}) async {
final result = await _repository.getTopology(deviceId: deviceId);
if (result.success && result.data != null) {
return result.data!;
}
throw Exception(result.msg);
}
}
\ No newline at end of file
...@@ -2,9 +2,7 @@ import 'package:auto_route/auto_route.dart'; ...@@ -2,9 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/repositories/alert_detail_repository.dart';
import 'package:smart_hotel_app/routes/app_router.gr.dart'; import 'package:smart_hotel_app/routes/app_router.gr.dart';
import 'package:smart_hotel_app/services/alert_detail_service.dart';
import 'package:smart_hotel_app/views/home/abnormal/cubit/abnormal_cubit.dart'; import 'package:smart_hotel_app/views/home/abnormal/cubit/abnormal_cubit.dart';
import 'package:smart_hotel_app/views/home/abnormal/cubit/abnormal_state.dart'; import 'package:smart_hotel_app/views/home/abnormal/cubit/abnormal_state.dart';
import 'package:smart_hotel_app/views/home/abnormal/widget/alarm_info_block.dart'; import 'package:smart_hotel_app/views/home/abnormal/widget/alarm_info_block.dart';
...@@ -20,11 +18,7 @@ class AbnormalDetailView extends StatelessWidget { ...@@ -20,11 +18,7 @@ class AbnormalDetailView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocProvider( return BlocProvider(
create: (_) { create: (_) => AbnormalCubit(alertId: alertId),
final repository = AlertDetailRepository();
final service = AlertDetailService(repository: repository);
return AbnormalCubit(service: service, alertId: alertId);
},
child: Scaffold( child: Scaffold(
backgroundColor: const Color.fromRGBO(242, 243, 245, 1), backgroundColor: const Color.fromRGBO(242, 243, 245, 1),
appBar: AppBar( appBar: AppBar(
......
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:smart_hotel_app/models/bo/alert_detail_bo.dart'; import 'package:smart_hotel_app/models/bo/alert_detail_bo.dart';
import 'package:smart_hotel_app/repositories/alert_detail_repository.dart';
import 'package:smart_hotel_app/services/alert_detail_service.dart'; import 'package:smart_hotel_app/services/alert_detail_service.dart';
import 'package:smart_hotel_app/views/home/abnormal/cubit/abnormal_state.dart'; import 'package:smart_hotel_app/views/home/abnormal/cubit/abnormal_state.dart';
...@@ -9,9 +10,12 @@ class AbnormalCubit extends Cubit<AbnormalState> { ...@@ -9,9 +10,12 @@ class AbnormalCubit extends Cubit<AbnormalState> {
final int _alertId; final int _alertId;
AbnormalCubit({ AbnormalCubit({
required AlertDetailService service, AlertDetailService? service,
required int alertId, required int alertId,
}) : _service = service, }) : _service = service ??
AlertDetailService(
repository: AlertDetailRepository(),
),
_alertId = alertId, _alertId = alertId,
super(const AbnormalState()) { super(const AbnormalState()) {
loadDetail(); loadDetail();
......
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:smart_hotel_app/models/bo/device_control_bo.dart'; import 'package:smart_hotel_app/models/bo/device_control_bo.dart';
import 'package:smart_hotel_app/repositories/device_control_repository.dart';
import 'package:smart_hotel_app/services/device_control_service.dart'; import 'package:smart_hotel_app/services/device_control_service.dart';
import 'package:smart_hotel_app/views/home/device/cubit/device_state.dart'; import 'package:smart_hotel_app/views/home/device/cubit/device_state.dart';
...@@ -8,9 +9,12 @@ class DeviceCubit extends Cubit<DeviceState> { ...@@ -8,9 +9,12 @@ class DeviceCubit extends Cubit<DeviceState> {
final int _deviceId; final int _deviceId;
DeviceCubit({ DeviceCubit({
required DeviceControlService service, DeviceControlService? service,
required int deviceId, required int deviceId,
}) : _service = service, }) : _service = service ??
DeviceControlService(
repository: DeviceControlRepository(),
),
_deviceId = deviceId, _deviceId = deviceId,
super(const DeviceState()) { super(const DeviceState()) {
loadDetail(); loadDetail();
......
...@@ -2,8 +2,6 @@ import 'package:auto_route/auto_route.dart'; ...@@ -2,8 +2,6 @@ import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/repositories/device_control_repository.dart';
import 'package:smart_hotel_app/services/device_control_service.dart';
import 'package:smart_hotel_app/views/home/device/cubit/device_cubit.dart'; import 'package:smart_hotel_app/views/home/device/cubit/device_cubit.dart';
import 'package:smart_hotel_app/views/home/device/cubit/device_state.dart'; import 'package:smart_hotel_app/views/home/device/cubit/device_state.dart';
import 'package:smart_hotel_app/views/home/device/widget/device_parms_block.dart'; import 'package:smart_hotel_app/views/home/device/widget/device_parms_block.dart';
...@@ -19,11 +17,7 @@ class DeviceDetailView extends StatelessWidget { ...@@ -19,11 +17,7 @@ class DeviceDetailView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocProvider( return BlocProvider(
create: (_) { create: (_) => DeviceCubit(deviceId: deviceId),
final repository = DeviceControlRepository();
final service = DeviceControlService(repository: repository);
return DeviceCubit(service: service, deviceId: deviceId);
},
child: Scaffold( child: Scaffold(
backgroundColor: const Color.fromRGBO(242, 243, 245, 1), backgroundColor: const Color.fromRGBO(242, 243, 245, 1),
appBar: AppBar( appBar: AppBar(
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:smart_hotel_app/models/bo/alert_dashboard_bo.dart'; import 'package:smart_hotel_app/models/bo/alert_dashboard_bo.dart';
import 'package:smart_hotel_app/repositories/alert_dashboard_repository.dart';
import 'package:smart_hotel_app/services/alert_dashboard_service.dart'; import 'package:smart_hotel_app/services/alert_dashboard_service.dart';
import 'package:smart_hotel_app/views/home/index/cubit/home_index_state.dart'; import 'package:smart_hotel_app/views/home/index/cubit/home_index_state.dart';
class HomeIndexCubit extends Cubit<HomeIndexState> { class HomeIndexCubit extends Cubit<HomeIndexState> {
final AlertDashboardService _service; final AlertDashboardService _service;
HomeIndexCubit({required AlertDashboardService service}) HomeIndexCubit({AlertDashboardService? service})
: _service = service, : _service = service ??
AlertDashboardService(
repository: AlertDashboardRepository(),
),
super(const HomeIndexState()) { super(const HomeIndexState()) {
loadDashboard(); loadDashboard();
} }
......
...@@ -3,8 +3,6 @@ import 'package:flutter/material.dart'; ...@@ -3,8 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/models/bo/alert_dashboard_bo.dart'; import 'package:smart_hotel_app/models/bo/alert_dashboard_bo.dart';
import 'package:smart_hotel_app/repositories/alert_dashboard_repository.dart';
import 'package:smart_hotel_app/services/alert_dashboard_service.dart';
import 'package:smart_hotel_app/views/home/index/cubit/home_index_cubit.dart'; import 'package:smart_hotel_app/views/home/index/cubit/home_index_cubit.dart';
import 'package:smart_hotel_app/views/home/index/cubit/home_index_state.dart'; import 'package:smart_hotel_app/views/home/index/cubit/home_index_state.dart';
import 'package:smart_hotel_app/views/home/index/widget/equipment_list_block.dart'; import 'package:smart_hotel_app/views/home/index/widget/equipment_list_block.dart';
...@@ -20,11 +18,7 @@ class HomeView extends StatelessWidget { ...@@ -20,11 +18,7 @@ class HomeView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocProvider( return BlocProvider(
create: (_) { create: (_) => HomeIndexCubit(),
final repository = AlertDashboardRepository();
final service = AlertDashboardService(repository: repository);
return HomeIndexCubit(service: service);
},
child: LayoutBuilder( child: LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
return SingleChildScrollView( return SingleChildScrollView(
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:smart_hotel_app/models/bo/device_topology_bo.dart';
import 'package:smart_hotel_app/repositories/device_topology_repository.dart';
import 'package:smart_hotel_app/services/device_topology_service.dart';
import 'inspection_topology_state.dart'; import 'inspection_topology_state.dart';
class InspectionTopologyCubit extends Cubit<InspectionTopologyState> { class InspectionTopologyCubit extends Cubit<InspectionTopologyState> {
InspectionTopologyCubit() final DeviceTopologyService _service;
: super(const InspectionTopologyState( final int _deviceId;
deviceName: '',
deviceModel: '', InspectionTopologyCubit({
topologyNodes: [], DeviceTopologyService? service,
)) { required int deviceId,
_loadTopologyData(); }) : _service = service ??
DeviceTopologyService(
repository: DeviceTopologyRepository(),
),
_deviceId = deviceId,
super(const InspectionTopologyState()) {
loadTopology();
} }
void selectNode(TopologyNode? node) { void selectNode(TopologyNode? node) {
emit(state.copyWith(selectedNode: node)); emit(state.copyWith(selectedNode: node));
} }
void _loadTopologyData() { Future<void> loadTopology() async {
emit(const InspectionTopologyState(isLoading: true));
try {
final topology = await _service.getTopology(deviceId: _deviceId);
_emitFromTopology(topology);
} catch (e) {
emit(InspectionTopologyState(error: e.toString()));
}
}
void _emitFromTopology(DeviceTopologyBO topology) {
final info = topology.deviceInfo;
final nodes = topology.treeNodes;
final rootNode = _buildTopologyTree(nodes);
// 计算连接数: 父节点到每个子节点一条连接
int connectionCount = 0;
for (final child in rootNode.children) {
connectionCount++; // 根到子
connectionCount += child.children.length; // 子到孙
}
emit(InspectionTopologyState(
deviceName: info.deviceName,
deviceModel: '${info.deviceCode}·${info.locationText}',
topologyNodes: [rootNode],
deviceCount: _countAllNodes(rootNode),
connectionCount: connectionCount,
));
}
/// 将 API 返回的扁平节点列表转换为树结构 + 自动计算位置
TopologyNode _buildTopologyTree(List<TreeNodeBO> nodes) {
if (nodes.isEmpty) {
return TopologyNode(
id: '0',
name: '未知设备',
status: 'offline',
children: [],
x: 0.5,
y: 0.15,
);
}
// 第一个节点作为根节点
final root = nodes.first;
final children = nodes.length > 1 ? nodes.sublist(1) : <TreeNodeBO>[];
// 如果子节点 <= 6,平分到第二层;否则将前6个放第二层,其余作为叶子
final int maxLevel2 = 6;
final level2Nodes = children.take(maxLevel2).toList();
final leafNodes = children.length > maxLevel2
? children.sublist(maxLevel2)
: <TreeNodeBO>[];
final rootNode = TopologyNode( final rootNode = TopologyNode(
id: '1', id: root.deviceId.toString(),
name: '智能空开', name: root.deviceName,
status: 'online', status: root.status,
x: 0.5, x: 0.5,
y: 0.15, y: 0.15,
children: [ children: level2Nodes.asMap().entries.map((entry) {
TopologyNode( final idx = entry.key;
id: '2', final node = entry.value;
name: '串口分配器', // 在第二层均匀分布
status: 'online', final xPos = (level2Nodes.length == 1)
x: 0.25, ? 0.5
: 0.15 + (0.7 * idx / (level2Nodes.length - 1));
return TopologyNode(
id: node.deviceId.toString(),
name: node.deviceName,
status: node.status,
x: xPos,
y: 0.45, y: 0.45,
children: [ children: [],
TopologyNode( );
id: '5', }).toList(),
name: '环境采集',
status: 'online',
x: 0.15,
y: 0.75,
children: [],
),
TopologyNode(
id: '6',
name: '人体存在',
status: 'online',
x: 0.35,
y: 0.75,
children: [],
),
],
),
TopologyNode(
id: '3',
name: '网关',
status: 'online',
x: 0.5,
y: 0.45,
children: [
TopologyNode(
id: '7',
name: '环境采集',
status: 'online',
x: 0.45,
y: 0.75,
children: [],
),
TopologyNode(
id: '8',
name: '人体存在',
status: 'online',
x: 0.55,
y: 0.75,
children: [],
),
],
),
TopologyNode(
id: '4',
name: 'WIFI',
status: 'online',
x: 0.75,
y: 0.45,
children: [
TopologyNode(
id: '9',
name: '环境采集',
status: 'online',
x: 0.65,
y: 0.75,
children: [],
),
TopologyNode(
id: '10',
name: '人体存在',
status: 'online',
x: 0.85,
y: 0.75,
children: [],
),
],
),
],
); );
emit(InspectionTopologyState( // 补充叶子节点:附着到最近的第二层节点上
deviceName: '客房305 智能空开', if (leafNodes.isNotEmpty && rootNode.children.isNotEmpty) {
deviceModel: 'A-301智能空开·客房301', final leafNode = leafNodes.first;
topologyNodes: [rootNode], final lastLevel2Idx = rootNode.children.length - 1;
deviceCount: 10, final lastLevel2 = rootNode.children[lastLevel2Idx];
connectionCount: 11, final updatedChildren = List<TopologyNode>.from(rootNode.children);
)); updatedChildren[lastLevel2Idx] = TopologyNode(
id: lastLevel2.id,
name: lastLevel2.name,
status: lastLevel2.status,
x: lastLevel2.x,
y: lastLevel2.y,
children: leafNodes.asMap().entries.map((entry) {
final idx = entry.key;
final leaf = entry.value;
final xPos = (leafNodes.length == 1)
? lastLevel2.x
: lastLevel2.x -
0.1 +
(0.2 * idx / (leafNodes.length - 1));
return TopologyNode(
id: leaf.deviceId.toString(),
name: leaf.deviceName,
status: leaf.status,
x: xPos,
y: 0.75,
children: [],
);
}).toList(),
);
return TopologyNode(
id: rootNode.id,
name: rootNode.name,
status: rootNode.status,
x: rootNode.x,
y: rootNode.y,
children: updatedChildren,
);
}
return rootNode;
}
int _countAllNodes(TopologyNode node) {
int count = 1;
for (final child in node.children) {
count += _countAllNodes(child);
}
return count;
} }
} }
\ No newline at end of file
...@@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; ...@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
class InspectionTopologyState extends Equatable { class InspectionTopologyState extends Equatable {
final bool isLoading;
final String? error;
final String deviceName; final String deviceName;
final String deviceModel; final String deviceModel;
final List<TopologyNode> topologyNodes; final List<TopologyNode> topologyNodes;
...@@ -10,15 +12,19 @@ class InspectionTopologyState extends Equatable { ...@@ -10,15 +12,19 @@ class InspectionTopologyState extends Equatable {
final TopologyNode? selectedNode; final TopologyNode? selectedNode;
const InspectionTopologyState({ const InspectionTopologyState({
required this.deviceName, this.isLoading = false,
required this.deviceModel, this.error,
required this.topologyNodes, this.deviceName = '',
this.deviceCount = 10, this.deviceModel = '',
this.connectionCount = 11, this.topologyNodes = const [],
this.deviceCount = 0,
this.connectionCount = 0,
this.selectedNode, this.selectedNode,
}); });
InspectionTopologyState copyWith({ InspectionTopologyState copyWith({
bool? isLoading,
String? error,
String? deviceName, String? deviceName,
String? deviceModel, String? deviceModel,
List<TopologyNode>? topologyNodes, List<TopologyNode>? topologyNodes,
...@@ -27,6 +33,8 @@ class InspectionTopologyState extends Equatable { ...@@ -27,6 +33,8 @@ class InspectionTopologyState extends Equatable {
TopologyNode? selectedNode, TopologyNode? selectedNode,
}) { }) {
return InspectionTopologyState( return InspectionTopologyState(
isLoading: isLoading ?? this.isLoading,
error: error,
deviceName: deviceName ?? this.deviceName, deviceName: deviceName ?? this.deviceName,
deviceModel: deviceModel ?? this.deviceModel, deviceModel: deviceModel ?? this.deviceModel,
topologyNodes: topologyNodes ?? this.topologyNodes, topologyNodes: topologyNodes ?? this.topologyNodes,
...@@ -37,7 +45,16 @@ class InspectionTopologyState extends Equatable { ...@@ -37,7 +45,16 @@ class InspectionTopologyState extends Equatable {
} }
@override @override
List<Object?> get props => [deviceName, deviceModel, topologyNodes, deviceCount, connectionCount, selectedNode]; List<Object?> get props => [
isLoading,
error,
deviceName,
deviceModel,
topologyNodes,
deviceCount,
connectionCount,
selectedNode,
];
} }
class TopologyNode extends Equatable { class TopologyNode extends Equatable {
...@@ -59,4 +76,4 @@ class TopologyNode extends Equatable { ...@@ -59,4 +76,4 @@ class TopologyNode extends Equatable {
@override @override
List<Object?> get props => [id, name, status, children, x, y]; List<Object?> get props => [id, name, status, children, x, y];
} }
\ No newline at end of file
...@@ -11,12 +11,14 @@ import 'widget/device_detail_dialog.dart'; ...@@ -11,12 +11,14 @@ import 'widget/device_detail_dialog.dart';
@RoutePage() @RoutePage()
class InspectionTopologyView extends StatelessWidget { class InspectionTopologyView extends StatelessWidget {
const InspectionTopologyView({super.key}); final int deviceId;
const InspectionTopologyView({super.key, this.deviceId = 0});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocProvider( return BlocProvider(
create: (_) => InspectionTopologyCubit(), create: (_) => InspectionTopologyCubit(deviceId: deviceId),
child: const InspectionTopologyPage(), child: const InspectionTopologyPage(),
); );
} }
...@@ -51,6 +53,45 @@ class InspectionTopologyPage extends StatelessWidget { ...@@ -51,6 +53,45 @@ class InspectionTopologyPage extends StatelessWidget {
), ),
body: BlocBuilder<InspectionTopologyCubit, InspectionTopologyState>( body: BlocBuilder<InspectionTopologyCubit, InspectionTopologyState>(
builder: (context, state) { builder: (context, state) {
if (state.isLoading) {
return const Center(
child: CircularProgressIndicator(),
);
}
if (state.error != null) {
return Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 28.w),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
state.error!,
style: TextStyle(
fontSize: 28.sp,
color: const Color.fromRGBO(239, 68, 68, 1),
),
textAlign: TextAlign.center,
),
SizedBox(height: 24.h),
ElevatedButton(
onPressed: () {
context
.read<InspectionTopologyCubit>()
.loadTopology();
},
child: Text(
'重新加载',
style: TextStyle(fontSize: 28.sp),
),
),
],
),
),
);
}
return Stack( return Stack(
children: [ children: [
SingleChildScrollView( SingleChildScrollView(
...@@ -86,4 +127,4 @@ class InspectionTopologyPage extends StatelessWidget { ...@@ -86,4 +127,4 @@ class InspectionTopologyPage extends StatelessWidget {
), ),
); );
} }
} }
\ No newline at end of file
# 智慧酒店 App 接口对接方案 # 智慧酒店 App 接口对接方案
...@@ -192,6 +192,8 @@ class xxxBO extends Equatable { ...@@ -192,6 +192,8 @@ class xxxBO extends Equatable {
| 设备拓扑 |GET | /app/device/topology | 未对接 | 设备拓扑 | 相关页面:InspectionTopologyView | | 设备拓扑 |GET | /app/device/topology | 未对接 | 设备拓扑 | 相关页面:InspectionTopologyView |
### 3.2 接口详细定义 ### 3.2 接口详细定义
...@@ -467,13 +469,13 @@ class xxxBO extends Equatable { ...@@ -467,13 +469,13 @@ class xxxBO extends Equatable {
"code": 0, "code": 0,
"msg": "string", "msg": "string",
"data": { "data": {
"deviceInfo": { "deviceInfo": { // 当前设备信息
"deviceId": 0, "deviceId": 0,
"deviceName": "string", "deviceName": "string",
"deviceCode": "string", "deviceCode": "string",
"locationText": "string" "locationText": "string"
}, },
"treeNodes": [ "treeNodes": [ // 拓扑节点列表(上下游关联设备)
{ {
"deviceId": 0, "deviceId": 0,
"deviceName": "string", "deviceName": "string",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment