38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Net.Data;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Net.Business.Services.Controllers
|
|
{
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
|
[ApiExplorerSettings(GroupName = "ApiSAPWMS")]
|
|
[Authorize(AuthenticationSchemes = "Bearer")]
|
|
public class ItemController : ControllerBase
|
|
{
|
|
private readonly IRepositoryWrapper _repository;
|
|
public ItemController(IRepositoryWrapper repository)
|
|
{
|
|
this._repository = repository;
|
|
}
|
|
|
|
[HttpGet]
|
|
[ProducesResponseType(StatusCodes.Status201Created)]
|
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
|
public async Task<IActionResult> Stock()
|
|
{
|
|
var ObjectNew = await _repository.Items.GetStockItem();
|
|
|
|
if (ObjectNew.StatusCode != 0)
|
|
{
|
|
return BadRequest(ObjectNew);
|
|
}
|
|
return Ok(ObjectNew);
|
|
}
|
|
}
|
|
}
|