POST hogy tudjunk menteni is.

This commit is contained in:
2025-03-13 14:23:19 +01:00
parent a301a2a168
commit d2106514ba
4 changed files with 69 additions and 9 deletions
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Serilog;
using WorkFlowCheck.BL.Services;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
@@ -14,7 +15,7 @@ namespace WorkFlowCheck.API.Controllers
{
_syncService = syncService;
}
[HttpGet("GetAllCheckPoints")]
public async Task<ApiResponseDTO<List<CheckPointDTO>>> GetAllCheckpointsAsync()
{
@@ -26,9 +27,9 @@ namespace WorkFlowCheck.API.Controllers
if (checkPointListDTO != null)
{
retVal.IsSuccess = true;
retVal.Data = checkPointListDTO;
retVal.IsSuccess = true;
retVal.Data = checkPointListDTO;
}
else
{
@@ -38,7 +39,7 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("GetCheckPoints/{id}")]
public async Task<ApiResponseDTO<CheckPointDTO>> GetAllCheckpointsAsync(int id)
{
@@ -134,5 +135,27 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpPost("authenticate")]
public async Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint([FromBody] CheckPointDTO checkPointDTO)
{
var retVal = new ApiResponseDTO<CheckPointDTO>()
{
IsSuccess = true
};
try
{
var result = await _syncService.UpdateCheckPointAsync(checkPointDTO);
retVal.Data = result;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
}
}