NFC azonosítás is beállítva
This commit is contained in:
@@ -109,6 +109,44 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponseDTO<UserDTO>> AuthenticateNFC(string NFCCode)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Az API végpont meghatározása
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/user/authenticatenfc";
|
||||
|
||||
var userSimpleDTO = new UserSimpleDTO()
|
||||
{
|
||||
UserName = NFCCode,
|
||||
Password = NFCCode,
|
||||
|
||||
};
|
||||
|
||||
// HTTP POST kérés küldése
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, userSimpleDTO))
|
||||
{
|
||||
httpResponseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
var jsonString = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
var response = JsonConvert.DeserializeObject<ApiResponseDTO<UserDTO>>(jsonString);
|
||||
|
||||
return response ?? new ApiResponseDTO<UserDTO>
|
||||
{
|
||||
IsSuccess = false,
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Hiba visszaadása
|
||||
return new ApiResponseDTO<UserDTO>
|
||||
{
|
||||
IsSuccess = false
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponseDTO<string>> SyncUsers_Up(Action<double, string> reportProgress)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<string>();
|
||||
@@ -116,7 +154,7 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
{
|
||||
await PrepareAuthenticatedRequestAsync();
|
||||
|
||||
var userList = await _dbContext.Users.ToListAsync();
|
||||
var userList = await _dbContext.MobileUsers.ToListAsync();
|
||||
|
||||
var userListDTO = _mapper.Map<List<UserDTO>>(userList);
|
||||
var endpoint = $"{_httpClient.BaseAddress}api/Sync/UpdateAllUser";
|
||||
|
||||
Reference in New Issue
Block a user