forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
исправлени, наконец то 4 работает, УРААААА
This commit is contained in:
@@ -16,7 +16,7 @@ public interface ISaleAdapter
|
||||
|
||||
SaleOperationResponse GetClientList(string id, DateTime fromDate, DateTime toDate);
|
||||
|
||||
SaleOperationResponse GetCocktailList(string id, DateTime fromDate, DateTime toDate);
|
||||
SaleOperationResponse GetTourList(string id, DateTime fromDate, DateTime toDate);
|
||||
|
||||
SaleOperationResponse GetElement(string id);
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MagicCarpetContracts.DataModels;
|
||||
|
||||
public class PostDataModel(string id, string postName, PostType postType, double salary) : IValidation
|
||||
public class PostDataModel(string postId, string postName, PostType postType, double salary) : IValidation
|
||||
{
|
||||
public string Id { get; private set; } = id;
|
||||
public string Id { get; private set; } = postId;
|
||||
public string PostName { get; private set; } = postName;
|
||||
public PostType PostType { get; private set; } = postType;
|
||||
public double Salary { get; private set; } = salary;
|
||||
|
||||
@@ -370,11 +370,12 @@ internal class TourControllerTests : BaseWebApiControllerTest
|
||||
});
|
||||
}
|
||||
|
||||
private static TourBindingModel CreateModel(string? id = null, string tourName = "name", TourType tourType = TourType.Beach, double price = 1)
|
||||
private static TourBindingModel CreateModel(string? id = null, string tourName = "name", string tourCountry = "country", TourType tourType = TourType.Beach, double price = 1)
|
||||
=> new()
|
||||
{
|
||||
Id = id ?? Guid.NewGuid().ToString(),
|
||||
TourName = tourName,
|
||||
TourCountry = tourCountry,
|
||||
TourType = tourType.ToString(),
|
||||
Price = price
|
||||
};
|
||||
|
||||
@@ -125,7 +125,7 @@ public class SaleAdapter : ISaleAdapter
|
||||
}
|
||||
}
|
||||
|
||||
public SaleOperationResponse GetCocktailList(string id, DateTime fromDate, DateTime toDate)
|
||||
public SaleOperationResponse GetTourList(string id, DateTime fromDate, DateTime toDate)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace MagicCarpetWebApi.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[Produces("application/json")]
|
||||
public class EmployeesController(IEmployeeAdapter adapter) : ControllerBase
|
||||
|
||||
@@ -33,9 +33,9 @@ public class SalesController(ISaleAdapter adapter) : ControllerBase
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult GetCocktailRecords(string id, DateTime fromDate, DateTime toDate)
|
||||
public IActionResult GetTourRecords(string id, DateTime fromDate, DateTime toDate)
|
||||
{
|
||||
return _adapter.GetCocktailList(id, fromDate, toDate).GetResponse(Request, Response);
|
||||
return _adapter.GetTourList(id, fromDate, toDate).GetResponse(Request, Response);
|
||||
}
|
||||
|
||||
[HttpGet("{data}")]
|
||||
|
||||
@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace MagicCarpetWebApi.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[Produces("application/json")]
|
||||
public class ToursController(ITourAdapter adapter) : ControllerBase
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.2" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:1754",
|
||||
"sslPort": 44390
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5235",
|
||||
"environmentVariables": {
|
||||
@@ -22,20 +14,11 @@
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"launchBrowser": false,
|
||||
"applicationUrl": "https://localhost:7030;http://localhost:5235",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user