Van új és folytatható CheckLista
This commit is contained in:
@@ -12,9 +12,16 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
public class CheckListService : BaseService, ICheckListService
|
||||
{
|
||||
private readonly IUserService _userService;
|
||||
public CheckListService(HttpClient httpClient, IConfiguration configuration, AppDbContext dbContext, IMapper mapper, IUserService userService) : base(httpClient, configuration, dbContext, mapper)
|
||||
private readonly ISyncService _syncService;
|
||||
public CheckListService(HttpClient httpClient,
|
||||
IConfiguration configuration,
|
||||
AppDbContext dbContext,
|
||||
IMapper mapper,
|
||||
IUserService userService,
|
||||
ISyncService syncService) : base(httpClient, configuration, dbContext, mapper)
|
||||
{
|
||||
_userService = userService;
|
||||
_syncService = syncService;
|
||||
}
|
||||
|
||||
public async Task<ApiResponseDTO<CheckPointDTO>> GetCheckPoint(int checkPointId)
|
||||
@@ -39,7 +46,7 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
{
|
||||
await PrepareAuthenticatedRequestAsync();
|
||||
// Az API végpont meghatározása
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/checklist/startnew";
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/checklist/StartNewCheckList";
|
||||
|
||||
// HTTP POST kérés küldése
|
||||
ApiRequestDTO<CheckListTemplateHeaderDTO> request = new ApiRequestDTO<CheckListTemplateHeaderDTO>();
|
||||
@@ -69,5 +76,40 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<CheckListHeaderDTO>> GetCheckLists(int userId)
|
||||
{
|
||||
await _syncService.SyncDatas();
|
||||
|
||||
var retVal = new List<CheckListHeaderDTO>();
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckListHeaders.ToListAsync();
|
||||
retVal = _mapper.Map<List<CheckListHeaderDTO>>(res);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<List<CheckListTemplateHeaderDTO>> GetCheckListTemplates(int userId)
|
||||
{
|
||||
await _syncService.SyncDatas();
|
||||
|
||||
var retVal = new List<CheckListTemplateHeaderDTO>();
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckListTemplateHeaders.ToListAsync();
|
||||
retVal = _mapper.Map<List<CheckListTemplateHeaderDTO>>(res);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user