Merge branch 'dev' of https://github.com/SyncrowIOT/web into feat/refactoring

This commit is contained in:
hannathkadher
2024-10-31 09:26:23 +04:00
49 changed files with 2973 additions and 326 deletions
+2 -1
View File
@@ -18,10 +18,11 @@ class AuthenticationAPI {
static Future forgetPassword({
required var email,
required var password,
required var otpCode,
}) async {
final response = await HTTPService().post(
path: ApiEndpoints.forgetPassword,
body: {"email": email, "password": password},
body: {"email": email, "password": password,"otpCode": otpCode},
showServerMessage: true,
expectedResponseModel: (json) {});
return response;
+41
View File
@@ -1,3 +1,4 @@
import 'dart:core';
import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_reports.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
@@ -50,6 +51,22 @@ class DevicesManagementApi {
}
}
Future getPowerClampInfo(String deviceId) async {
try {
final response = await HTTPService().get(
path: ApiEndpoints.powerClamp.replaceAll('{powerClampUuid}', deviceId),
showServerMessage: true,
expectedResponseModel: (json) {
return json;
},
);
return response;
} catch (e) {
debugPrint('Error fetching $e');
return {};
}
}
//deviceControl
Future<bool> deviceControl(String uuid, Status status) async {
try {
@@ -179,6 +196,30 @@ class DevicesManagementApi {
}
}
getPowerStatus(List<String> uuids) async {
try {
final queryParameters = {
'devicesUuid': uuids.join(','),
};
final response = await HTTPService().get(
path: ApiEndpoints.getBatchStatus,
queryParameters: queryParameters,
showServerMessage: true,
expectedResponseModel: (json) {
return json;
},
);
return response;
} catch (e) {
debugPrint('Error fetching $e');
return DeviceStatus(
productUuid: '',
productType: '',
status: [],
);
}
}
Future<bool> addScheduleRecord(
ScheduleEntry sendSchedule, String uuid) async {
try {