Equipment, Lokáció de még csak a lista

This commit is contained in:
2025-03-15 14:05:05 +01:00
parent a72c9b342e
commit 9f1c3df5d6
41 changed files with 645 additions and 4 deletions
@@ -33,7 +33,51 @@ namespace WorkFlowCheck.Web.Services
return retVal;
}
public async Task<List<EquipmentDTO>> GetAllEquipments()
{
string endpoint = $"{_httpClient.BaseAddress}api/Sync/GetAllEquipments";
var retVal = new List<EquipmentDTO>();
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<List<EquipmentDTO>>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<LocationDTO>> GetAllLocations()
{
string endpoint = $"{_httpClient.BaseAddress}api/Sync/GetAllLocations";
var retVal = new List<LocationDTO>();
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<List<LocationDTO>>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<CheckPointDTO> GetCheckPoint(int id)
{
string endpoint = $"{_httpClient.BaseAddress}api/Sync/GetCheckPoints/{id}";
@@ -55,6 +99,27 @@ namespace WorkFlowCheck.Web.Services
}
return retVal;
}
public async Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id)
{
string endpoint = $"{_httpClient.BaseAddress}api/Sync/GetCheckListTemplateRow/{id}";
var retVal = new CheckListTemplateRowDTO();
try
{
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<CheckListTemplateRowDTO>>(endpoint);
if (response != null)
{
if (response.IsSuccess)
{
return response.Data;
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint(CheckPointDTO checkPointDTO)
{
@@ -5,7 +5,10 @@ namespace WorkFlowCheck.Web.Services.Interfaces
public interface IBaseStockService
{
Task<List<CheckPointDTO>> GetAllCheckPoints();
Task<List<EquipmentDTO>> GetAllEquipments();
Task<List<LocationDTO>> GetAllLocations();
Task<CheckPointDTO> GetCheckPoint(int id);
Task<CheckListTemplateRowDTO> GetCheckListTemplateRow(int id);
Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint(CheckPointDTO checkPoint);
}
}