visitor password api

This commit is contained in:
mohammad
2024-08-20 10:44:15 +03:00
parent 5b9a6197e6
commit 0cf5053f8b
8 changed files with 170 additions and 17 deletions

View File

@ -63,7 +63,7 @@ class AccessMangApi{
}');
final response = await HTTPService().post(
path: ApiEndpoints.sendOfflineOneTime,
path: ApiEndpoints.sendOnlineOneTime,
body: jsonEncode({
"email": email,
"passwordName": passwordName,
@ -106,7 +106,7 @@ class AccessMangApi{
print('createPassword =$body');
final response = await HTTPService().post(
path: ApiEndpoints.sendOfflineMultipleTime,
path: ApiEndpoints.sendOnlineMultipleTime,
body: jsonEncode(body),
showServerMessage: true,
expectedResponseModel: (json) {
@ -121,7 +121,76 @@ class AccessMangApi{
}
}
// OffLine One Time Password
Future postOffLineOneTime({String? email,String? passwordName,List<String>? devicesUuid}) async {
try {
print('postOfflineOneTime List: ${
{
"email": email,
"passwordName": passwordName,
"devicesUuid": devicesUuid
}
}');
final response = await HTTPService().post(
path: ApiEndpoints.sendOffLineOneTime,
body: jsonEncode({
"email": email,
"passwordName": passwordName,
"devicesUuid": devicesUuid
}),
showServerMessage: true,
expectedResponseModel: (json) {
List<dynamic> jsonData = json;
print('postOfflineOneTime List: $json');
},
);
return response;
} catch (e) {
debugPrint('Error fetching $e');
return [];
}
}
Future postOffLineMultipleTime({
String? email,
String? passwordName,
String? effectiveTime,
String? invalidTime,
List<String>? devicesUuid
}) async {
try {
print('postOfflineOneTime List: ${
{
"email": email,
"passwordName": passwordName,
"devicesUuid": devicesUuid
}
}');
final response = await HTTPService().post(
path: ApiEndpoints.sendOffLineOneTime,
body: jsonEncode({
"email": email,
"devicesUuid":devicesUuid,
"passwordName": passwordName,
"effectiveTime": effectiveTime,
"invalidTime": invalidTime
}),
showServerMessage: true,
expectedResponseModel: (json) {
List<dynamic> jsonData = json;
print('postOfflineOneTime List: $json');
},
);
return response;
} catch (e) {
debugPrint('Error fetching $e');
return [];
}
}
}