diff --git a/CartriX.Api/Controllers/LocationController.cs b/CartriX.Api/Controllers/LocationController.cs index 990e678..18d35df 100644 --- a/CartriX.Api/Controllers/LocationController.cs +++ b/CartriX.Api/Controllers/LocationController.cs @@ -1,3 +1,4 @@ +using CartriX.Api.Interfaces; using CartriX.Api.Services; using CartriX.Shared.Classes; using CartriX.Shared.Mappers; @@ -11,8 +12,8 @@ namespace CartriX.Api.Controllers [Route("api/[controller]")] public class LocationController : ControllerBase { - private readonly LocationService _locationService; - public LocationController(LocationService locationService) + private readonly ILocationService _locationService; + public LocationController(ILocationService locationService) { _locationService = locationService; } diff --git a/CartriX.Api/Controllers/PrinterController.cs b/CartriX.Api/Controllers/PrinterController.cs index 1d9053d..1db3652 100644 --- a/CartriX.Api/Controllers/PrinterController.cs +++ b/CartriX.Api/Controllers/PrinterController.cs @@ -1,4 +1,5 @@ -using CartriX.Api.Services; +using CartriX.Api.Interfaces; +using CartriX.Api.Services; using CartriX.Shared.DTOs.Printer; using CartriX.Shared.Mappers; using Microsoft.AspNetCore.Mvc; @@ -9,8 +10,11 @@ namespace CartriX.Api.Controllers [ApiController] public class PrinterController : ControllerBase { - private readonly PrinterService _printerService; - public PrinterController(PrinterService printerService) => _printerService = printerService; + private readonly IPrinterService _printerService; + public PrinterController(IPrinterService printerService) + { + _printerService = printerService; + } [HttpGet("GetAll")] public async Task GetAll() @@ -24,6 +28,7 @@ namespace CartriX.Api.Controllers Console.WriteLine("Запрос был сделан успешно, вывод."); return Ok(coverted); } + [HttpGet("GetById/{id}")] public async Task GetById([FromRoute]int id) { @@ -40,6 +45,7 @@ namespace CartriX.Api.Controllers Console.WriteLine("Объект конвертирован для вывода информации"); return Ok(convert); } + [HttpPost("AddPrinter")] public async Task AddPrinter([FromBody] CreatePrinterRequestDto requestDto) { diff --git a/CartriX.Api/Interfaces/IPrinterService.cs b/CartriX.Api/Interfaces/IPrinterService.cs index 70515e1..3f61849 100644 --- a/CartriX.Api/Interfaces/IPrinterService.cs +++ b/CartriX.Api/Interfaces/IPrinterService.cs @@ -1,9 +1,9 @@ using CartriX.Shared.DTOs.Printer; using CartriX.Shared.Models; -namespace CartriX.Shared.Interfaces +namespace CartriX.Api.Interfaces { - internal interface IPrinterService + public interface IPrinterService { public Task> GetAll(); public Task GetById(int id); diff --git a/CartriX.Api/Program.cs b/CartriX.Api/Program.cs index 41ff54e..dbe2276 100644 --- a/CartriX.Api/Program.cs +++ b/CartriX.Api/Program.cs @@ -1,3 +1,4 @@ +using CartriX.Api.Interfaces; using CartriX.Api.Services; using CartriX.Shared.Classes; using Microsoft.EntityFrameworkCore; @@ -6,8 +7,8 @@ using Scalar.AspNetCore; var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); -builder.Services.AddScoped(); -builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddCors(options => { diff --git a/CartriX.Api/Properties/launchSettings.json b/CartriX.Api/Properties/launchSettings.json index 5ba7d8c..3f4a591 100644 --- a/CartriX.Api/Properties/launchSettings.json +++ b/CartriX.Api/Properties/launchSettings.json @@ -27,6 +27,16 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "WSL": { + "commandName": "WSL2", + "launchBrowser": true, + "launchUrl": "https://localhost:7209/scalar", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "https://localhost:7209;http://localhost:5197" + }, + "distributionName": "" } }, "$schema": "https://json.schemastore.org/launchsettings.json" diff --git a/CartriX.Api/Services/PrinterService.cs b/CartriX.Api/Services/PrinterService.cs index bbde07c..4f3e745 100644 --- a/CartriX.Api/Services/PrinterService.cs +++ b/CartriX.Api/Services/PrinterService.cs @@ -1,9 +1,9 @@ using CartriX.Shared.Classes; using CartriX.Shared.Mappers; using CartriX.Shared.DTOs.Printer; -using CartriX.Shared.Interfaces; using Microsoft.EntityFrameworkCore; using CartriX.Shared.Models; +using CartriX.Api.Interfaces; namespace CartriX.Api.Services { diff --git a/CartriX.Web/Properties/launchSettings.json b/CartriX.Web/Properties/launchSettings.json index 03d2cf2..e9f243a 100644 --- a/CartriX.Web/Properties/launchSettings.json +++ b/CartriX.Web/Properties/launchSettings.json @@ -1,25 +1,35 @@ { - "$schema": "https://json.schemastore.org/launchsettings.json", "profiles": { "http": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "http://localhost:5098", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "http://localhost:5098" }, "https": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "https://localhost:7283;http://localhost:5094", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:7283;http://localhost:5094" + }, + "WSL": { + "commandName": "WSL2", + "launchBrowser": true, + "launchUrl": "https://localhost:7283", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "https://localhost:7283;http://localhost:5094" + }, + "distributionName": "" } - } -} + }, + "$schema": "https://json.schemastore.org/launchsettings.json" +} \ No newline at end of file