connect reports to main door

This commit is contained in:
ashrafzarkanisala
2024-09-18 02:23:42 +03:00
parent 9876ff2e03
commit 7c28012d79
7 changed files with 98 additions and 28 deletions

View File

@ -65,7 +65,8 @@ class DevicesManagementApi {
}
}
static Future<List<DeviceModel>> getDevicesByGatewayId(String gatewayId) async {
static Future<List<DeviceModel>> getDevicesByGatewayId(
String gatewayId) async {
final response = await HTTPService().get(
path: ApiEndpoints.gatewayApi.replaceAll('{gatewayUuid}', gatewayId),
showServerMessage: false,
@ -94,9 +95,14 @@ class DevicesManagementApi {
return response;
}
static Future<DeviceReport> getDeviceReports(String uuid, String code) async {
static Future<DeviceReport> getDeviceReports(String uuid, String code,
[String? from, String? to]) async {
final response = await HTTPService().get(
path: ApiEndpoints.getDeviceLogs.replaceAll('{uuid}', uuid).replaceAll('{code}', code),
path: ApiEndpoints.getDeviceLogsByDate
.replaceAll('{uuid}', uuid)
.replaceAll('{code}', code)
.replaceAll('{startTime}', from ?? '')
.replaceAll('{endTime}', to ?? ''),
showServerMessage: false,
expectedResponseModel: (json) {
return DeviceReport.fromJson(json);