* Added new Entities and Dtos
* Mapping new classes * Added new services and Controllers in API
This commit is contained in:
17
FaKrosnoApi/Controllers/CustomerController.cs
Normal file
17
FaKrosnoApi/Controllers/CustomerController.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 CustomerController(ICustomerService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<CustomerDto>>> GetAllCustomers()
|
||||
{
|
||||
IList<CustomerDto> customers = await service.GetAllCustomers();
|
||||
return Ok(customers);
|
||||
}
|
||||
}
|
||||
17
FaKrosnoApi/Controllers/CustomerTpController.cs
Normal file
17
FaKrosnoApi/Controllers/CustomerTpController.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 CustomerTpController(ICustomerTpService service) : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<CustomerTpDto>>> GetAllCustomers()
|
||||
{
|
||||
IList<CustomerTpDto> customers = await service.GetAllCustomersTp();
|
||||
return Ok(customers);
|
||||
}
|
||||
}
|
||||
16
FaKrosnoApi/Controllers/EdiCustomerOrderImportController.cs
Normal file
16
FaKrosnoApi/Controllers/EdiCustomerOrderImportController.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SytelineSaAppEfDataModel.Services;
|
||||
|
||||
namespace FaKrosnoApi.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class EdiCustomerOrderImportController(IEdiCustomerOrderImportService service) : Controller
|
||||
{
|
||||
[HttpGet("last-update-date")]
|
||||
public async Task<ActionResult<DateTime>> GetLastUpdateDate()
|
||||
{
|
||||
DateTime lastUpdateDate = await service.GetLastUpdateDate();
|
||||
return Ok(lastUpdateDate);
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,9 @@ builder.Services.AddScoped<IWzClientService, WzClientService>();
|
||||
builder.Services.AddScoped<IWzHeaderService, WzHeaderService>();
|
||||
builder.Services.AddScoped<IWzRowMeyleService, WzRowMeyleService>();
|
||||
builder.Services.AddScoped<IItemCustService, ItemCustService>();
|
||||
builder.Services.AddScoped<IEdiCustomerOrderImportService, EdiCustomerOrderImportService>();
|
||||
builder.Services.AddScoped<ICustomerService, CustomerService>();
|
||||
builder.Services.AddScoped<ICustomerTpService, CustomerTpService>();
|
||||
|
||||
builder.Services.AddHostedService<TimedHostedService>();
|
||||
|
||||
@@ -122,6 +125,6 @@ app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.UseHangfireDashboard();
|
||||
// app.UseHangfireDashboard();
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user