* Added new Controllers to API
* Added methods to get WZs for specific client
This commit is contained in:
17
FaKrosnoApi/Controllers/WzClientController.cs
Normal file
17
FaKrosnoApi/Controllers/WzClientController.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class WzClientController(IWzClientService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<WzClientDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<WzClientDto> wzClients = await service.GetAll();
|
||||
return Ok(wzClients);
|
||||
}
|
||||
}
|
||||
26
FaKrosnoApi/Controllers/WzHeaderController.cs
Normal file
26
FaKrosnoApi/Controllers/WzHeaderController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class WzHeaderController(IWzHeaderService service, IMaterialTransactionService materialTransactionService) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<WzHeaderDto>>> GetAll()
|
||||
{
|
||||
IEnumerable<WzHeaderDto> wzHeaders = await service.GetAll();
|
||||
return Ok(wzHeaders);
|
||||
}
|
||||
|
||||
[HttpGet("by-customer-number")]
|
||||
public async Task<ActionResult<IEnumerable<MaterialTransactionDto>>> GetByCustomerNumber(
|
||||
[FromQuery] string customerNumber, [FromQuery] int customerSequence)
|
||||
{
|
||||
IEnumerable<MaterialTransactionDto> materialTransactions =
|
||||
await materialTransactionService.GetByCustomerNumber(customerNumber, customerSequence);
|
||||
return Ok(materialTransactions);
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ builder.Services.AddOpenApiDocument(config =>
|
||||
In = OpenApiSecurityApiKeyLocation.Header,
|
||||
Description = "Wprowadź token JWT w formacie: Bearer {token}"
|
||||
});
|
||||
|
||||
|
||||
config.OperationProcessors.Add(new OperationSecurityScopeProcessor("Bearer"));
|
||||
});
|
||||
|
||||
@@ -100,6 +100,9 @@ builder.Services.AddScoped<IRoleService, RoleService>();
|
||||
builder.Services.AddScoped<IFunctionService, FunctionService>();
|
||||
builder.Services.AddScoped<IUserRoleService, UserRoleService>();
|
||||
builder.Services.AddScoped<IProductService, ProductService>();
|
||||
builder.Services.AddScoped<IMaterialTransactionService, MaterialTransactionService>();
|
||||
builder.Services.AddScoped<IWzClientService, WzClientService>();
|
||||
builder.Services.AddScoped<IWzHeaderService, WzHeaderService>();
|
||||
|
||||
builder.Services.AddHostedService<TimedHostedService>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user