forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
подготовка
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
using MagicCarpetContracts.BusinessLogicContracts;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
namespace MagicCarpetBusinessLogic.Implementations;
|
||||||
|
|
||||||
|
public class ReportContract : IReportContract
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetContracts.AdapterContracts;
|
||||||
|
|
||||||
|
public interface IReportAdapter
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using MagicCarpetContracts.Infrastructure;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetContracts.AdapterContracts.OperationResponses;
|
||||||
|
|
||||||
|
public class ReportOperationResponse : OperationResponse
|
||||||
|
{
|
||||||
|
Task<ReportOperationResponse> GetDataSaleByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
|
||||||
|
|
||||||
|
Task<ReportOperationResponse> GetDataSalaryByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
|
||||||
|
|
||||||
|
Task<ReportOperationResponse> CreateDocumentSalesByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
|
||||||
|
|
||||||
|
Task<ReportOperationResponse> CreateDocumentSalaryByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagicCarpetContracts.BusinessLogicContracts;
|
||||||
|
|
||||||
|
public interface IReportContract
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace MagicCarpetWebApi.Adapters;
|
||||||
|
|
||||||
|
public class ReportAdapter
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using MagicCarpetContracts.AdapterContracts;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace MagicCarpetWebApi.Controllers;
|
||||||
|
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class ReportController(IReportAdapter reportAdapter) : ControllerBase
|
||||||
|
{
|
||||||
|
private IReportAdapter _reportAdapter = reportAdapter;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using MagicCarpetBusinessLogic.Implementations;
|
using MagicCarpetBusinessLogic.Implementations;
|
||||||
using MagicCarpetContracts.AdapterContracts;
|
using MagicCarpetContracts.AdapterContracts;
|
||||||
using MagicCarpetContracts.BuisnessLogicContracts;
|
using MagicCarpetContracts.BuisnessLogicContracts;
|
||||||
|
using MagicCarpetContracts.BusinessLogicContracts;
|
||||||
using MagicCarpetContracts.Infrastructure;
|
using MagicCarpetContracts.Infrastructure;
|
||||||
using MagicCarpetContracts.StoragesContracts;
|
using MagicCarpetContracts.StoragesContracts;
|
||||||
using MagicCarpetDatabase;
|
using MagicCarpetDatabase;
|
||||||
@@ -73,6 +74,9 @@ builder.Services.AddTransient<ISaleAdapter, SaleAdapter>();
|
|||||||
builder.Services.AddTransient<IEmployeeAdapter, EmployeeAdapter>();
|
builder.Services.AddTransient<IEmployeeAdapter, EmployeeAdapter>();
|
||||||
builder.Services.AddTransient<ISalaryAdapter, SalaryAdapter>();
|
builder.Services.AddTransient<ISalaryAdapter, SalaryAdapter>();
|
||||||
|
|
||||||
|
builder.Services.AddTransient<IReportContract, ReportContract>();
|
||||||
|
builder.Services.AddTransient<IReportAdapter, ReportAdapter>();
|
||||||
|
|
||||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||||
builder.Services.AddOpenApi();
|
builder.Services.AddOpenApi();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user