API és endpoint kiegészítése

This commit is contained in:
2025-02-19 15:49:53 +01:00
parent 2ae985c6e0
commit 790f92a940
7 changed files with 88 additions and 14 deletions
@@ -19,7 +19,9 @@ namespace WorkFlowCheck.BL.Mappings
.ForMember(dest => dest.PasswordHash, opt => opt.MapFrom<PasswordHashResolver>());
CreateMap<CheckListTemplateHeader, CheckListTemplateHeaderDTO>();
CreateMap<CheckListTemplateHeader, CheckListTemplateHeaderDTO>()
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
CreateMap<CheckListTemplateRow, CheckListTemplateRowDTO>();
CreateMap<CheckPoint, CheckPointDTO>();
}
}
@@ -5,6 +5,7 @@ namespace WorkFlowCheck.BL.Services.Interfaces
{
public interface ISyncService
{
Task<CheckPointListDTO> GetAllCheckPoint();
Task<CheckPointListDTO> GetAllCheckPointAsync();
Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateAsync();
}
}
+22 -1
View File
@@ -20,7 +20,7 @@ namespace WorkFlowCheck.BL.Services
_mapper = mapper;
}
public async Task<CheckPointListDTO> GetAllCheckPoint()
public async Task<CheckPointListDTO> GetAllCheckPointAsync()
{
var retVal = new CheckPointListDTO();
@@ -39,6 +39,27 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateAsync()
{
var retVal = new List<CheckListTemplateHeaderDTO>();
try
{
var res = await _dbContext.CheckListTemplateHeaders.Include(i => i.CheckListTemplateRows).AsNoTracking().ToListAsync();
if (res != null)
{
retVal = _mapper.Map<List<CheckListTemplateHeaderDTO>>(res);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<CheckPointListDTO> GetAllLocation()
{
var retVal = new CheckPointListDTO();