diff --git a/AutoRepairShop/AutoRepairShop.sln b/AutoRepairShop/AutoRepairShop.sln index bb5e326..8dcce3a 100644 --- a/AutoRepairShop/AutoRepairShop.sln +++ b/AutoRepairShop/AutoRepairShop.sln @@ -15,6 +15,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoRepairShopDatabaseImple EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRepairShopView", "AutoRepairShopView\AutoRepairShopView.csproj", "{11B9EC2E-9CA7-454E-8872-19AD291AC2A6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRepairShopRestApi", "AutoRepairShopRestApi\AutoRepairShopRestApi.csproj", "{C0E3E9C4-33A3-4657-8F24-B0DCCE947F54}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +47,10 @@ Global {11B9EC2E-9CA7-454E-8872-19AD291AC2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU {11B9EC2E-9CA7-454E-8872-19AD291AC2A6}.Release|Any CPU.ActiveCfg = Release|Any CPU {11B9EC2E-9CA7-454E-8872-19AD291AC2A6}.Release|Any CPU.Build.0 = Release|Any CPU + {C0E3E9C4-33A3-4657-8F24-B0DCCE947F54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0E3E9C4-33A3-4657-8F24-B0DCCE947F54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0E3E9C4-33A3-4657-8F24-B0DCCE947F54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0E3E9C4-33A3-4657-8F24-B0DCCE947F54}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AutoRepairShop/AutoRepairShopBusinessLogic/AutoRepairShopBusinessLogic.csproj b/AutoRepairShop/AutoRepairShopBusinessLogic/AutoRepairShopBusinessLogic.csproj index 755eac1..26ae577 100644 --- a/AutoRepairShop/AutoRepairShopBusinessLogic/AutoRepairShopBusinessLogic.csproj +++ b/AutoRepairShop/AutoRepairShopBusinessLogic/AutoRepairShopBusinessLogic.csproj @@ -12,6 +12,7 @@ + diff --git a/AutoRepairShop/AutoRepairShopBusinessLogic/BusinessLogic/ManagerLogic.cs b/AutoRepairShop/AutoRepairShopBusinessLogic/BusinessLogic/ManagerLogic.cs index 4525ab0..1eb2fbc 100644 --- a/AutoRepairShop/AutoRepairShopBusinessLogic/BusinessLogic/ManagerLogic.cs +++ b/AutoRepairShop/AutoRepairShopBusinessLogic/BusinessLogic/ManagerLogic.cs @@ -3,6 +3,8 @@ using AutoRepairShopContracts.BusinessLogicsContracts; using AutoRepairShopContracts.SearchModels; using AutoRepairShopContracts.StoragesContracts; using AutoRepairShopContracts.ViewModels; +using AutoRepairShopDatabaseImplement.Models; +using AutoRepairShopDataModels.Models; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -16,12 +18,14 @@ namespace AutoRepairShopBusinessLogic.BusinessLogic { private readonly ILogger _logger; private readonly IManagerStorage _managerStorage; + private readonly IClientStorage _clientStorage; - public ManagerLogic(ILogger logger, IManagerStorage managerStorage) + public ManagerLogic(ILogger logger, IManagerStorage managerStorage, IClientStorage clientStorage) { _logger = logger; _managerStorage = managerStorage; - } + _clientStorage = clientStorage; + } public bool Create(ManagerBindingModel model) { @@ -45,8 +49,25 @@ namespace AutoRepairShopBusinessLogic.BusinessLogic } return true; } + public void AssignPoints(int clientId, int points) + { + var client = _clientStorage.GetElement(new ClientSearchModel { Id = clientId }); + if (client != null) + { + var newPoints = new PointBindingModel + { + ClientId = clientId, + Amount = points + }; - public ManagerViewModel? ReadElement(ManagerSearchModel model) + _clientStorage.AssignPoints(newPoints); + } + else + { + throw new ArgumentException($"Client with id {clientId} not found"); + } + } + public ManagerViewModel? ReadElement(ManagerSearchModel model) { if (model == null) { diff --git a/AutoRepairShop/AutoRepairShopContracts/BindingModels/ClientBindingModel.cs b/AutoRepairShop/AutoRepairShopContracts/BindingModels/ClientBindingModel.cs index 66a93fa..9ca13aa 100644 --- a/AutoRepairShop/AutoRepairShopContracts/BindingModels/ClientBindingModel.cs +++ b/AutoRepairShop/AutoRepairShopContracts/BindingModels/ClientBindingModel.cs @@ -12,5 +12,6 @@ namespace AutoRepairShopContracts.BindingModels public int Id { get; set; } public string ClientFIO { get; set; } = string.Empty; public string JobTitle { get; set; } = string.Empty; + public int Points { get; set; } } } diff --git a/AutoRepairShop/AutoRepairShopContracts/BindingModels/PointBindingModel.cs b/AutoRepairShop/AutoRepairShopContracts/BindingModels/PointBindingModel.cs index 4e77e84..5bbf38c 100644 --- a/AutoRepairShop/AutoRepairShopContracts/BindingModels/PointBindingModel.cs +++ b/AutoRepairShop/AutoRepairShopContracts/BindingModels/PointBindingModel.cs @@ -9,6 +9,7 @@ namespace AutoRepairShopContracts.BindingModels { public class PointBindingModel : IPointModel { + public int ClientId { get; set; } public int Id { get; set; } public int Amount { get; set; } } diff --git a/AutoRepairShop/AutoRepairShopContracts/BusinessLogicsContracts/IClientLogic.cs b/AutoRepairShop/AutoRepairShopContracts/BusinessLogicsContracts/IClientLogic.cs index f642d0f..8220ccb 100644 --- a/AutoRepairShop/AutoRepairShopContracts/BusinessLogicsContracts/IClientLogic.cs +++ b/AutoRepairShop/AutoRepairShopContracts/BusinessLogicsContracts/IClientLogic.cs @@ -16,5 +16,6 @@ namespace AutoRepairShopContracts.BusinessLogicsContracts bool Create(ClientBindingModel model); bool Update(ClientBindingModel model); bool Delete(ClientBindingModel model); + bool AssignPoints(ClientBindingModel model); } } diff --git a/AutoRepairShop/AutoRepairShopContracts/SearchModels/ClientSearchModel.cs b/AutoRepairShop/AutoRepairShopContracts/SearchModels/ClientSearchModel.cs index db2f07c..b1bdd00 100644 --- a/AutoRepairShop/AutoRepairShopContracts/SearchModels/ClientSearchModel.cs +++ b/AutoRepairShop/AutoRepairShopContracts/SearchModels/ClientSearchModel.cs @@ -11,5 +11,6 @@ namespace AutoRepairShopContracts.SearchModels public int? Id { get; set; } public string? ClientFIO { get; set; } public string? JobTitle { get; set; } + public int? Points { get; set; } } } diff --git a/AutoRepairShop/AutoRepairShopContracts/StoragesContracts/IClientStorage.cs b/AutoRepairShop/AutoRepairShopContracts/StoragesContracts/IClientStorage.cs index 923adeb..aa4f687 100644 --- a/AutoRepairShop/AutoRepairShopContracts/StoragesContracts/IClientStorage.cs +++ b/AutoRepairShop/AutoRepairShopContracts/StoragesContracts/IClientStorage.cs @@ -17,5 +17,6 @@ namespace AutoRepairShopContracts.StoragesContracts ClientViewModel? Insert(ClientBindingModel model); ClientViewModel? Update(ClientBindingModel model); ClientViewModel? Delete(ClientBindingModel model); + ClientViewModel? AssignPoints(PointBindingModel model); } } diff --git a/AutoRepairShop/AutoRepairShopContracts/ViewModels/ClientViewModel.cs b/AutoRepairShop/AutoRepairShopContracts/ViewModels/ClientViewModel.cs index 8b39278..eb0f36a 100644 --- a/AutoRepairShop/AutoRepairShopContracts/ViewModels/ClientViewModel.cs +++ b/AutoRepairShop/AutoRepairShopContracts/ViewModels/ClientViewModel.cs @@ -15,5 +15,7 @@ namespace AutoRepairShopContracts.ViewModels public string ClientFIO { get; set; } = string.Empty; [DisplayName("Должность")] public string JobTitle { get; set; } = string.Empty; + [DisplayName("Баллы")] + public int Points { get; set; } } } diff --git a/AutoRepairShop/AutoRepairShopContracts/ViewModels/PointViewModel.cs b/AutoRepairShop/AutoRepairShopContracts/ViewModels/PointViewModel.cs index d1c8682..004a653 100644 --- a/AutoRepairShop/AutoRepairShopContracts/ViewModels/PointViewModel.cs +++ b/AutoRepairShop/AutoRepairShopContracts/ViewModels/PointViewModel.cs @@ -11,6 +11,7 @@ namespace AutoRepairShopContracts.ViewModels public class PointViewModel : IPointModel { public int Id { get; set; } + public int ClientId { get; set; } [DisplayName("Количество")] public int Amount { get; set; } } diff --git a/AutoRepairShop/AutoRepairShopDatabaseImplement/Implements/ClientStorage.cs b/AutoRepairShop/AutoRepairShopDatabaseImplement/Implements/ClientStorage.cs index 601556b..f609b06 100644 --- a/AutoRepairShop/AutoRepairShopDatabaseImplement/Implements/ClientStorage.cs +++ b/AutoRepairShop/AutoRepairShopDatabaseImplement/Implements/ClientStorage.cs @@ -85,5 +85,24 @@ namespace AutoRepairShopDatabaseImplement.Implements context.SaveChanges(); return client.GetViewModel; } + public ClientViewModel? AssignPoints(PointBindingModel model) + { + using var context = new AutoRepairShopDatabase(); + var client = context.Clients.FirstOrDefault(x => x.Id == model.ClientId); + if (client == null) + { + return null; + } + var newPoint = new Point + { + ClientId = client.Id, + Amount = model.Amount + }; + + context.Points.Add(newPoint); + context.SaveChanges(); + client.Points.Add(newPoint); + return client.GetViewModel; + } } } diff --git a/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Client.cs b/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Client.cs index 58dd203..98d0da5 100644 --- a/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Client.cs +++ b/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Client.cs @@ -18,9 +18,9 @@ namespace AutoRepairShopDatabaseImplement.Models public string ClientFIO { get; set; } [Required] public string JobTitle { get; set; } - // для реализации связи многие ко многим с изделиями [ForeignKey("ClientId")] public virtual List WorkClients { get; set; } = new(); + public List Points { get; set; } public static Client? Create(ClientBindingModel model) { if (model == null) diff --git a/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Point.cs b/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Point.cs index 87f1ec5..f84f8ad 100644 --- a/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Point.cs +++ b/AutoRepairShop/AutoRepairShopDatabaseImplement/Models/Point.cs @@ -14,6 +14,8 @@ namespace AutoRepairShopDatabaseImplement.Models { public int Id { get; set; } [Required] + public int ClientId { get; set; } + [Required] public int Amount { get; set; } public static Point? Create(PointBindingModel model) { @@ -23,6 +25,7 @@ namespace AutoRepairShopDatabaseImplement.Models } return new Point() { + ClientId = model.ClientId, Id = model.Id, Amount = model.Amount }; @@ -38,6 +41,7 @@ namespace AutoRepairShopDatabaseImplement.Models public PointViewModel GetViewModel => new() { Id = Id, + ClientId = ClientId, Amount = Amount }; } diff --git a/AutoRepairShop/AutoRepairShopRestApi/AutoRepairShopRestApi.csproj b/AutoRepairShop/AutoRepairShopRestApi/AutoRepairShopRestApi.csproj new file mode 100644 index 0000000..8bfbda1 --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/AutoRepairShopRestApi.csproj @@ -0,0 +1,33 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + diff --git a/AutoRepairShop/AutoRepairShopRestApi/Controllers/ClientController.cs b/AutoRepairShop/AutoRepairShopRestApi/Controllers/ClientController.cs new file mode 100644 index 0000000..fa07bbd --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/Controllers/ClientController.cs @@ -0,0 +1,79 @@ +using AutoRepairShopContracts.BindingModels; +using AutoRepairShopContracts.BusinessLogicsContracts; +using AutoRepairShopContracts.SearchModels; +using AutoRepairShopContracts.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace AutoRepairShopRestApi.Controllers +{ + [ApiController] + [Route("[controller]")] + public class ClientController : ControllerBase + { + private readonly ILogger _logger; + private readonly IClientLogic _logic; + + public ClientController(IClientLogic logic, ILogger logger) + { + _logger = logger; + _logic = logic; + } + + [HttpGet] + public void GetClientInfo(int id) + { + try + { + var clientInfo = _logic.ReadElement(new ClientSearchModel { Id = id }); + if (clientInfo != null) + { + Response.WriteAsync(clientInfo.ToString()); + } + else + { + Response.StatusCode = 404; + Response.WriteAsync($"Client with ID {id} not found"); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Error fetching client information"); + } + } + + [HttpPost] + public void CreateClient(ClientBindingModel model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Failed to create client"); + } + } + + [HttpPost] + public void AssignPointsToClient(ClientBindingModel model) + { + try + { + if (_logic.AssignPoints(model)) + { + Response.WriteAsync($"Successfully assigned {model.Points} points to client with ID {model.Id}"); + } + else + { + Response.StatusCode = 400; + Response.WriteAsync($"Failed to assign points to client with ID {model.Id}"); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Failed to assign points to client"); + + } + } + } +} diff --git a/AutoRepairShop/AutoRepairShopRestApi/Controllers/MainController.cs b/AutoRepairShop/AutoRepairShopRestApi/Controllers/MainController.cs new file mode 100644 index 0000000..4d7d9af --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/Controllers/MainController.cs @@ -0,0 +1,15 @@ +using Microsoft.AspNetCore.Mvc; + +namespace AutoRepairShopRestApi.Controllers +{ + [ApiController] + [Route("[controller]")] + public class MainController : ControllerBase + { + [HttpGet] + public IActionResult Index() + { + return Ok("Welcome to the main page"); + } + } +} diff --git a/AutoRepairShop/AutoRepairShopRestApi/Controllers/ManagerController.cs b/AutoRepairShop/AutoRepairShopRestApi/Controllers/ManagerController.cs new file mode 100644 index 0000000..f4bc8bf --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/Controllers/ManagerController.cs @@ -0,0 +1,66 @@ +using AutoRepairShopContracts.BindingModels; +using AutoRepairShopContracts.BusinessLogicsContracts; +using AutoRepairShopContracts.SearchModels; +using AutoRepairShopContracts.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace AutoRepairShopRestApi.Controllers +{ + [ApiController] + [Route("[controller]")] + public class ManagerController : ControllerBase + { + private readonly ILogger _logger; + private readonly IManagerLogic _logic; + + public ManagerController(IManagerLogic logic, ILogger logger) + { + _logger = logger; + _logic = logic; + } + + [HttpGet] + public ManagerViewModel? Login(string login, string password) + { + try + { + return _logic.ReadElement(new ManagerSearchModel + { + Login = login, + Password = password + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка входа в систему"); + throw; + } + } + [HttpPost] + public void Register(ManagerBindingModel model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка регистрации"); + throw; + } + } + [HttpPost] + public void UpdateData(ManagerBindingModel model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления данных"); + throw; + } + } + } +} diff --git a/AutoRepairShop/AutoRepairShopRestApi/Program.cs b/AutoRepairShop/AutoRepairShopRestApi/Program.cs new file mode 100644 index 0000000..5065c72 --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/Program.cs @@ -0,0 +1,50 @@ +using AutoRepairShopBusinessLogic.BusinessLogic; +using AutoRepairShopContracts.BusinessLogicsContracts; +using AutoRepairShopContracts.StoragesContracts; +using AutoRepairShopDatabaseImplement.Implements; +using Microsoft.OpenApi.Models; + + +var builder = WebApplication.CreateBuilder(args); + +builder.Logging.SetMinimumLevel(LogLevel.Trace); +builder.Logging.AddLog4Net(@"log4net.config"); + +// Add services to the container. +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); + +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddControllers(); + +// Learn more about configuring Swagger/OpenAPI at +https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(c => +{ + c.SwaggerDoc("v1", new OpenApiInfo + { + Title = "AutoRepairShopRestApi", + Version + = "v1" + }); +}); +var app = builder.Build(); +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", + "AutoRepairShopRestApi v1")); +} +app.UseHttpsRedirection(); +app.UseAuthorization(); +app.MapControllers(); +app.Run(); \ No newline at end of file diff --git a/AutoRepairShop/AutoRepairShopRestApi/Properties/Resources.Designer.cs b/AutoRepairShop/AutoRepairShopRestApi/Properties/Resources.Designer.cs new file mode 100644 index 0000000..1d3db70 --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace AutoRepairShopRestApi.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoRepairShopRestApi.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/AutoRepairShop/AutoRepairShopRestApi/Properties/Resources.resx b/AutoRepairShop/AutoRepairShopRestApi/Properties/Resources.resx new file mode 100644 index 0000000..4fdb1b6 --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/Properties/Resources.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AutoRepairShop/AutoRepairShopRestApi/Properties/launchSettings.json b/AutoRepairShop/AutoRepairShopRestApi/Properties/launchSettings.json new file mode 100644 index 0000000..2f337ca --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:27887", + "sslPort": 44314 + } + }, + "profiles": { + "AutoRepairShopRestApi": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7143;http://localhost:5267", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/AutoRepairShop/AutoRepairShopRestApi/appsettings.Development.json b/AutoRepairShop/AutoRepairShopRestApi/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/AutoRepairShop/AutoRepairShopRestApi/appsettings.json b/AutoRepairShop/AutoRepairShopRestApi/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/AutoRepairShop/AutoRepairShopRestApi/log4net.config b/AutoRepairShop/AutoRepairShopRestApi/log4net.config new file mode 100644 index 0000000..43b77f9 --- /dev/null +++ b/AutoRepairShop/AutoRepairShopRestApi/log4net.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file