Commit inicial: ITCA_API_SAP_WMS (.NET Core 3.1)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
2b82744eb8
168 files changed
+11066
No files matched your search
@@ -0,0 +1,44 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Net.Business.DTO;
|
||||
using Net.Business.DTO.Authenticate;
|
||||
using Net.Data;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Net.Business.Services.Controllers
|
||||
{
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ApiExplorerSettings(GroupName = "ApiSAPWMS")]
|
||||
public class AuthenticateController : ControllerBase
|
||||
{
|
||||
private readonly IRepositoryWrapper _repository;
|
||||
public AuthenticateController(IRepositoryWrapper repository)
|
||||
{
|
||||
this._repository = repository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Obtiene Token de Acceso
|
||||
/// </summary>
|
||||
/// <param name="value">Parametros de filtros</param>
|
||||
/// <returns>Devuelve Token de Acceso</returns>
|
||||
[HttpPost]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> Token([FromBody] Dto_AuthenticateRequest value)
|
||||
{
|
||||
|
||||
var objectGetAll = await _repository.Authenticate.GetToken(value.RetornaModelo());
|
||||
|
||||
if (objectGetAll.StatusCode == -1)
|
||||
{
|
||||
return BadRequest(objectGetAll);
|
||||
}
|
||||
|
||||
return Ok(objectGetAll.Data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user