绑定设备+覆盖模式+控制显示bug+在线更新
This commit is contained in:
@@ -19,6 +19,7 @@ abstract class DeviceTaskDatasource {
|
||||
required int taskId,
|
||||
required int orgId,
|
||||
required int siteId,
|
||||
bool forceCancel = true,
|
||||
});
|
||||
|
||||
Future<bool> pauseTask({
|
||||
@@ -90,6 +91,7 @@ class DeviceTaskDatasourceImpl implements DeviceTaskDatasource {
|
||||
required int taskId,
|
||||
required int orgId,
|
||||
required int siteId,
|
||||
bool forceCancel = true,
|
||||
}) async {
|
||||
final url = '${HttpApiConsts.baseUrl}/iot/deviceTask/cancelTask';
|
||||
final body = {
|
||||
@@ -97,6 +99,7 @@ class DeviceTaskDatasourceImpl implements DeviceTaskDatasource {
|
||||
'taskId': taskId,
|
||||
'orgId': orgId,
|
||||
'siteId': siteId,
|
||||
'forceCancel': forceCancel,
|
||||
};
|
||||
_logger.logWithLevel('[cancelTask] 请求: POST $url');
|
||||
_logger.logWithLevel('[cancelTask] 参数: ${jsonEncode(body)}');
|
||||
|
||||
@@ -34,7 +34,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
|
||||
logger.logWithLevel(
|
||||
'用户点击bindDevice方法API 请求开始',
|
||||
level: 'INFO',
|
||||
data: {'url': 'http://1.95.137.212:59003/iot/device/bindDevice'},
|
||||
data: {'url': '${HttpApiConsts.baseUrl}/iot/device/bindDevice'},
|
||||
);
|
||||
var response = await dio.post(
|
||||
HttpApiConsts.bindDevice,
|
||||
@@ -44,7 +44,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
|
||||
'请求详细参数',
|
||||
level: 'DEBUG',
|
||||
data: {
|
||||
'url': 'http://1.95.137.212:59003/iot/device/bindDevice',
|
||||
'url': '${HttpApiConsts.baseUrl}/iot/device/bindDevice',
|
||||
'deviceId': deviceId,
|
||||
'deviceAlias': deviceAlias,
|
||||
},
|
||||
@@ -122,7 +122,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
|
||||
logger.logWithLevel(
|
||||
'用户点击switchDevice方法API 请求开始',
|
||||
level: 'INFO',
|
||||
data: {'url': 'http://1.95.137.212:59003/iot/device/switchDevice'},
|
||||
data: {'url': '${HttpApiConsts.baseUrl}/iot/device/switchDevice'},
|
||||
);
|
||||
var response = await dio.post(
|
||||
HttpApiConsts.switchDevice,
|
||||
@@ -138,7 +138,7 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
|
||||
'请求详细参数',
|
||||
level: 'DEBUG',
|
||||
data: {
|
||||
'url': 'http://1.95.137.212:59003/iot/device/switchDevice',
|
||||
'url': '${HttpApiConsts.baseUrl}/iot/device/switchDevice',
|
||||
'platform': platform,
|
||||
'deviceId': deviceId,
|
||||
},
|
||||
@@ -219,12 +219,12 @@ class DeviceHttpDatasourceImpl implements DeviceHttpDatasource {
|
||||
'请求详细参数',
|
||||
level: 'DEBUG',
|
||||
data: {
|
||||
'url': 'http://1.95.137.212:59003/iot/device/userDevice',
|
||||
'url': '${HttpApiConsts.baseUrl}/iot/device/userDevice',
|
||||
'tenantName': deviceame,
|
||||
},
|
||||
);
|
||||
final response = await dio.get(
|
||||
'http://1.95.137.212:59003/iot/device/userDevice',
|
||||
'${HttpApiConsts.baseUrl}/iot/device/userDevice',
|
||||
queryParameters: {'tenantName': deviceame},
|
||||
// options: Options(
|
||||
// headers: {
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:maibu_satabot_v2/features/devices/domain/errors/device_failure.d
|
||||
import 'package:maibu_satabot_v2/features/devices/domain/repositories/device_hostrity_work_repository.dart';
|
||||
|
||||
import '../../../../core/logging/i_logger_service.dart';
|
||||
import '../../../../core/consts/http_api_consts.dart';
|
||||
|
||||
class DeviceHostrityWorkRepositoryImpl implements DeviceHostrityWorkRepositoryRepository {
|
||||
final Dio client;
|
||||
@@ -35,7 +36,7 @@ class DeviceHostrityWorkRepositoryImpl implements DeviceHostrityWorkRepositoryRe
|
||||
_logger.logWithLevel('用户信息获取成功,Token: $token', level: 'info');
|
||||
|
||||
final response = await client.get(
|
||||
'http://1.95.137.212:59003/iot/device/getDeviceRunStatistics?deviceId=$deviceId',
|
||||
'${HttpApiConsts.baseUrl}/iot/device/getDeviceRunStatistics?deviceId=$deviceId',
|
||||
options: Options(headers: {'Content-Type': 'application/json', 'Authorization': 'Bearer $token'}),
|
||||
);
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ class DeviceTaskRepositoryImpl implements DeviceTaskRepository {
|
||||
required int taskId,
|
||||
required int orgId,
|
||||
required int siteId,
|
||||
bool forceCancel = true,
|
||||
}) async {
|
||||
try {
|
||||
final result = await datasource.cancelTask(
|
||||
@@ -44,6 +45,7 @@ class DeviceTaskRepositoryImpl implements DeviceTaskRepository {
|
||||
taskId: taskId,
|
||||
orgId: orgId,
|
||||
siteId: siteId,
|
||||
forceCancel: forceCancel,
|
||||
);
|
||||
return Right(result);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user