SyncController API

This commit is contained in:
2025-02-06 14:02:18 +01:00
parent 7570908177
commit b5e5158f1e
7 changed files with 135 additions and 0 deletions
@@ -0,0 +1,41 @@
using Microsoft.AspNetCore.Mvc;
using WorkFlowCheck.BL.Services;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class SyncController : ControllerBase
{
private ISyncService _syncService;
public SyncController(ISyncService syncService)
{
_syncService = syncService;
}
[HttpGet("GetAllCheckPoints")]
public async Task<ApiResponseDTO<CheckPointListDTO>> GetAllCheckpoint()
{
var retVal = new ApiResponseDTO<CheckPointListDTO>()
{
IsSuccess = true,
};
var checkPointListDTO = await _syncService.GetAllCheckPoint();
if (checkPointListDTO != null)
{
retVal.IsSuccess = true;
retVal.Data = checkPointListDTO;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
}
}